1、列表增加order_no
2、申请代理配置Nornal
This commit is contained in:
parent
031ba733f5
commit
e0f1a848a6
4
.gitignore
vendored
4
.gitignore
vendored
@ -13,10 +13,6 @@ data/*
|
||||
# gitlab ci
|
||||
.cache
|
||||
|
||||
#vscode
|
||||
.vscode
|
||||
.vscode/
|
||||
|
||||
/tmp/
|
||||
|
||||
/app/api
|
||||
|
24
.vscode/launch.json
vendored
Normal file
24
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Package",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${fileDirname}",
|
||||
"args": []
|
||||
},
|
||||
{
|
||||
"name": "调试API服务",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/app/user/cmd/api/main.go",
|
||||
"args": ["-f", "etc/main.dev.yaml"],
|
||||
"env": {
|
||||
"ENV": "development"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
19
.vscode/tasks.json
vendored
Normal file
19
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Run Go-Zero API (无调试)",
|
||||
"type": "shell",
|
||||
"command": "go run ${workspaceFolder}/app/user/cmd/api/main.go -f ${workspaceFolder}/app/user/cmd/api/etc/main.dev.yaml",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "new"
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
@ -13,6 +13,7 @@ info (
|
||||
type Query {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
UserId int64 `json:"user_id"` // 用户ID
|
||||
ProductName string `json:"product_name"` // 产品ID
|
||||
QueryParams map[string]interface{} `json:"query_params"`
|
||||
|
@ -129,6 +129,7 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
|
||||
agentModel.Mobile = agentAudit.Mobile
|
||||
agentModel.Region = agentAudit.Region
|
||||
agentModel.UserId = agentAudit.UserId
|
||||
agentModel.LevelName = model.AgentLeveNameNormal
|
||||
agentModelInsert, insertAgentModelErr := l.svcCtx.AgentModel.Insert(transCtx, session, &agentModel)
|
||||
if insertAgentModelErr != nil {
|
||||
return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "代理申请, 新增代理失败: %+v", insertAgentModelErr)
|
||||
|
@ -40,7 +40,6 @@ func (l *QueryPaymentCheckLogic) QueryPaymentCheck(req *types.QueryPaymentCheckR
|
||||
resp = new(types.QueryPaymentCheckResp)
|
||||
resp.OrderStatus = order.Status
|
||||
resp.ProductName = product.ProductName
|
||||
|
||||
if order.Status == "paid" {
|
||||
authorization, err := l.svcCtx.AuthorizationModel.FindOneByOrderId(l.ctx, order.Id)
|
||||
if err != nil {
|
||||
|
@ -140,7 +140,6 @@ func (l *WechatPayCallbackLogic) handleQueryOrderPayment(w http.ResponseWriter,
|
||||
return fmt.Errorf("插入授权信息失败: %+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, _ = w.Write([]byte("success"))
|
||||
return nil
|
||||
|
@ -58,7 +58,7 @@ func (l *QueryListLogic) QueryList(req *types.QueryListReq) (resp *types.QueryLi
|
||||
// 设置订单ID
|
||||
query.OrderId = orderModel.Id
|
||||
query.UserId = orderModel.UserId
|
||||
|
||||
query.OrderNo = orderModel.OrderNo
|
||||
// 获取商品信息
|
||||
product, findProductErr := l.svcCtx.ProductModel.FindOne(l.ctx, orderModel.ProductId)
|
||||
if findProductErr != nil {
|
||||
|
@ -378,6 +378,7 @@ type ProductResponse struct {
|
||||
type Query struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
UserId int64 `json:"user_id"` // 用户ID
|
||||
ProductName string `json:"product_name"` // 产品ID
|
||||
QueryParams map[string]interface{} `json:"query_params"`
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
func TestGenerateAndParseJwtToken(t *testing.T) {
|
||||
// 测试参数
|
||||
userId := int64(102)
|
||||
userId := int64(2012)
|
||||
secret := "WUvoIwL-FK0qnlxhvxR9tV6SjfOpeJMpKmY2QvT99lA"
|
||||
expireTime := int64(2592000) // 1小时过期
|
||||
|
||||
@ -22,7 +22,7 @@ func TestGenerateAndParseJwtToken(t *testing.T) {
|
||||
}
|
||||
fmt.Println(token)
|
||||
// 解析token
|
||||
parsedUserId, err := ParseJwtToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTA4NDAxNzAsImlhdCI6MTc0ODI0ODE3MCwidXNlcklkIjo2OH0.c7EihKJPsN9r2HL1tkKXD-UCVSMhUchBntB-XSA_WbQ", secret)
|
||||
parsedUserId, err := ParseJwtToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTA5MjYyNTgsImlhdCI6MTc0ODMzNDI1OCwidXNlcklkIjoxNDN9.V4qV3dAjE6G-xm0KmB6QHCVhy2SmRDGAWcvl32hLNmI", secret)
|
||||
if err != nil {
|
||||
t.Fatalf("解析JWT令牌失败: %v", err)
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
func TestAesEcbMobileEncryption(t *testing.T) {
|
||||
// 测试手机号加密
|
||||
mobile := "15008098853"
|
||||
mobile := "18562870088"
|
||||
|
||||
keyStr := "ff83609b2b24fc73196aac3d3dfb874f"
|
||||
// 测试加密
|
||||
|
Loading…
Reference in New Issue
Block a user