Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
system_pay
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王沛
system_pay
Commits
23c95f8b
Commit
23c95f8b
authored
Oct 08, 2023
by
wangp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拉卡拉退款 post => get
parent
c5969647
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
134 additions
and
132 deletions
+134
-132
pay.go
controller/api/v1/pay/pay.go
+28
-13
docs.go
docs/docs.go
+36
-41
swagger.json
docs/swagger.json
+36
-41
swagger.yaml
docs/swagger.yaml
+31
-34
pay_router.go
router/v1/pay_router.go
+2
-2
setting.go
setting/setting.go
+1
-1
No files found.
controller/api/v1/pay/pay.go
View file @
23c95f8b
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"fmt"
"fmt"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"go.uber.org/zap"
"strconv"
"system_pay/controller/base"
"system_pay/controller/base"
"system_pay/models"
"system_pay/models"
"system_pay/repository/pay"
"system_pay/repository/pay"
...
@@ -50,31 +51,45 @@ func (l *PayController) UnifiedOrder(c *gin.Context) {
...
@@ -50,31 +51,45 @@ func (l *PayController) UnifiedOrder(c *gin.Context) {
base
.
ResponseSuccess
(
c
,
rtn
)
base
.
ResponseSuccess
(
c
,
rtn
)
}
}
//
Unified
Refund 拉卡拉退款
// Refund 拉卡拉退款
// @Summary 拉卡拉退款
// @Summary 拉卡拉退款
// @Description 拉卡拉退款
// @Description 拉卡拉退款
// @Tags 拉卡拉退款
// @Tags 拉卡拉退款
// @Accept application/json
// @Accept application/json
// @Produce application/json
// @Produce application/json
// @Param body body models.RefundParamInput true "参数"
// @Param orderId path string true "退款号:原对账单流水号"
// @Param operator path string true "操作人/退款原因"
// @Param money path string true "退款金额,个位为分"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文"
// @Success 200
// @Success 200
// @router /api/v1/pay/unified_refund [post]
// @router /api/v1/pay/refund/{orderId}/{operator}/{money} [put]
func
(
l
*
PayController
)
UnifiedRefund
(
c
*
gin
.
Context
)
{
func
(
l
*
PayController
)
Refund
(
c
*
gin
.
Context
)
{
ph
:=
new
(
models
.
RefundParamInput
)
//ph := new(models.RefundParamInput)
err
:=
c
.
ShouldBindJSON
(
ph
)
//err := c.ShouldBindJSON(ph)
//if err != nil {
// zap.L().Error(err.Error())
// base.ResponseErrorWithMsg(c, base.ServerError)
// return
//}
//退款金额,个位为分
money
,
err
:=
strconv
.
ParseFloat
(
c
.
Param
(
"money"
),
64
)
if
err
!=
nil
{
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
fmt
.
Println
(
"退款金额转换失败:"
,
err
)
base
.
ResponseErrorWithMsg
(
c
,
base
.
ServerError
)
return
return
}
}
var
ph
models
.
RefundParamInput
ph
.
RefundNo
=
c
.
Param
(
"orderId"
)
//退款号:原对账单流水号
ph
.
RefundAmount
=
money
//退款金额,个位为分
ph
.
RefundReason
=
c
.
Param
(
"operator"
)
//退款原因
ip
:=
c
.
ClientIP
()
ip
:=
c
.
ClientIP
()
fmt
.
Println
(
"ip="
+
ip
)
fmt
.
Println
(
"ip="
+
ip
)
// 拉卡拉退款
// 拉卡拉退款
rtn
,
err
:=
pay
.
UnifiedRefund
(
ph
,
ip
)
rtn
,
err
:=
pay
.
UnifiedRefund
(
&
ph
,
ip
)
if
err
!=
nil
{
if
err
!=
nil
{
zap
.
L
()
.
Error
(
err
.
Error
())
zap
.
L
()
.
Error
(
err
.
Error
())
base
.
ResponseErrorMsg
(
c
,
err
.
Error
())
base
.
ResponseErrorMsg
(
c
,
err
.
Error
())
...
@@ -90,13 +105,13 @@ func (l *PayController) UnifiedRefund(c *gin.Context) {
...
@@ -90,13 +105,13 @@ func (l *PayController) UnifiedRefund(c *gin.Context) {
// @Tags 拉卡拉支付查询
// @Tags 拉卡拉支付查询
// @Accept application/json
// @Accept application/json
// @Produce application/json
// @Produce application/json
// @Param order
_i
d path string true "订单号"
// @Param order
I
d path string true "订单号"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文"
// @Param language header string ture "语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文"
// @Success 200
// @Success 200
// @router /api/v1/pay/order_state/{order
_i
d} [get]
// @router /api/v1/pay/order_state/{order
I
d} [get]
func
(
l
*
PayController
)
OrderState
(
c
*
gin
.
Context
)
{
func
(
l
*
PayController
)
OrderState
(
c
*
gin
.
Context
)
{
orderID
:=
c
.
Param
(
"order
_i
d"
)
orderID
:=
c
.
Param
(
"order
I
d"
)
// 拉卡拉支付查询
// 拉卡拉支付查询
rtn
,
err
:=
pay
.
OrderState
(
orderID
)
rtn
,
err
:=
pay
.
OrderState
(
orderID
)
...
...
docs/docs.go
View file @
23c95f8b
...
@@ -60,7 +60,7 @@ var doc = `{
...
@@ -60,7 +60,7 @@ var doc = `{
}
}
}
}
},
},
"/api/v1/pay/order_state/{order
_i
d}": {
"/api/v1/pay/order_state/{order
I
d}": {
"get": {
"get": {
"description": "拉卡拉支付查询",
"description": "拉卡拉支付查询",
"consumes": [
"consumes": [
...
@@ -77,7 +77,7 @@ var doc = `{
...
@@ -77,7 +77,7 @@ var doc = `{
{
{
"type": "string",
"type": "string",
"description": "订单号",
"description": "订单号",
"name": "order
_i
d",
"name": "order
I
d",
"in": "path",
"in": "path",
"required": true
"required": true
},
},
...
@@ -95,9 +95,9 @@ var doc = `{
...
@@ -95,9 +95,9 @@ var doc = `{
}
}
}
}
},
},
"/api/v1/pay/
scan_notice
": {
"/api/v1/pay/
refund/{orderId}/{operator}/{money}
": {
"p
os
t": {
"p
u
t": {
"description": "拉卡拉
统一支付回调(聚合扫码)
",
"description": "拉卡拉
退款
",
"consumes": [
"consumes": [
"application/json"
"application/json"
],
],
...
@@ -105,18 +105,30 @@ var doc = `{
...
@@ -105,18 +105,30 @@ var doc = `{
"application/json"
"application/json"
],
],
"tags": [
"tags": [
"拉卡拉
统一支付回调
"
"拉卡拉
退款
"
],
],
"summary": "拉卡拉
统一支付回调(聚合扫码)
",
"summary": "拉卡拉
退款
",
"parameters": [
"parameters": [
{
{
"description": "参数",
"type": "string",
"name": "body",
"description": "退款号:原对账单流水号",
"in": "body",
"name": "orderId",
"required": true,
"in": "path",
"schema": {
"required": true
"$ref": "#/definitions/models.ScanNoticeInput"
},
}
{
"type": "string",
"description": "操作人/退款原因",
"name": "operator",
"in": "path",
"required": true
},
{
"type": "string",
"description": "退款金额,个位为分",
"name": "money",
"in": "path",
"required": true
},
},
{
{
"type": "string",
"type": "string",
...
@@ -132,9 +144,9 @@ var doc = `{
...
@@ -132,9 +144,9 @@ var doc = `{
}
}
}
}
},
},
"/api/v1/pay/
unified_order
": {
"/api/v1/pay/
scan_notice
": {
"post": {
"post": {
"description": "拉卡拉统一支付",
"description": "拉卡拉统一支付
回调(聚合扫码)
",
"consumes": [
"consumes": [
"application/json"
"application/json"
],
],
...
@@ -142,9 +154,9 @@ var doc = `{
...
@@ -142,9 +154,9 @@ var doc = `{
"application/json"
"application/json"
],
],
"tags": [
"tags": [
"拉卡拉统一支付"
"拉卡拉统一支付
回调
"
],
],
"summary": "拉卡拉统一支付",
"summary": "拉卡拉统一支付
回调(聚合扫码)
",
"parameters": [
"parameters": [
{
{
"description": "参数",
"description": "参数",
...
@@ -152,7 +164,7 @@ var doc = `{
...
@@ -152,7 +164,7 @@ var doc = `{
"in": "body",
"in": "body",
"required": true,
"required": true,
"schema": {
"schema": {
"$ref": "#/definitions/models.
PlaceAnOrderParam
Input"
"$ref": "#/definitions/models.
ScanNotice
Input"
}
}
},
},
{
{
...
@@ -169,9 +181,9 @@ var doc = `{
...
@@ -169,9 +181,9 @@ var doc = `{
}
}
}
}
},
},
"/api/v1/pay/unified_
refund
": {
"/api/v1/pay/unified_
order
": {
"post": {
"post": {
"description": "拉卡拉
退款
",
"description": "拉卡拉
统一支付
",
"consumes": [
"consumes": [
"application/json"
"application/json"
],
],
...
@@ -179,9 +191,9 @@ var doc = `{
...
@@ -179,9 +191,9 @@ var doc = `{
"application/json"
"application/json"
],
],
"tags": [
"tags": [
"拉卡拉
退款
"
"拉卡拉
统一支付
"
],
],
"summary": "拉卡拉
退款
",
"summary": "拉卡拉
统一支付
",
"parameters": [
"parameters": [
{
{
"description": "参数",
"description": "参数",
...
@@ -189,7 +201,7 @@ var doc = `{
...
@@ -189,7 +201,7 @@ var doc = `{
"in": "body",
"in": "body",
"required": true,
"required": true,
"schema": {
"schema": {
"$ref": "#/definitions/models.
Refund
ParamInput"
"$ref": "#/definitions/models.
PlaceAnOrder
ParamInput"
}
}
},
},
{
{
...
@@ -360,23 +372,6 @@ var doc = `{
...
@@ -360,23 +372,6 @@ var doc = `{
}
}
}
}
},
},
"models.RefundParamInput": {
"type": "object",
"properties": {
"refund_amount": {
"description": "退款金额,个位为分",
"type": "number"
},
"refund_no": {
"description": "退款号:原对账单流水号",
"type": "string"
},
"refund_reason": {
"description": "退款原因",
"type": "string"
}
}
},
"models.ScanNoticeInput": {
"models.ScanNoticeInput": {
"type": "object",
"type": "object",
"properties": {
"properties": {
...
...
docs/swagger.json
View file @
23c95f8b
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
}
}
}
}
},
},
"/api/v1/pay/order_state/{order
_i
d}"
:
{
"/api/v1/pay/order_state/{order
I
d}"
:
{
"get"
:
{
"get"
:
{
"description"
:
"拉卡拉支付查询"
,
"description"
:
"拉卡拉支付查询"
,
"consumes"
:
[
"consumes"
:
[
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
{
{
"type"
:
"string"
,
"type"
:
"string"
,
"description"
:
"订单号"
,
"description"
:
"订单号"
,
"name"
:
"order
_i
d"
,
"name"
:
"order
I
d"
,
"in"
:
"path"
,
"in"
:
"path"
,
"required"
:
true
"required"
:
true
},
},
...
@@ -79,9 +79,9 @@
...
@@ -79,9 +79,9 @@
}
}
}
}
},
},
"/api/v1/pay/
scan_notice
"
:
{
"/api/v1/pay/
refund/{orderId}/{operator}/{money}
"
:
{
"p
os
t"
:
{
"p
u
t"
:
{
"description"
:
"拉卡拉
统一支付回调(聚合扫码)
"
,
"description"
:
"拉卡拉
退款
"
,
"consumes"
:
[
"consumes"
:
[
"application/json"
"application/json"
],
],
...
@@ -89,18 +89,30 @@
...
@@ -89,18 +89,30 @@
"application/json"
"application/json"
],
],
"tags"
:
[
"tags"
:
[
"拉卡拉
统一支付回调
"
"拉卡拉
退款
"
],
],
"summary"
:
"拉卡拉
统一支付回调(聚合扫码)
"
,
"summary"
:
"拉卡拉
退款
"
,
"parameters"
:
[
"parameters"
:
[
{
{
"description"
:
"参数"
,
"type"
:
"string"
,
"name"
:
"body"
,
"description"
:
"退款号:原对账单流水号"
,
"in"
:
"body"
,
"name"
:
"orderId"
,
"required"
:
true
,
"in"
:
"path"
,
"schema"
:
{
"required"
:
true
"$ref"
:
"#/definitions/models.ScanNoticeInput"
},
}
{
"type"
:
"string"
,
"description"
:
"操作人/退款原因"
,
"name"
:
"operator"
,
"in"
:
"path"
,
"required"
:
true
},
{
"type"
:
"string"
,
"description"
:
"退款金额,个位为分"
,
"name"
:
"money"
,
"in"
:
"path"
,
"required"
:
true
},
},
{
{
"type"
:
"string"
,
"type"
:
"string"
,
...
@@ -116,9 +128,9 @@
...
@@ -116,9 +128,9 @@
}
}
}
}
},
},
"/api/v1/pay/
unified_order
"
:
{
"/api/v1/pay/
scan_notice
"
:
{
"post"
:
{
"post"
:
{
"description"
:
"拉卡拉统一支付"
,
"description"
:
"拉卡拉统一支付
回调(聚合扫码)
"
,
"consumes"
:
[
"consumes"
:
[
"application/json"
"application/json"
],
],
...
@@ -126,9 +138,9 @@
...
@@ -126,9 +138,9 @@
"application/json"
"application/json"
],
],
"tags"
:
[
"tags"
:
[
"拉卡拉统一支付"
"拉卡拉统一支付
回调
"
],
],
"summary"
:
"拉卡拉统一支付"
,
"summary"
:
"拉卡拉统一支付
回调(聚合扫码)
"
,
"parameters"
:
[
"parameters"
:
[
{
{
"description"
:
"参数"
,
"description"
:
"参数"
,
...
@@ -136,7 +148,7 @@
...
@@ -136,7 +148,7 @@
"in"
:
"body"
,
"in"
:
"body"
,
"required"
:
true
,
"required"
:
true
,
"schema"
:
{
"schema"
:
{
"$ref"
:
"#/definitions/models.
PlaceAnOrderParam
Input"
"$ref"
:
"#/definitions/models.
ScanNotice
Input"
}
}
},
},
{
{
...
@@ -153,9 +165,9 @@
...
@@ -153,9 +165,9 @@
}
}
}
}
},
},
"/api/v1/pay/unified_
refund
"
:
{
"/api/v1/pay/unified_
order
"
:
{
"post"
:
{
"post"
:
{
"description"
:
"拉卡拉
退款
"
,
"description"
:
"拉卡拉
统一支付
"
,
"consumes"
:
[
"consumes"
:
[
"application/json"
"application/json"
],
],
...
@@ -163,9 +175,9 @@
...
@@ -163,9 +175,9 @@
"application/json"
"application/json"
],
],
"tags"
:
[
"tags"
:
[
"拉卡拉
退款
"
"拉卡拉
统一支付
"
],
],
"summary"
:
"拉卡拉
退款
"
,
"summary"
:
"拉卡拉
统一支付
"
,
"parameters"
:
[
"parameters"
:
[
{
{
"description"
:
"参数"
,
"description"
:
"参数"
,
...
@@ -173,7 +185,7 @@
...
@@ -173,7 +185,7 @@
"in"
:
"body"
,
"in"
:
"body"
,
"required"
:
true
,
"required"
:
true
,
"schema"
:
{
"schema"
:
{
"$ref"
:
"#/definitions/models.
Refund
ParamInput"
"$ref"
:
"#/definitions/models.
PlaceAnOrder
ParamInput"
}
}
},
},
{
{
...
@@ -344,23 +356,6 @@
...
@@ -344,23 +356,6 @@
}
}
}
}
},
},
"models.RefundParamInput"
:
{
"type"
:
"object"
,
"properties"
:
{
"refund_amount"
:
{
"description"
:
"退款金额,个位为分"
,
"type"
:
"number"
},
"refund_no"
:
{
"description"
:
"退款号:原对账单流水号"
,
"type"
:
"string"
},
"refund_reason"
:
{
"description"
:
"退款原因"
,
"type"
:
"string"
}
}
},
"models.ScanNoticeInput"
:
{
"models.ScanNoticeInput"
:
{
"type"
:
"object"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
...
...
docs/swagger.yaml
View file @
23c95f8b
...
@@ -113,18 +113,6 @@ definitions:
...
@@ -113,18 +113,6 @@ definitions:
description
:
WAP网站URL地址, 支付方式为微信MWEB时 必传
description
:
WAP网站URL地址, 支付方式为微信MWEB时 必传
type
:
string
type
:
string
type
:
object
type
:
object
models.RefundParamInput
:
properties
:
refund_amount
:
description
:
退款金额,个位为分
type
:
number
refund_no
:
description
:
退款号:原对账单流水号
type
:
string
refund_reason
:
description
:
退款原因
type
:
string
type
:
object
models.ScanNoticeInput
:
models.ScanNoticeInput
:
properties
:
properties
:
acc_activity_id
:
acc_activity_id
:
...
@@ -227,7 +215,7 @@ paths:
...
@@ -227,7 +215,7 @@ paths:
summary
:
拉卡拉统一支付回调(收银台)
summary
:
拉卡拉统一支付回调(收银台)
tags
:
tags
:
-
拉卡拉统一支付回调
-
拉卡拉统一支付回调
/api/v1/pay/order_state/{order
_i
d}
:
/api/v1/pay/order_state/{order
I
d}
:
get
:
get
:
consumes
:
consumes
:
-
application/json
-
application/json
...
@@ -235,7 +223,7 @@ paths:
...
@@ -235,7 +223,7 @@ paths:
parameters
:
parameters
:
-
description
:
订单号
-
description
:
订单号
in
:
path
in
:
path
name
:
order
_i
d
name
:
order
I
d
required
:
true
required
:
true
type
:
string
type
:
string
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
...
@@ -250,18 +238,27 @@ paths:
...
@@ -250,18 +238,27 @@ paths:
summary
:
拉卡拉支付查询
summary
:
拉卡拉支付查询
tags
:
tags
:
-
拉卡拉支付查询
-
拉卡拉支付查询
/api/v1/pay/
scan_notice
:
/api/v1/pay/
refund/{orderId}/{operator}/{money}
:
p
os
t
:
p
u
t
:
consumes
:
consumes
:
-
application/json
-
application/json
description
:
拉卡拉
统一支付回调(聚合扫码)
description
:
拉卡拉
退款
parameters
:
parameters
:
-
description
:
参数
-
description
:
退款号:原对账单流水号
in
:
body
in
:
path
name
:
body
name
:
orderId
required
:
true
required
:
true
schema
:
type
:
string
$ref
:
'
#/definitions/models.ScanNoticeInput'
-
description
:
操作人/退款原因
in
:
path
name
:
operator
required
:
true
type
:
string
-
description
:
退款金额,个位为分
in
:
path
name
:
money
required
:
true
type
:
string
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
in
:
header
in
:
header
name
:
language
name
:
language
...
@@ -271,21 +268,21 @@ paths:
...
@@ -271,21 +268,21 @@ paths:
responses
:
responses
:
"
200"
:
"
200"
:
description
:
"
"
description
:
"
"
summary
:
拉卡拉
统一支付回调(聚合扫码)
summary
:
拉卡拉
退款
tags
:
tags
:
-
拉卡拉
统一支付回调
-
拉卡拉
退款
/api/v1/pay/
unified_order
:
/api/v1/pay/
scan_notice
:
post
:
post
:
consumes
:
consumes
:
-
application/json
-
application/json
description
:
拉卡拉统一支付
description
:
拉卡拉统一支付
回调(聚合扫码)
parameters
:
parameters
:
-
description
:
参数
-
description
:
参数
in
:
body
in
:
body
name
:
body
name
:
body
required
:
true
required
:
true
schema
:
schema
:
$ref
:
'
#/definitions/models.
PlaceAnOrderParam
Input'
$ref
:
'
#/definitions/models.
ScanNotice
Input'
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
in
:
header
in
:
header
name
:
language
name
:
language
...
@@ -295,21 +292,21 @@ paths:
...
@@ -295,21 +292,21 @@ paths:
responses
:
responses
:
"
200"
:
"
200"
:
description
:
"
"
description
:
"
"
summary
:
拉卡拉统一支付
summary
:
拉卡拉统一支付
回调(聚合扫码)
tags
:
tags
:
-
拉卡拉统一支付
-
拉卡拉统一支付
回调
/api/v1/pay/unified_
refund
:
/api/v1/pay/unified_
order
:
post
:
post
:
consumes
:
consumes
:
-
application/json
-
application/json
description
:
拉卡拉
退款
description
:
拉卡拉
统一支付
parameters
:
parameters
:
-
description
:
参数
-
description
:
参数
in
:
body
in
:
body
name
:
body
name
:
body
required
:
true
required
:
true
schema
:
schema
:
$ref
:
'
#/definitions/models.
Refund
ParamInput'
$ref
:
'
#/definitions/models.
PlaceAnOrder
ParamInput'
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
-
description
:
语言类型 zh-CN简体中文 en-US英文 ja-JP日文 默认中文
in
:
header
in
:
header
name
:
language
name
:
language
...
@@ -319,9 +316,9 @@ paths:
...
@@ -319,9 +316,9 @@ paths:
responses
:
responses
:
"
200"
:
"
200"
:
description
:
"
"
description
:
"
"
summary
:
拉卡拉
退款
summary
:
拉卡拉
统一支付
tags
:
tags
:
-
拉卡拉
退款
-
拉卡拉
统一支付
securityDefinitions
:
securityDefinitions
:
ApiKeyAuth
:
ApiKeyAuth
:
in
:
header
in
:
header
...
...
router/v1/pay_router.go
View file @
23c95f8b
...
@@ -20,9 +20,9 @@ func PayRouter (r *gin.Engine) {
...
@@ -20,9 +20,9 @@ func PayRouter (r *gin.Engine) {
r
.
POST
(
pack
.
PayUrlPacking
(
"scan_notice"
),
PayController
.
ScanNotice
)
r
.
POST
(
pack
.
PayUrlPacking
(
"scan_notice"
),
PayController
.
ScanNotice
)
// 拉卡拉支付查询
// 拉卡拉支付查询
r
.
GET
(
pack
.
PayUrlPacking
(
"order_state/:order
_i
d"
),
PayController
.
OrderState
)
r
.
GET
(
pack
.
PayUrlPacking
(
"order_state/:order
I
d"
),
PayController
.
OrderState
)
// 拉卡拉退款
// 拉卡拉退款
r
.
P
OST
(
pack
.
PayUrlPacking
(
"unified_refund"
),
PayController
.
Unified
Refund
)
r
.
P
UT
(
pack
.
PayUrlPacking
(
"refund/:orderId/:operator/:money"
),
PayController
.
Refund
)
}
}
setting/setting.go
View file @
23c95f8b
...
@@ -125,7 +125,7 @@ type Lakala struct {
...
@@ -125,7 +125,7 @@ type Lakala struct {
// Init 支持热修改的viper设置
// Init 支持热修改的viper设置
func
Init
()
error
{
func
Init
()
error
{
viper
.
SetConfigFile
(
"conf/
dev/
config.yaml"
)
// 指定配置文件路径
viper
.
SetConfigFile
(
"conf/config.yaml"
)
// 指定配置文件路径
err
:=
viper
.
ReadInConfig
()
// 读取配置信息
err
:=
viper
.
ReadInConfig
()
// 读取配置信息
if
err
!=
nil
{
// 读取配置信息失败
if
err
!=
nil
{
// 读取配置信息失败
fmt
.
Printf
(
"viper.ReadInConfig failed, new_error:%v
\n
"
,
err
)
fmt
.
Printf
(
"viper.ReadInConfig failed, new_error:%v
\n
"
,
err
)
...
...
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