1、列表增加order_no

2、申请代理配置Nornal
This commit is contained in:
liangzai 2025-05-28 17:57:22 +08:00
parent 031ba733f5
commit e0f1a848a6
11 changed files with 50 additions and 10 deletions

4
.gitignore vendored
View File

@ -13,10 +13,6 @@ data/*
# gitlab ci # gitlab ci
.cache .cache
#vscode
.vscode
.vscode/
/tmp/ /tmp/
/app/api /app/api

24
.vscode/launch.json vendored Normal file
View 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
View 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": []
}
]
}

View File

@ -13,6 +13,7 @@ info (
type Query { type Query {
Id int64 `json:"id"` // 主键ID Id int64 `json:"id"` // 主键ID
OrderId int64 `json:"order_id"` // 订单ID OrderId int64 `json:"order_id"` // 订单ID
OrderNo string `json:"order_no"` // 订单号
UserId int64 `json:"user_id"` // 用户ID UserId int64 `json:"user_id"` // 用户ID
ProductName string `json:"product_name"` // 产品ID ProductName string `json:"product_name"` // 产品ID
QueryParams map[string]interface{} `json:"query_params"` QueryParams map[string]interface{} `json:"query_params"`

View File

@ -129,6 +129,7 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
agentModel.Mobile = agentAudit.Mobile agentModel.Mobile = agentAudit.Mobile
agentModel.Region = agentAudit.Region agentModel.Region = agentAudit.Region
agentModel.UserId = agentAudit.UserId agentModel.UserId = agentAudit.UserId
agentModel.LevelName = model.AgentLeveNameNormal
agentModelInsert, insertAgentModelErr := l.svcCtx.AgentModel.Insert(transCtx, session, &agentModel) agentModelInsert, insertAgentModelErr := l.svcCtx.AgentModel.Insert(transCtx, session, &agentModel)
if insertAgentModelErr != nil { if insertAgentModelErr != nil {
return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "代理申请, 新增代理失败: %+v", insertAgentModelErr) return errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "代理申请, 新增代理失败: %+v", insertAgentModelErr)

View File

@ -40,7 +40,6 @@ func (l *QueryPaymentCheckLogic) QueryPaymentCheck(req *types.QueryPaymentCheckR
resp = new(types.QueryPaymentCheckResp) resp = new(types.QueryPaymentCheckResp)
resp.OrderStatus = order.Status resp.OrderStatus = order.Status
resp.ProductName = product.ProductName resp.ProductName = product.ProductName
if order.Status == "paid" { if order.Status == "paid" {
authorization, err := l.svcCtx.AuthorizationModel.FindOneByOrderId(l.ctx, order.Id) authorization, err := l.svcCtx.AuthorizationModel.FindOneByOrderId(l.ctx, order.Id)
if err != nil { if err != nil {

View File

@ -140,7 +140,6 @@ func (l *WechatPayCallbackLogic) handleQueryOrderPayment(w http.ResponseWriter,
return fmt.Errorf("插入授权信息失败: %+v", err) return fmt.Errorf("插入授权信息失败: %+v", err)
} }
} }
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("success")) _, _ = w.Write([]byte("success"))
return nil return nil

View File

@ -58,7 +58,7 @@ func (l *QueryListLogic) QueryList(req *types.QueryListReq) (resp *types.QueryLi
// 设置订单ID // 设置订单ID
query.OrderId = orderModel.Id query.OrderId = orderModel.Id
query.UserId = orderModel.UserId query.UserId = orderModel.UserId
query.OrderNo = orderModel.OrderNo
// 获取商品信息 // 获取商品信息
product, findProductErr := l.svcCtx.ProductModel.FindOne(l.ctx, orderModel.ProductId) product, findProductErr := l.svcCtx.ProductModel.FindOne(l.ctx, orderModel.ProductId)
if findProductErr != nil { if findProductErr != nil {

View File

@ -378,6 +378,7 @@ type ProductResponse struct {
type Query struct { type Query struct {
Id int64 `json:"id"` // 主键ID Id int64 `json:"id"` // 主键ID
OrderId int64 `json:"order_id"` // 订单ID OrderId int64 `json:"order_id"` // 订单ID
OrderNo string `json:"order_no"` // 订单号
UserId int64 `json:"user_id"` // 用户ID UserId int64 `json:"user_id"` // 用户ID
ProductName string `json:"product_name"` // 产品ID ProductName string `json:"product_name"` // 产品ID
QueryParams map[string]interface{} `json:"query_params"` QueryParams map[string]interface{} `json:"query_params"`

View File

@ -8,7 +8,7 @@ import (
func TestGenerateAndParseJwtToken(t *testing.T) { func TestGenerateAndParseJwtToken(t *testing.T) {
// 测试参数 // 测试参数
userId := int64(102) userId := int64(2012)
secret := "WUvoIwL-FK0qnlxhvxR9tV6SjfOpeJMpKmY2QvT99lA" secret := "WUvoIwL-FK0qnlxhvxR9tV6SjfOpeJMpKmY2QvT99lA"
expireTime := int64(2592000) // 1小时过期 expireTime := int64(2592000) // 1小时过期
@ -22,7 +22,7 @@ func TestGenerateAndParseJwtToken(t *testing.T) {
} }
fmt.Println(token) fmt.Println(token)
// 解析token // 解析token
parsedUserId, err := ParseJwtToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTA4NDAxNzAsImlhdCI6MTc0ODI0ODE3MCwidXNlcklkIjo2OH0.c7EihKJPsN9r2HL1tkKXD-UCVSMhUchBntB-XSA_WbQ", secret) parsedUserId, err := ParseJwtToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTA5MjYyNTgsImlhdCI6MTc0ODMzNDI1OCwidXNlcklkIjoxNDN9.V4qV3dAjE6G-xm0KmB6QHCVhy2SmRDGAWcvl32hLNmI", secret)
if err != nil { if err != nil {
t.Fatalf("解析JWT令牌失败: %v", err) t.Fatalf("解析JWT令牌失败: %v", err)
} }

View File

@ -9,7 +9,7 @@ import (
func TestAesEcbMobileEncryption(t *testing.T) { func TestAesEcbMobileEncryption(t *testing.T) {
// 测试手机号加密 // 测试手机号加密
mobile := "15008098853" mobile := "18562870088"
keyStr := "ff83609b2b24fc73196aac3d3dfb874f" keyStr := "ff83609b2b24fc73196aac3d3dfb874f"
// 测试加密 // 测试加密