Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0c0d6b4b
authored
Aug 03, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化充值订单号
parent
fda2fd2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
controller/topup.go
+2
-2
controller/user.go
+3
-3
No files found.
controller/topup.go
View file @
0c0d6b4b
...
...
@@ -101,8 +101,8 @@ func RequestEpay(c *gin.Context) {
}
uri
,
params
,
err
:=
client
.
Purchase
(
&
epay
.
PurchaseArgs
{
Type
:
payType
,
ServiceTradeNo
:
"A"
+
tradeNo
,
Name
:
"B"
+
tradeNo
,
ServiceTradeNo
:
fmt
.
Sprintf
(
"USR%d-%s"
,
id
,
tradeNo
)
,
Name
:
fmt
.
Sprintf
(
"TUC%d"
,
req
.
Amount
)
,
Money
:
strconv
.
FormatFloat
(
payMoney
,
'f'
,
2
,
64
),
Device
:
epay
.
PC
,
NotifyUrl
:
notifyUrl
,
...
...
controller/user.go
View file @
0c0d6b4b
...
...
@@ -791,11 +791,11 @@ type topUpRequest struct {
Key
string
`json:"key"`
}
var
l
ock
=
sync
.
Mutex
{}
var
topUpL
ock
=
sync
.
Mutex
{}
func
TopUp
(
c
*
gin
.
Context
)
{
l
ock
.
Lock
()
defer
l
ock
.
Unlock
()
topUpL
ock
.
Lock
()
defer
topUpL
ock
.
Unlock
()
req
:=
topUpRequest
{}
err
:=
c
.
ShouldBindJSON
(
&
req
)
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment