fix
This commit is contained in:
@@ -12,6 +12,7 @@ type Query {
|
|||||||
Id int64 `json:"id"` // 主键ID
|
Id int64 `json:"id"` // 主键ID
|
||||||
OrderId int64 `json:"order_id"` // 订单ID
|
OrderId int64 `json:"order_id"` // 订单ID
|
||||||
UserId int64 `json:"user_id"` // 用户ID
|
UserId int64 `json:"user_id"` // 用户ID
|
||||||
|
Product string `json:"product"` // 产品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"`
|
||||||
QueryData []QueryItem `json:"query_data"`
|
QueryData []QueryItem `json:"query_data"`
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ func (l *QueryDetailByOrderIdLogic) QueryDetailByOrderId(req *types.QueryDetailB
|
|||||||
var query types.Query
|
var query types.Query
|
||||||
query.CreateTime = queryModel.CreateTime.Format("2006-01-02 15:04:05")
|
query.CreateTime = queryModel.CreateTime.Format("2006-01-02 15:04:05")
|
||||||
query.UpdateTime = queryModel.UpdateTime.Format("2006-01-02 15:04:05")
|
query.UpdateTime = queryModel.UpdateTime.Format("2006-01-02 15:04:05")
|
||||||
|
|
||||||
// 解密查询数据
|
// 解密查询数据
|
||||||
secretKey := l.svcCtx.Config.Encrypt.SecretKey
|
secretKey := l.svcCtx.Config.Encrypt.SecretKey
|
||||||
key, decodeErr := hex.DecodeString(secretKey)
|
key, decodeErr := hex.DecodeString(secretKey)
|
||||||
@@ -104,6 +103,7 @@ func (l *QueryDetailByOrderIdLogic) QueryDetailByOrderId(req *types.QueryDetailB
|
|||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err)
|
||||||
}
|
}
|
||||||
query.ProductName = product.ProductName
|
query.ProductName = product.ProductName
|
||||||
|
query.Product = product.ProductEn
|
||||||
return &types.QueryDetailByOrderIdResp{
|
return &types.QueryDetailByOrderIdResp{
|
||||||
Query: query,
|
Query: query,
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ func (l *QueryDetailByOrderNoLogic) QueryDetailByOrderNo(req *types.QueryDetailB
|
|||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err)
|
||||||
}
|
}
|
||||||
query.ProductName = product.ProductName
|
query.ProductName = product.ProductName
|
||||||
|
query.Product = product.ProductEn
|
||||||
|
|
||||||
return &types.QueryDetailByOrderNoResp{
|
return &types.QueryDetailByOrderNoResp{
|
||||||
Query: query,
|
Query: query,
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ func (l *QueryExampleLogic) QueryExample(req *types.QueryExampleReq) (resp *type
|
|||||||
// 创建一个空的Query结构体来存储结果
|
// 创建一个空的Query结构体来存储结果
|
||||||
query := types.Query{
|
query := types.Query{
|
||||||
ProductName: product.ProductName,
|
ProductName: product.ProductName,
|
||||||
|
Product: product.ProductEn,
|
||||||
QueryData: make([]types.QueryItem, 0),
|
QueryData: make([]types.QueryItem, 0),
|
||||||
QueryParams: make(map[string]interface{}),
|
QueryParams: make(map[string]interface{}),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ func (l *QueryListLogic) QueryList(req *types.QueryListReq) (resp *types.QueryLi
|
|||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 获取商品信息失败, %+v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 获取商品信息失败, %+v", err)
|
||||||
}
|
}
|
||||||
query.ProductName = product.ProductName
|
query.ProductName = product.ProductName
|
||||||
|
query.Product = product.ProductEn
|
||||||
// 检查订单状态,如果订单已退款,则设置查询状态为已退款
|
// 检查订单状态,如果订单已退款,则设置查询状态为已退款
|
||||||
order, findOrderErr := l.svcCtx.OrderModel.FindOne(l.ctx, queryModel.OrderId)
|
order, findOrderErr := l.svcCtx.OrderModel.FindOne(l.ctx, queryModel.OrderId)
|
||||||
if findOrderErr == nil && order.Status == model.OrderStatusRefunded {
|
if findOrderErr == nil && order.Status == model.OrderStatusRefunded {
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ func (l *QueryShareDetailLogic) QueryShareDetail(req *types.QueryShareDetailReq)
|
|||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err)
|
||||||
}
|
}
|
||||||
query.ProductName = product.ProductName
|
query.ProductName = product.ProductName
|
||||||
|
query.Product = product.ProductEn
|
||||||
return &types.QueryShareDetailResp{
|
return &types.QueryShareDetailResp{
|
||||||
Status: "success",
|
Status: "success",
|
||||||
Query: query,
|
Query: query,
|
||||||
|
|||||||
@@ -1656,6 +1656,7 @@ 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
|
||||||
UserId int64 `json:"user_id"` // 用户ID
|
UserId int64 `json:"user_id"` // 用户ID
|
||||||
|
Product string `json:"product"` // 产品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"`
|
||||||
QueryData []QueryItem `json:"query_data"`
|
QueryData []QueryItem `json:"query_data"`
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ func TestPasswordHash(t *testing.T) {
|
|||||||
if PasswordVerify("wrongpassword", hash) {
|
if PasswordVerify("wrongpassword", hash) {
|
||||||
t.Errorf("PasswordVerify() 应该验证失败,但验证成功了")
|
t.Errorf("PasswordVerify() 应该验证失败,但验证成功了")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 输出加密后的密码,便于人工检查
|
||||||
|
t.Logf("原始密码: %s, 加密后: %s", tc.password, hash)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user