Compare commits
3 Commits
dd3255e220
...
a056e2b26a
Author | SHA1 | Date |
---|---|---|
|
a056e2b26a | |
|
753b466605 | |
|
5a60a92f4b |
|
@ -4,6 +4,7 @@ const (
|
||||||
TOKEN_PRE = "player_token_"
|
TOKEN_PRE = "player_token_"
|
||||||
TOKEN_Admin = "Admin_token_"
|
TOKEN_Admin = "Admin_token_"
|
||||||
ADMIN_V1 = "/admin/pay/api/v1"
|
ADMIN_V1 = "/admin/pay/api/v1"
|
||||||
|
FRONT_V1 = "/api/v1"
|
||||||
|
|
||||||
// 支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI
|
// 支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI
|
||||||
PAY_CHANNEL_UNKNOWN = 0
|
PAY_CHANNEL_UNKNOWN = 0
|
||||||
|
|
|
@ -21,6 +21,9 @@ const (
|
||||||
|
|
||||||
//未登录
|
//未登录
|
||||||
NotLogin = 1000
|
NotLogin = 1000
|
||||||
|
|
||||||
|
// 商户
|
||||||
|
MerchantNotFound = 1100
|
||||||
)
|
)
|
||||||
|
|
||||||
var MsgEN = map[int]string{
|
var MsgEN = map[int]string{
|
||||||
|
@ -38,6 +41,8 @@ var MsgZH = map[int]string{
|
||||||
NotFound: "数据不存在",
|
NotFound: "数据不存在",
|
||||||
NotAuth: "未经授权",
|
NotAuth: "未经授权",
|
||||||
NotLogin: "未登录",
|
NotLogin: "未登录",
|
||||||
|
|
||||||
|
MerchantNotFound: "商户不存在",
|
||||||
}
|
}
|
||||||
var MsgMap map[string]map[int]string = map[string]map[int]string{"en": MsgZH}
|
var MsgMap map[string]map[int]string = map[string]map[int]string{"en": MsgZH}
|
||||||
|
|
||||||
|
|
|
@ -37,3 +37,7 @@ func (m *MerchantRepo) MerchantDelete(merchant *merchantmodel.Merchant, conn bui
|
||||||
func (m *MerchantRepo) MerchantUpdate(merchant *merchantmodel.Merchant, conn builder.Cond, columns ...string) (int64, error) {
|
func (m *MerchantRepo) MerchantUpdate(merchant *merchantmodel.Merchant, conn builder.Cond, columns ...string) (int64, error) {
|
||||||
return m.repo.Where(conn).MustCols(columns...).Update(merchant)
|
return m.repo.Where(conn).MustCols(columns...).Update(merchant)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MerchantRepo) MerchantDetail(merchant *merchantmodel.Merchant, conn builder.Cond) (bool, error) {
|
||||||
|
return m.repo.Where(conn).Get(merchant)
|
||||||
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ func (m *PayChannelRepo) PayChannelDelete(merchant *paychannelmodel.PayChannel,
|
||||||
return m.repo.Where(conn).Delete(merchant)
|
return m.repo.Where(conn).Delete(merchant)
|
||||||
}
|
}
|
||||||
|
|
||||||
// columns 参数为要更新的字段
|
// columns 参数为要更新的字段,即使为空
|
||||||
func (m *PayChannelRepo) PayChannelUpdate(merchant *paychannelmodel.PayChannel, conn builder.Cond, columns ...string) (int64, error) {
|
func (m *PayChannelRepo) PayChannelUpdate(merchant *paychannelmodel.PayChannel, conn builder.Cond, columns ...string) (int64, error) {
|
||||||
return m.repo.Where(conn).MustCols(columns...).Update(merchant)
|
return m.repo.Where(conn).MustCols(columns...).Update(merchant)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
package backend
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PaymentCenter/app/constants/errorcode"
|
||||||
|
"PaymentCenter/app/http/controllers"
|
||||||
|
"PaymentCenter/app/http/entities"
|
||||||
|
"PaymentCenter/app/http/entities/backend"
|
||||||
|
"PaymentCenter/app/models/appmodel"
|
||||||
|
"PaymentCenter/app/services"
|
||||||
|
"PaymentCenter/app/utils/encrypt/sm2"
|
||||||
|
"github.com/ahmetb/go-linq/v3"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AppList(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.AppListRequest)
|
||||||
|
req.SetDefault()
|
||||||
|
payChannelList, total, code := services.AppList(*req)
|
||||||
|
|
||||||
|
result := make([]backend.AppResponse, 0, len(payChannelList))
|
||||||
|
linq.From(payChannelList).SelectT(func(in appmodel.App) (out backend.AppResponse) {
|
||||||
|
out.ResponseFromDb(in)
|
||||||
|
return
|
||||||
|
}).ToSlice(&result)
|
||||||
|
data := entities.PageRsp{
|
||||||
|
Total: total,
|
||||||
|
Data: result,
|
||||||
|
}
|
||||||
|
controllers.HandCodeRes(c, data, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func AppCreate(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.AppCreateRequest)
|
||||||
|
payChannel := req.RequestToDb()
|
||||||
|
code := services.AppCreate(&payChannel)
|
||||||
|
|
||||||
|
data := backend.AppResponse{}
|
||||||
|
data.ResponseFromDb(payChannel)
|
||||||
|
controllers.HandCodeRes(c, data, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func AppUpdate(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.AppUpdateRequest)
|
||||||
|
payChannel := req.RequestToDb()
|
||||||
|
code := services.AppUpdate(&payChannel)
|
||||||
|
|
||||||
|
data := backend.AppResponse{}
|
||||||
|
data.ResponseFromDb(payChannel)
|
||||||
|
controllers.HandCodeRes(c, data, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func AppDelete(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*entities.IdRequest)
|
||||||
|
code := services.AppDelete(*req)
|
||||||
|
controllers.HandCodeRes(c, nil, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GenerateDecrypt(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.GenerateDecryptKeyRequest)
|
||||||
|
var publicKey, privateKey string
|
||||||
|
var err error
|
||||||
|
switch req.KeyType {
|
||||||
|
default:
|
||||||
|
publicKey, privateKey, err = sm2.GenerateSM2Key()
|
||||||
|
if err != nil {
|
||||||
|
controllers.Error(c, errorcode.SystemError, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
controllers.HandCodeRes(c, map[string]string{
|
||||||
|
"publicKey": publicKey,
|
||||||
|
"privateKey": privateKey,
|
||||||
|
}, errorcode.Success)
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package backend
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PaymentCenter/app/constants/errorcode"
|
||||||
|
"PaymentCenter/app/http/controllers"
|
||||||
|
"PaymentCenter/app/http/entities"
|
||||||
|
"PaymentCenter/app/http/entities/backend"
|
||||||
|
"PaymentCenter/app/models/paychannelmodel"
|
||||||
|
"PaymentCenter/app/services"
|
||||||
|
"github.com/ahmetb/go-linq/v3"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func PayChannelList(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.PayChannelListRequest)
|
||||||
|
req.SetDefault()
|
||||||
|
payChannelList, total, code := services.PayChannelList(*req)
|
||||||
|
|
||||||
|
result := make([]backend.PayChannelResponse, 0, len(payChannelList))
|
||||||
|
linq.From(payChannelList).SelectT(func(in paychannelmodel.PayChannel) (out backend.PayChannelResponse) {
|
||||||
|
out.ResponseFromDb(in)
|
||||||
|
return
|
||||||
|
}).ToSlice(&result)
|
||||||
|
data := entities.PageRsp{
|
||||||
|
Total: total,
|
||||||
|
Data: result,
|
||||||
|
}
|
||||||
|
controllers.HandCodeRes(c, data, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PayChannelCreate(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.PayChannelCreateRequest)
|
||||||
|
payChannel, err := req.RequestToDb()
|
||||||
|
if err != nil {
|
||||||
|
controllers.Error(c, errorcode.ParamError, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
code := services.PayChannelCreate(&payChannel)
|
||||||
|
|
||||||
|
data := backend.PayChannelResponse{}
|
||||||
|
data.ResponseFromDb(payChannel)
|
||||||
|
controllers.HandCodeRes(c, data, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PayChannelUpdate(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*backend.PayChannelUpdateRequest)
|
||||||
|
payChannel, err := req.RequestToDb()
|
||||||
|
if err != nil {
|
||||||
|
controllers.Error(c, errorcode.ParamError, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
code := services.PayChannelUpdate(&payChannel)
|
||||||
|
|
||||||
|
data := backend.PayChannelResponse{}
|
||||||
|
data.ResponseFromDb(payChannel)
|
||||||
|
controllers.HandCodeRes(c, data, code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PayChannelDelete(c *gin.Context) {
|
||||||
|
req, _ := controllers.GetRequest(c).(*entities.IdRequest)
|
||||||
|
code := services.PayChannelDelete(*req)
|
||||||
|
controllers.HandCodeRes(c, nil, code)
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
package front
|
|
||||||
|
|
||||||
import (
|
|
||||||
"PaymentCenter/app/http/controllers"
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
|
||||||
|
|
||||||
func HelloHandler(c *gin.Context) {
|
|
||||||
controllers.Success(c, "aaaa")
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package domains
|
|
||||||
|
|
||||||
type Filter struct {
|
|
||||||
Page int `json:"page"`
|
|
||||||
PageSize int `json:"page_size"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ProductFilter struct {
|
|
||||||
Page int `json:"page" form:"page"`
|
|
||||||
PageSize int `json:"page_size" form:"page_size"`
|
|
||||||
ProductName string `json:"product_name" form:"product_name"`
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package domains
|
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
type Product struct {
|
|
||||||
Id int
|
|
||||||
ProductName string
|
|
||||||
ProductType int
|
|
||||||
PacketRule int
|
|
||||||
ProductKind int
|
|
||||||
Amount string
|
|
||||||
CouponType int
|
|
||||||
IsSuperposition int
|
|
||||||
TemplateId int
|
|
||||||
Status int
|
|
||||||
IsNeedBill int
|
|
||||||
CreateTime time.Time
|
|
||||||
SupplierProductId int64
|
|
||||||
SupplierProductName string
|
|
||||||
|
|
||||||
Creator string
|
|
||||||
UpdateTime time.Time
|
|
||||||
}
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
package backend
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PaymentCenter/app/http/entities"
|
||||||
|
"PaymentCenter/app/models/appmodel"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AppListRequest struct {
|
||||||
|
MerchantId int64 `json:"merchant_id"`
|
||||||
|
entities.PageRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type AppResponse struct {
|
||||||
|
Id int64 `json:"id"`
|
||||||
|
MerchantId int64 `json:"merchant_id"`
|
||||||
|
AppName string `json:"app_name"`
|
||||||
|
AppRemark string `json:"app_remark"`
|
||||||
|
Status int `json:"status"`
|
||||||
|
KeyType int `json:"key_type"`
|
||||||
|
PublicKey string `json:"public_key"`
|
||||||
|
PrivateKey string `json:"private_key"`
|
||||||
|
MerchantPublicKey string `json:"merchant_public_key"`
|
||||||
|
CreateTime string `json:"create_time"`
|
||||||
|
WhiteIp string `json:"white_ip"`
|
||||||
|
NotifyUrl string `json:"notify_url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *AppResponse) ResponseFromDb(db appmodel.App) {
|
||||||
|
a.Id = db.Id
|
||||||
|
a.MerchantId = db.MerchantId
|
||||||
|
a.AppName = db.AppName
|
||||||
|
a.AppRemark = db.AppRemark
|
||||||
|
a.Status = db.Status
|
||||||
|
a.KeyType = db.KeyType
|
||||||
|
a.PublicKey = db.PublicKey
|
||||||
|
a.PrivateKey = db.PrivateKey
|
||||||
|
a.MerchantPublicKey = db.MerchantPublicKey
|
||||||
|
a.CreateTime = db.CreateTime.Format("2006-01-02 15:04:05")
|
||||||
|
a.WhiteIp = db.WhiteIp
|
||||||
|
a.NotifyUrl = db.NotifyUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
type AppCreateRequest struct {
|
||||||
|
MerchantId int64 `json:"merchant_id" validate:"required" label:"商户ID"`
|
||||||
|
AppName string `json:"app_name" validate:"required" label:"应用名称"`
|
||||||
|
AppRemark string `json:"app_remark" label:"应用备注"`
|
||||||
|
Status int `json:"status" validate:"oneof=0 1 2" label:"应用状态"`
|
||||||
|
KeyType int `json:"key_type" validate:"required" label:"应用密钥类型"`
|
||||||
|
PublicKey string `json:"public_key" validate:"required" label:"应用公钥"`
|
||||||
|
PrivateKey string `json:"private_key" validate:"required" label:"应用私钥"`
|
||||||
|
MerchantPublicKey string `json:"merchant_public_key" label:"商户公钥"`
|
||||||
|
WhiteIp string `json:"white_ip"`
|
||||||
|
NotifyUrl string `json:"notify_url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *AppCreateRequest) RequestToDb() (db appmodel.App) {
|
||||||
|
db.MerchantId = a.MerchantId
|
||||||
|
db.AppName = a.AppName
|
||||||
|
db.AppRemark = a.AppRemark
|
||||||
|
db.Status = a.Status
|
||||||
|
db.KeyType = a.KeyType
|
||||||
|
db.PublicKey = a.PublicKey
|
||||||
|
db.PrivateKey = a.PrivateKey
|
||||||
|
db.MerchantPublicKey = a.MerchantPublicKey
|
||||||
|
db.WhiteIp = a.WhiteIp
|
||||||
|
db.NotifyUrl = a.NotifyUrl
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type AppUpdateRequest struct {
|
||||||
|
Id int64 `json:"id" validate:"required" label:"应用ID"`
|
||||||
|
MerchantId int64 `json:"merchant_id" validate:"required" label:"商户ID"`
|
||||||
|
AppName string `json:"app_name" validate:"required" label:"应用名称"`
|
||||||
|
AppRemark string `json:"app_remark" label:"应用备注"`
|
||||||
|
Status int `json:"status" validate:"oneof=0 1 2" label:"应用状态"`
|
||||||
|
KeyType int `json:"key_type" validate:"required" label:"应用密钥类型"`
|
||||||
|
PublicKey string `json:"public_key" validate:"required" label:"应用公钥"`
|
||||||
|
PrivateKey string `json:"private_key" validate:"required" label:"应用私钥"`
|
||||||
|
MerchantPublicKey string `json:"merchant_public_key" label:"商户公钥"`
|
||||||
|
WhiteIp string `json:"white_ip"`
|
||||||
|
NotifyUrl string `json:"notify_url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *AppUpdateRequest) RequestToDb() (db appmodel.App) {
|
||||||
|
db.Id = a.Id
|
||||||
|
db.MerchantId = a.MerchantId
|
||||||
|
db.AppName = a.AppName
|
||||||
|
db.AppRemark = a.AppRemark
|
||||||
|
db.Status = a.Status
|
||||||
|
db.KeyType = a.KeyType
|
||||||
|
db.PublicKey = a.PublicKey
|
||||||
|
db.PrivateKey = a.PrivateKey
|
||||||
|
db.MerchantPublicKey = a.MerchantPublicKey
|
||||||
|
db.WhiteIp = a.WhiteIp
|
||||||
|
db.NotifyUrl = a.NotifyUrl
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type GenerateDecryptKeyRequest struct {
|
||||||
|
KeyType int `json:"key_type" label:"密钥类型"`
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package backend
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"PaymentCenter/app/constants/common"
|
"PaymentCenter/app/constants/common"
|
||||||
|
"PaymentCenter/app/http/entities"
|
||||||
"PaymentCenter/app/models/paychannelmodel"
|
"PaymentCenter/app/models/paychannelmodel"
|
||||||
"PaymentCenter/app/utils"
|
"PaymentCenter/app/utils"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -9,16 +10,15 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type PayChannelResponse struct {
|
type PayChannelResponse struct {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
PayName string `json:"pay_name"`
|
PayName string `json:"pay_name"`
|
||||||
MerchantId int64 `json:"merchant_id"`
|
MerchantId int64 `json:"merchant_id"`
|
||||||
ChannelType int `json:"channel_type"`
|
ChannelType int `json:"channel_type"`
|
||||||
WhiteIp string `json:"white_ip"`
|
AppId string `json:"app_id"`
|
||||||
AppId string `json:"app_id"`
|
ExpireTime string `json:"expire_time"`
|
||||||
ExpireTime string `json:"expire_time"`
|
CreateTime string `json:"create_time"`
|
||||||
CreateTime string `json:"create_time"`
|
AliPayPayChannel *AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"`
|
||||||
AliPayPayChannel AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"`
|
WechatPayChannel *WechatPayChannel `json:"wechat_pay_channel,omitempty"`
|
||||||
WechatPayChannel WechatPayChannel `json:"wechat_pay_channel,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PayChannelResponse) ResponseFromDb(db paychannelmodel.PayChannel) {
|
func (p *PayChannelResponse) ResponseFromDb(db paychannelmodel.PayChannel) {
|
||||||
|
@ -26,32 +26,30 @@ func (p *PayChannelResponse) ResponseFromDb(db paychannelmodel.PayChannel) {
|
||||||
p.PayName = db.PayName
|
p.PayName = db.PayName
|
||||||
p.MerchantId = db.MerchantId
|
p.MerchantId = db.MerchantId
|
||||||
p.ChannelType = db.ChannelType
|
p.ChannelType = db.ChannelType
|
||||||
p.WhiteIp = db.WhiteIp
|
|
||||||
p.AppId = db.AppId
|
p.AppId = db.AppId
|
||||||
p.ExpireTime = db.ExpireTime.Format("2006-01-02 15:04:05")
|
p.ExpireTime = db.ExpireTime.Format("2006-01-02 15:04:05")
|
||||||
p.CreateTime = db.CreateTime.Format("2006-01-02 15:04:05")
|
p.CreateTime = db.CreateTime.Format("2006-01-02 15:04:05")
|
||||||
|
|
||||||
switch p.ChannelType {
|
switch p.ChannelType {
|
||||||
case common.PAY_CHANNEL_WECHAT_H5 | common.PAY_CHANNEL_WECHAT_JSAPI | common.PAY_CHANNEL_WECHAT_NATIVE | common.PAY_CHANNEL_WECHAT_APP | common.PAY_CHANNEL_WECHAT_MINI:
|
case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI:
|
||||||
_ = json.Unmarshal([]byte(db.ExtJson), &p.WechatPayChannel)
|
_ = json.Unmarshal([]byte(db.ExtJson), &p.WechatPayChannel)
|
||||||
case common.PAY_CHANNEL_ALIPAY_JSAPI | common.PAY_CHANNEL_ALIPAY_WEB | common.PAY_CHANNEL_ALIPAY_MINI:
|
case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI:
|
||||||
_ = json.Unmarshal([]byte(db.ExtJson), &p.AliPayPayChannel)
|
_ = json.Unmarshal([]byte(db.ExtJson), &p.AliPayPayChannel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type PayChannelCreateRequest struct {
|
type PayChannelCreateRequest struct {
|
||||||
PayName string `json:"pay_name"`
|
PayName string `json:"pay_name" validate:"required" label:"支付渠道名称"`
|
||||||
MerchantId int64 `json:"merchant_id"`
|
MerchantId int64 `json:"merchant_id" validate:"required" label:"商户ID"`
|
||||||
ChannelType int `json:"channel_type"` //支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI
|
ChannelType int `json:"channel_type" validate:"required" label:"支付渠道"` //支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI
|
||||||
WhiteIp string `json:"white_ip"`
|
AppId string `json:"app_id" validate:"required" label:"应用appId"`
|
||||||
AppId string `json:"app_id"`
|
|
||||||
ExpireTime string `json:"expire_time"`
|
ExpireTime string `json:"expire_time"`
|
||||||
AliPayPayChannel AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"`
|
AliPayPayChannel AliPayPayChannel `json:"ali_pay_pay_channel,omitempty"`
|
||||||
WechatPayChannel WechatPayChannel `json:"wechat_pay_channel,omitempty"`
|
WechatPayChannel WechatPayChannel `json:"wechat_pay_channel,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WechatPayChannel struct {
|
type WechatPayChannel struct {
|
||||||
MchId int `json:"mch_id"` //直连商户号
|
MchId string `json:"mch_id"` //直连商户号
|
||||||
MchCertificateSerialNumber string `json:"mch_certificate_serial_number"` //商户证书序列号
|
MchCertificateSerialNumber string `json:"mch_certificate_serial_number"` //商户证书序列号
|
||||||
MchAPIv3Key string `json:"mch_APIv3_key"` //商户APIv3密钥
|
MchAPIv3Key string `json:"mch_APIv3_key"` //商户APIv3密钥
|
||||||
PrivateKeyPath string `json:"private_key_path"` //商户私钥文件路径
|
PrivateKeyPath string `json:"private_key_path"` //商户私钥文件路径
|
||||||
|
@ -67,7 +65,6 @@ func (p *PayChannelCreateRequest) RequestToDb() (db paychannelmodel.PayChannel,
|
||||||
db.PayName = p.PayName
|
db.PayName = p.PayName
|
||||||
db.MerchantId = p.MerchantId
|
db.MerchantId = p.MerchantId
|
||||||
db.ChannelType = p.ChannelType
|
db.ChannelType = p.ChannelType
|
||||||
db.WhiteIp = p.WhiteIp
|
|
||||||
db.AppId = p.AppId
|
db.AppId = p.AppId
|
||||||
if p.ExpireTime != "" {
|
if p.ExpireTime != "" {
|
||||||
db.ExpireTime, err = utils.StrToTimeShanghai(p.ExpireTime)
|
db.ExpireTime, err = utils.StrToTimeShanghai(p.ExpireTime)
|
||||||
|
@ -76,12 +73,49 @@ func (p *PayChannelCreateRequest) RequestToDb() (db paychannelmodel.PayChannel,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch p.ChannelType {
|
switch p.ChannelType {
|
||||||
case common.PAY_CHANNEL_WECHAT_H5 | common.PAY_CHANNEL_WECHAT_JSAPI | common.PAY_CHANNEL_WECHAT_NATIVE | common.PAY_CHANNEL_WECHAT_APP | common.PAY_CHANNEL_WECHAT_MINI:
|
case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI:
|
||||||
b, _ := json.Marshal(p.WechatPayChannel)
|
b, _ := json.Marshal(p.WechatPayChannel)
|
||||||
db.ExtJson = string(b)
|
db.ExtJson = string(b)
|
||||||
case common.PAY_CHANNEL_ALIPAY_JSAPI | common.PAY_CHANNEL_ALIPAY_WEB | common.PAY_CHANNEL_ALIPAY_MINI:
|
case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI:
|
||||||
b, _ := json.Marshal(p.AliPayPayChannel)
|
b, _ := json.Marshal(p.AliPayPayChannel)
|
||||||
db.ExtJson = string(b)
|
db.ExtJson = string(b)
|
||||||
|
default:
|
||||||
|
err = errors.New("支付渠道类型错误")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type PayChannelListRequest struct {
|
||||||
|
MerchantId int64 `json:"merchant_id"`
|
||||||
|
entities.PageRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type PayChannelUpdateRequest struct {
|
||||||
|
Id int64 `json:"id" validate:"required"`
|
||||||
|
PayChannelCreateRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p PayChannelUpdateRequest) RequestToDb() (db paychannelmodel.PayChannel, err error) {
|
||||||
|
db.Id = p.Id
|
||||||
|
db.PayName = p.PayName
|
||||||
|
db.MerchantId = p.MerchantId
|
||||||
|
db.ChannelType = p.ChannelType
|
||||||
|
db.AppId = p.AppId
|
||||||
|
if p.ExpireTime != "" {
|
||||||
|
db.ExpireTime, err = utils.StrToTimeShanghai(p.ExpireTime)
|
||||||
|
if err != nil {
|
||||||
|
err = errors.Wrap(err, "时间格式错误")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch p.ChannelType {
|
||||||
|
case common.PAY_CHANNEL_WECHAT_H5, common.PAY_CHANNEL_WECHAT_JSAPI, common.PAY_CHANNEL_WECHAT_NATIVE, common.PAY_CHANNEL_WECHAT_APP, common.PAY_CHANNEL_WECHAT_MINI:
|
||||||
|
b, _ := json.Marshal(p.WechatPayChannel)
|
||||||
|
db.ExtJson = string(b)
|
||||||
|
case common.PAY_CHANNEL_ALIPAY_JSAPI, common.PAY_CHANNEL_ALIPAY_WEB, common.PAY_CHANNEL_ALIPAY_MINI:
|
||||||
|
b, _ := json.Marshal(p.AliPayPayChannel)
|
||||||
|
db.ExtJson = string(b)
|
||||||
|
default:
|
||||||
|
err = errors.New("支付渠道类型错误")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package front
|
||||||
|
|
||||||
|
type PayCommonBody struct {
|
||||||
|
AppId string `json:"app_id" validate:"required"`
|
||||||
|
Timestamp int64 `json:"timestamp" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PayWeb struct {
|
||||||
|
PayCommonBody
|
||||||
|
PayChannel int64 `json:"private_key_path"`
|
||||||
|
Delay int64 `json:"delay"` //延时时间
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"PaymentCenter/app/constants/common"
|
"PaymentCenter/app/constants/common"
|
||||||
"PaymentCenter/app/constants/errorcode"
|
"PaymentCenter/app/constants/errorcode"
|
||||||
"PaymentCenter/app/http/controllers"
|
"PaymentCenter/app/http/controllers"
|
||||||
|
"PaymentCenter/app/http/entities/front"
|
||||||
"PaymentCenter/app/http/requestmapping"
|
"PaymentCenter/app/http/requestmapping"
|
||||||
"PaymentCenter/app/utils"
|
"PaymentCenter/app/utils"
|
||||||
"context"
|
"context"
|
||||||
|
@ -89,18 +90,29 @@ func ValidateRequest() gin.HandlerFunc {
|
||||||
if handler == nil {
|
if handler == nil {
|
||||||
utils.Log(c, "path", path)
|
utils.Log(c, "path", path)
|
||||||
controllers.HandCodeRes(c, nil, errorcode.NotFound)
|
controllers.HandCodeRes(c, nil, errorcode.NotFound)
|
||||||
} else {
|
return
|
||||||
v := handler()
|
|
||||||
msg, err := controllers.GenRequest(c, v)
|
|
||||||
if err != nil {
|
|
||||||
utils.Log(c, "参数错误", "path=", path, "err=", err.Error(), "msg=", msg)
|
|
||||||
controllers.Error(c, errorcode.ParamError, msg...)
|
|
||||||
c.Abort()
|
|
||||||
} else {
|
|
||||||
c.Set("request", v)
|
|
||||||
c.Next()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
v := handler()
|
||||||
|
msg, err := controllers.GenRequest(c, v)
|
||||||
|
if err != nil {
|
||||||
|
utils.Log(c, "参数错误", "path=", path, "err=", err.Error(), "msg=", msg)
|
||||||
|
controllers.Error(c, errorcode.ParamError, msg...)
|
||||||
|
c.Abort()
|
||||||
|
}
|
||||||
|
c.Set("request", v)
|
||||||
|
|
||||||
|
c.Next()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func ValidatePayRequest() gin.HandlerFunc {
|
||||||
|
return func(c *gin.Context) {
|
||||||
|
com, err := utils.SonicApiDataToStruct(controllers.GetRequest(c), &front.PayCommonBody{})
|
||||||
|
if err != nil {
|
||||||
|
controllers.Error(c, errorcode.ParamError, err.Error())
|
||||||
|
}
|
||||||
|
com = com.(*front.PayCommonBody)
|
||||||
|
|
||||||
|
c.Next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,4 +13,15 @@ var BackendRequestMap = map[string]func() interface{}{
|
||||||
common.ADMIN_V1 + "/merchant/update": func() interface{} { return new(backend.MerchantUpdateRequest) },
|
common.ADMIN_V1 + "/merchant/update": func() interface{} { return new(backend.MerchantUpdateRequest) },
|
||||||
common.ADMIN_V1 + "/merchant/list": func() interface{} { return new(backend.MerchantListRequest) },
|
common.ADMIN_V1 + "/merchant/list": func() interface{} { return new(backend.MerchantListRequest) },
|
||||||
common.ADMIN_V1 + "/merchant/delete": func() interface{} { return new(entities.IdRequest) },
|
common.ADMIN_V1 + "/merchant/delete": func() interface{} { return new(entities.IdRequest) },
|
||||||
|
// 支付方式
|
||||||
|
common.ADMIN_V1 + "/paychannel/create": func() interface{} { return new(backend.PayChannelCreateRequest) },
|
||||||
|
common.ADMIN_V1 + "/paychannel/update": func() interface{} { return new(backend.PayChannelUpdateRequest) },
|
||||||
|
common.ADMIN_V1 + "/paychannel/list": func() interface{} { return new(backend.PayChannelListRequest) },
|
||||||
|
common.ADMIN_V1 + "/paychannel/delete": func() interface{} { return new(entities.IdRequest) },
|
||||||
|
// 应用
|
||||||
|
common.ADMIN_V1 + "/app/create": func() interface{} { return new(backend.AppCreateRequest) },
|
||||||
|
common.ADMIN_V1 + "/app/update": func() interface{} { return new(backend.AppUpdateRequest) },
|
||||||
|
common.ADMIN_V1 + "/app/list": func() interface{} { return new(backend.AppListRequest) },
|
||||||
|
common.ADMIN_V1 + "/app/delete": func() interface{} { return new(entities.IdRequest) },
|
||||||
|
common.ADMIN_V1 + "/app/decrypt": func() interface{} { return new(backend.GenerateDecryptKeyRequest) },
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
package requestmapping
|
package requestmapping
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PaymentCenter/app/constants/common"
|
||||||
|
"PaymentCenter/app/http/entities/front"
|
||||||
|
)
|
||||||
|
|
||||||
var FrontRequestMap = map[string]func() interface{}{
|
var FrontRequestMap = map[string]func() interface{}{
|
||||||
//"/v1/login": func() interface{} {
|
common.FRONT_V1 + "/pay/web": func() interface{} { return new(front.PayWeb) },
|
||||||
// return new(front.LoginRequest)
|
|
||||||
//},
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,21 @@ func RegisterAdminRoute(router *gin.Engine) {
|
||||||
merchant.POST("/create", backend.MerchantCreate) // 商户创建
|
merchant.POST("/create", backend.MerchantCreate) // 商户创建
|
||||||
merchant.PUT("/update", backend.MerchantUpdate) // 商户更新
|
merchant.PUT("/update", backend.MerchantUpdate) // 商户更新
|
||||||
merchant.DELETE("/delete", backend.MerchantDelete) // 商户删除
|
merchant.DELETE("/delete", backend.MerchantDelete) // 商户删除
|
||||||
|
// 支付方式
|
||||||
|
pay := v1.Group("/paychannel")
|
||||||
|
pay.GET("/list", backend.PayChannelList) // 支付方式列表
|
||||||
|
pay.POST("/create", backend.PayChannelCreate) // 支付方式创建
|
||||||
|
pay.PUT("/update", backend.PayChannelUpdate) // 支付方式更新
|
||||||
|
pay.DELETE("/delete", backend.PayChannelDelete) // 支付方式删除
|
||||||
|
|
||||||
|
// 应用管理
|
||||||
|
app := v1.Group("/app")
|
||||||
|
app.GET("/list", backend.AppList) // 应用列表
|
||||||
|
app.POST("/create", backend.AppCreate) // 应用创建
|
||||||
|
app.PUT("/update", backend.AppUpdate) // 应用更新
|
||||||
|
app.DELETE("/delete", backend.AppDelete) // 应用删除
|
||||||
|
app.GET("/decrypt", backend.GenerateDecrypt) // 生成密钥对
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,9 @@ package routes
|
||||||
* 配置路由
|
* 配置路由
|
||||||
*/
|
*/
|
||||||
import (
|
import (
|
||||||
|
"PaymentCenter/app/constants/common"
|
||||||
"PaymentCenter/app/http/controllers"
|
"PaymentCenter/app/http/controllers"
|
||||||
|
"PaymentCenter/app/http/controllers/backend"
|
||||||
"PaymentCenter/app/http/middlewares"
|
"PaymentCenter/app/http/middlewares"
|
||||||
"PaymentCenter/app/http/trace"
|
"PaymentCenter/app/http/trace"
|
||||||
"PaymentCenter/app/utils/metric"
|
"PaymentCenter/app/utils/metric"
|
||||||
|
@ -13,8 +15,6 @@ import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/qit-team/snow-core/http/middleware"
|
"github.com/qit-team/snow-core/http/middleware"
|
||||||
"github.com/qit-team/snow-core/log/logger"
|
"github.com/qit-team/snow-core/log/logger"
|
||||||
"github.com/swaggo/gin-swagger"
|
|
||||||
"github.com/swaggo/gin-swagger/swaggerFiles"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// api路由配置
|
// api路由配置
|
||||||
|
@ -43,17 +43,12 @@ func RegisterRoute(router *gin.Engine) {
|
||||||
router.Use(middlewares.Cors())
|
router.Use(middlewares.Cors())
|
||||||
router.NoRoute(controllers.Error404)
|
router.NoRoute(controllers.Error404)
|
||||||
|
|
||||||
//api版本
|
//router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||||
//v1 := router.Group("/v1", middlewares.ValidateRequest())
|
v1 := router.Group(common.FRONT_V1, middlewares.ValidateRequest())
|
||||||
//{
|
{
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
||||||
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
pay := v1.Group("pay", middlewares.ValidatePayRequest())
|
||||||
|
pay.POST("web", backend.MerchantList) // 商户列表
|
||||||
|
}
|
||||||
|
|
||||||
//router.GET("/hello", controllers.HelloHandler)
|
|
||||||
//router.GET("/create", controllers.HelloCreateHandler)
|
|
||||||
//router.GET("/update", controllers.UpdateHandler)
|
|
||||||
//router.GET("/delete", controllers.DeleteHandler)
|
|
||||||
//router.GET("/query", controllers.QueryHandler)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ var (
|
||||||
|
|
||||||
// 实体
|
// 实体
|
||||||
type App struct {
|
type App struct {
|
||||||
Id int64 `xorm:"pk autoincr AUTO_RANDOM"`
|
Id int64
|
||||||
MerchantId int64 `xorm:"'merchant_id' bigint(20)"`
|
MerchantId int64 `xorm:"'merchant_id' bigint(20)"`
|
||||||
AppName string `xorm:"'app_name' varchar(128)"`
|
AppName string `xorm:"'app_name' varchar(128)"`
|
||||||
AppRemark string `xorm:"'app_remark' varchar(255)"`
|
AppRemark string `xorm:"'app_remark' varchar(255)"`
|
||||||
|
@ -22,6 +22,8 @@ type App struct {
|
||||||
PublicKey string `xorm:"'public_key' varchar(1024)"`
|
PublicKey string `xorm:"'public_key' varchar(1024)"`
|
||||||
PrivateKey string `xorm:"'private_key' varchar(1024)"`
|
PrivateKey string `xorm:"'private_key' varchar(1024)"`
|
||||||
MerchantPublicKey string `xorm:"'merchant_public_key' varchar(1024)"`
|
MerchantPublicKey string `xorm:"'merchant_public_key' varchar(1024)"`
|
||||||
|
NotifyUrl string `xorm:"'notify_url' varchar(128)"`
|
||||||
|
WhiteIp string `xorm:"'white_ip' varchar(128)"`
|
||||||
CreateTime time.Time `xorm:"'create_time' datetime created"`
|
CreateTime time.Time `xorm:"'create_time' datetime created"`
|
||||||
UpdateTime time.Time `xorm:"'update_time' timestamp updated"`
|
UpdateTime time.Time `xorm:"'update_time' timestamp updated"`
|
||||||
DeleteTime time.Time `xorm:"'delete_time' timestamp deleted"`
|
DeleteTime time.Time `xorm:"'delete_time' timestamp deleted"`
|
||||||
|
|
|
@ -16,11 +16,11 @@ type Orders struct {
|
||||||
Id int64
|
Id int64
|
||||||
MerchantId int64 `xorm:"'merchant_id' bigint(20)"`
|
MerchantId int64 `xorm:"'merchant_id' bigint(20)"`
|
||||||
PayId int64 `xorm:"'pay_id' bigint(20)"`
|
PayId int64 `xorm:"'pay_id' bigint(20)"`
|
||||||
|
AppId int64 `xorm:"'app_id' bigint(20)"`
|
||||||
MerchantOrderId string `xorm:"'merchant_order_id' varchar(128)"`
|
MerchantOrderId string `xorm:"'merchant_order_id' varchar(128)"`
|
||||||
Status int `xorm:"'status' int(11)"`
|
Status int `xorm:"'status' int(11)"`
|
||||||
OrderType int `xorm:"'order_type' int(11)"`
|
OrderType int `xorm:"'order_type' int(11)"`
|
||||||
Amount int `xorm:"'amount' int(11)"`
|
Amount int `xorm:"'amount' int(11)"`
|
||||||
NotifyUrl string `xorm:"'notify_url' varchar(255)"`
|
|
||||||
IpAddress string `xorm:"'ip_address' varchar(128)"`
|
IpAddress string `xorm:"'ip_address' varchar(128)"`
|
||||||
MerchantRequest string `xorm:"'merchant_request' varchar(2048)"`
|
MerchantRequest string `xorm:"'merchant_request' varchar(2048)"`
|
||||||
MerchantResponse string `xorm:"'merchant_response' varchar(255)"`
|
MerchantResponse string `xorm:"'merchant_response' varchar(255)"`
|
||||||
|
|
|
@ -14,16 +14,16 @@ var (
|
||||||
// 实体
|
// 实体
|
||||||
type PayChannel struct {
|
type PayChannel struct {
|
||||||
Id int64
|
Id int64
|
||||||
PayName string `xorm:"'pay_name' varchar(128)"`
|
PayName string `xorm:"'pay_name' varchar(128)"`
|
||||||
MerchantId int64 `xorm:"'merchant_id' bigint(20)"`
|
MerchantId int64 `xorm:"'merchant_id' bigint(20)"`
|
||||||
ChannelType int `xorm:"'channel_type' int(11)"`
|
ChannelType int `xorm:"'channel_type' int(11)"`
|
||||||
WhiteIp string `xorm:"'white_ip' varchar(1024)"`
|
|
||||||
AppId string `xorm:"'app_id' varchar(255)"`
|
AppId string `xorm:"'app_id' varchar(255)"`
|
||||||
ExtJson string `xorm:"'ext_json' JSON"`
|
ExtJson string `xorm:"'ext_json' JSON"`
|
||||||
ExpireTime time.Time `xorm:"'expire_time' datetime"`
|
ExpireTime time.Time `xorm:"'expire_time' datetime"`
|
||||||
CreateTime time.Time `xorm:"'create_time' datetime created"`
|
CreateTime time.Time `xorm:"'create_time' datetime created"`
|
||||||
UpdateTime time.Time `xorm:"'update_time' timestamp updated"`
|
UpdateTime time.Time `xorm:"'update_time' timestamp updated"`
|
||||||
DeleteTime time.Time `xorm:"'delete_time' timestamp deleted"`
|
DeleteTime time.Time `xorm:"'delete_time' timestamp deleted"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表名
|
// 表名
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package services
|
||||||
|
|
||||||
|
func validIp(ip string) bool {
|
||||||
|
return true
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PaymentCenter/app/constants/errorcode"
|
||||||
|
"PaymentCenter/app/data"
|
||||||
|
"PaymentCenter/app/http/entities"
|
||||||
|
"PaymentCenter/app/http/entities/backend"
|
||||||
|
"PaymentCenter/app/models/appmodel"
|
||||||
|
"PaymentCenter/app/models/merchantmodel"
|
||||||
|
"PaymentCenter/app/models/paychannelmodel"
|
||||||
|
"xorm.io/builder"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AppList(req backend.AppListRequest) (result []appmodel.App, total int64, code int) {
|
||||||
|
repo := data.NewAppRepo(paychannelmodel.GetInstance().GetDb())
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
if req.MerchantId > 0 {
|
||||||
|
conn = conn.And(builder.Eq{"merchant_id": req.MerchantId})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用repo
|
||||||
|
appList := make([]appmodel.App, 0)
|
||||||
|
count, err := repo.AppList(conn, req.PageRequest, &appList)
|
||||||
|
code = handErr(err)
|
||||||
|
return appList, count, code
|
||||||
|
}
|
||||||
|
|
||||||
|
func AppCreate(App *appmodel.App) (code int) {
|
||||||
|
db := paychannelmodel.GetInstance().GetDb()
|
||||||
|
repo := data.NewAppRepo(db)
|
||||||
|
merchantRepo := data.NewMerchantRepo(db)
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
conn = conn.And(builder.Eq{"id": App.MerchantId})
|
||||||
|
merchant := merchantmodel.Merchant{}
|
||||||
|
has, err := merchantRepo.MerchantDetail(&merchant, conn)
|
||||||
|
if err != nil {
|
||||||
|
return handErr(err)
|
||||||
|
}
|
||||||
|
if !has {
|
||||||
|
return errorcode.MerchantNotFound
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = repo.AppInsertOne(App)
|
||||||
|
code = handErr(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func AppUpdate(App *appmodel.App) (code int) {
|
||||||
|
db := paychannelmodel.GetInstance().GetDb()
|
||||||
|
repo := data.NewAppRepo(db)
|
||||||
|
merchantRepo := data.NewMerchantRepo(db)
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
conn = conn.And(builder.Eq{"id": App.MerchantId})
|
||||||
|
merchant := merchantmodel.Merchant{}
|
||||||
|
has, err := merchantRepo.MerchantDetail(&merchant, conn)
|
||||||
|
if err != nil {
|
||||||
|
return handErr(err)
|
||||||
|
}
|
||||||
|
if !has {
|
||||||
|
return errorcode.MerchantNotFound
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拼接查询条件
|
||||||
|
uconn := builder.NewCond()
|
||||||
|
uconn = uconn.And(builder.Eq{"Id": App.Id})
|
||||||
|
_, err = repo.AppUpdate(App, uconn, "app_remark")
|
||||||
|
|
||||||
|
code = handErr(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func AppDelete(req entities.IdRequest) (code int) {
|
||||||
|
repo := data.NewAppRepo(paychannelmodel.GetInstance().GetDb())
|
||||||
|
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
conn = conn.And(builder.Eq{"Id": req.Id})
|
||||||
|
m := appmodel.App{Id: req.Id}
|
||||||
|
_, err := repo.AppDelete(&m, conn)
|
||||||
|
|
||||||
|
code = handErr(err)
|
||||||
|
return
|
||||||
|
}
|
|
@ -0,0 +1,85 @@
|
||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PaymentCenter/app/constants/errorcode"
|
||||||
|
"PaymentCenter/app/data"
|
||||||
|
"PaymentCenter/app/http/entities"
|
||||||
|
"PaymentCenter/app/http/entities/backend"
|
||||||
|
"PaymentCenter/app/models/merchantmodel"
|
||||||
|
"PaymentCenter/app/models/paychannelmodel"
|
||||||
|
"xorm.io/builder"
|
||||||
|
)
|
||||||
|
|
||||||
|
func PayChannelList(req backend.PayChannelListRequest) (result []paychannelmodel.PayChannel, total int64, code int) {
|
||||||
|
repo := data.NewPayChannelRepo(paychannelmodel.GetInstance().GetDb())
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
if req.MerchantId > 0 {
|
||||||
|
conn = conn.And(builder.Eq{"merchant_id": req.MerchantId})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用repo
|
||||||
|
paychannelList := make([]paychannelmodel.PayChannel, 0)
|
||||||
|
count, err := repo.PayChannelList(conn, req.PageRequest, &paychannelList)
|
||||||
|
code = handErr(err)
|
||||||
|
return paychannelList, count, code
|
||||||
|
}
|
||||||
|
|
||||||
|
func PayChannelCreate(payChannel *paychannelmodel.PayChannel) (code int) {
|
||||||
|
db := paychannelmodel.GetInstance().GetDb()
|
||||||
|
repo := data.NewPayChannelRepo(db)
|
||||||
|
merchantRepo := data.NewMerchantRepo(db)
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
conn = conn.And(builder.Eq{"id": payChannel.MerchantId})
|
||||||
|
merchant := merchantmodel.Merchant{}
|
||||||
|
has, err := merchantRepo.MerchantDetail(&merchant, conn)
|
||||||
|
if err != nil {
|
||||||
|
return handErr(err)
|
||||||
|
}
|
||||||
|
if !has {
|
||||||
|
return errorcode.MerchantNotFound
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = repo.PayChannelInsertOne(payChannel)
|
||||||
|
code = handErr(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func PayChannelUpdate(payChannel *paychannelmodel.PayChannel) (code int) {
|
||||||
|
db := paychannelmodel.GetInstance().GetDb()
|
||||||
|
repo := data.NewPayChannelRepo(db)
|
||||||
|
merchantRepo := data.NewMerchantRepo(db)
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
conn = conn.And(builder.Eq{"id": payChannel.MerchantId})
|
||||||
|
merchant := merchantmodel.Merchant{}
|
||||||
|
has, err := merchantRepo.MerchantDetail(&merchant, conn)
|
||||||
|
if err != nil {
|
||||||
|
return handErr(err)
|
||||||
|
}
|
||||||
|
if !has {
|
||||||
|
return errorcode.MerchantNotFound
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拼接查询条件
|
||||||
|
uconn := builder.NewCond()
|
||||||
|
uconn = uconn.And(builder.Eq{"Id": payChannel.Id})
|
||||||
|
_, err = repo.PayChannelUpdate(payChannel, uconn, "white_ip")
|
||||||
|
|
||||||
|
code = handErr(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func PayChannelDelete(req entities.IdRequest) (code int) {
|
||||||
|
repo := data.NewPayChannelRepo(paychannelmodel.GetInstance().GetDb())
|
||||||
|
|
||||||
|
// 拼接查询条件
|
||||||
|
conn := builder.NewCond()
|
||||||
|
conn = conn.And(builder.Eq{"Id": req.Id})
|
||||||
|
m := paychannelmodel.PayChannel{Id: req.Id}
|
||||||
|
_, err := repo.PayChannelDelete(&m, conn)
|
||||||
|
|
||||||
|
code = handErr(err)
|
||||||
|
return
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
||||||
|
"github.com/bytedance/sonic"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
@ -410,3 +411,23 @@ func ParseToken(tokenString string) (*jwt.Token, *Claims, error) {
|
||||||
})
|
})
|
||||||
return token, Claims, err
|
return token, Claims, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PopLast[T any](slice *[]T) (T, bool) {
|
||||||
|
if len(*slice) == 0 {
|
||||||
|
var zero T
|
||||||
|
return zero, false
|
||||||
|
}
|
||||||
|
index := len(*slice) - 1
|
||||||
|
lastElement := (*slice)[index]
|
||||||
|
*slice = (*slice)[:index] // 移除最后一个元素
|
||||||
|
return lastElement, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func SonicApiDataToStruct(data interface{}, structInterFace interface{}) (dataStruct interface{}, err error) {
|
||||||
|
bytes, err := sonic.Marshal(data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = sonic.Unmarshal(bytes, &structInterFace)
|
||||||
|
return structInterFace, err
|
||||||
|
}
|
||||||
|
|
6
go.mod
6
go.mod
|
@ -9,6 +9,7 @@ require (
|
||||||
github.com/ZZMarquis/gm v1.3.2
|
github.com/ZZMarquis/gm v1.3.2
|
||||||
github.com/ahmetb/go-linq/v3 v3.2.0
|
github.com/ahmetb/go-linq/v3 v3.2.0
|
||||||
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
|
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
|
||||||
|
github.com/bytedance/sonic v1.10.2
|
||||||
github.com/forgoer/openssl v1.6.0
|
github.com/forgoer/openssl v1.6.0
|
||||||
github.com/gin-gonic/gin v1.7.7
|
github.com/gin-gonic/gin v1.7.7
|
||||||
github.com/go-playground/locales v0.14.0
|
github.com/go-playground/locales v0.14.0
|
||||||
|
@ -51,6 +52,8 @@ require (
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/buger/jsonparser v1.1.1 // indirect
|
github.com/buger/jsonparser v1.1.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
|
||||||
|
github.com/chenzhuoyu/iasm v0.9.1 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
github.com/eapache/go-resiliency v1.1.0 // indirect
|
github.com/eapache/go-resiliency v1.1.0 // indirect
|
||||||
|
@ -77,6 +80,7 @@ require (
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/compress v1.13.6 // indirect
|
github.com/klauspost/compress v1.13.6 // indirect
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
|
||||||
github.com/leodido/go-urn v1.2.1 // indirect
|
github.com/leodido/go-urn v1.2.1 // indirect
|
||||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
|
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
|
||||||
github.com/lestrrat-go/strftime v1.0.5 // indirect
|
github.com/lestrrat-go/strftime v1.0.5 // indirect
|
||||||
|
@ -100,12 +104,14 @@ require (
|
||||||
github.com/tidwall/gjson v1.12.1 // indirect
|
github.com/tidwall/gjson v1.12.1 // indirect
|
||||||
github.com/tidwall/match v1.1.1 // indirect
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
github.com/tidwall/pretty v1.2.0 // indirect
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||||
github.com/ugorji/go/codec v1.2.6 // indirect
|
github.com/ugorji/go/codec v1.2.6 // indirect
|
||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
github.com/valyala/fasttemplate v1.2.1 // indirect
|
github.com/valyala/fasttemplate v1.2.1 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.6.0 // indirect
|
go.uber.org/multierr v1.6.0 // indirect
|
||||||
go.uber.org/zap v1.21.0 // indirect
|
go.uber.org/zap v1.21.0 // indirect
|
||||||
|
golang.org/x/arch v0.6.0 // indirect
|
||||||
golang.org/x/crypto v0.17.0 // indirect
|
golang.org/x/crypto v0.17.0 // indirect
|
||||||
golang.org/x/net v0.17.0 // indirect
|
golang.org/x/net v0.17.0 // indirect
|
||||||
golang.org/x/sync v0.1.0 // indirect
|
golang.org/x/sync v0.1.0 // indirect
|
||||||
|
|
26
go.sum
26
go.sum
|
@ -112,6 +112,10 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
|
||||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||||
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
||||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||||
|
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||||
|
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
|
||||||
|
github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
|
||||||
|
github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
|
||||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
|
@ -119,6 +123,13 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
|
||||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
|
||||||
|
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
|
||||||
|
github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0=
|
||||||
|
github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
|
||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||||
|
@ -451,6 +462,10 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
|
||||||
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
||||||
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
|
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
|
||||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||||
|
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
@ -688,6 +703,8 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||||
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
@ -695,6 +712,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||||
|
@ -718,6 +736,8 @@ github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso
|
||||||
github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
|
github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
|
||||||
github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
|
github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||||
|
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||||
|
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||||
github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
|
github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
|
||||||
|
@ -780,6 +800,9 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||||
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
|
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
|
||||||
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
|
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
|
||||||
|
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||||
|
golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc=
|
||||||
|
golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
||||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
@ -995,6 +1018,7 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
|
@ -1381,7 +1405,9 @@ modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||||
modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
|
modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
|
||||||
modernc.org/z v1.2.19/go.mod h1:+ZpP0pc4zz97eukOzW3xagV/lS82IpPN9NGG5pNF9vY=
|
modernc.org/z v1.2.19/go.mod h1:+ZpP0pc4zz97eukOzW3xagV/lS82IpPN9NGG5pNF9vY=
|
||||||
modernc.org/z v1.2.20/go.mod h1:zU9FiF4PbHdOTUxw+IF8j7ArBMRPsHgq10uVPt6xTzo=
|
modernc.org/z v1.2.20/go.mod h1:zU9FiF4PbHdOTUxw+IF8j7ArBMRPsHgq10uVPt6xTzo=
|
||||||
|
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||||
|
|
Loading…
Reference in New Issue