diff --git a/app/main/api/desc/front/query.api b/app/main/api/desc/front/query.api index 3d3db3b..6981c37 100644 --- a/app/main/api/desc/front/query.api +++ b/app/main/api/desc/front/query.api @@ -12,6 +12,7 @@ type Query { Id int64 `json:"id"` // 主键ID OrderId int64 `json:"order_id"` // 订单ID UserId int64 `json:"user_id"` // 用户ID + Product string `json:"product"` // 产品ID ProductName string `json:"product_name"` // 产品ID QueryParams map[string]interface{} `json:"query_params"` QueryData []QueryItem `json:"query_data"` diff --git a/app/main/api/internal/logic/query/querydetailbyorderidlogic.go b/app/main/api/internal/logic/query/querydetailbyorderidlogic.go index fcd0723..9888674 100644 --- a/app/main/api/internal/logic/query/querydetailbyorderidlogic.go +++ b/app/main/api/internal/logic/query/querydetailbyorderidlogic.go @@ -75,7 +75,6 @@ func (l *QueryDetailByOrderIdLogic) QueryDetailByOrderId(req *types.QueryDetailB var query types.Query query.CreateTime = queryModel.CreateTime.Format("2006-01-02 15:04:05") query.UpdateTime = queryModel.UpdateTime.Format("2006-01-02 15:04:05") - // 解密查询数据 secretKey := l.svcCtx.Config.Encrypt.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) } query.ProductName = product.ProductName + query.Product = product.ProductEn return &types.QueryDetailByOrderIdResp{ Query: query, }, nil diff --git a/app/main/api/internal/logic/query/querydetailbyordernologic.go b/app/main/api/internal/logic/query/querydetailbyordernologic.go index 06a1c1f..8b52205 100644 --- a/app/main/api/internal/logic/query/querydetailbyordernologic.go +++ b/app/main/api/internal/logic/query/querydetailbyordernologic.go @@ -95,6 +95,8 @@ func (l *QueryDetailByOrderNoLogic) QueryDetailByOrderNo(req *types.QueryDetailB return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err) } query.ProductName = product.ProductName + query.Product = product.ProductEn + return &types.QueryDetailByOrderNoResp{ Query: query, }, nil diff --git a/app/main/api/internal/logic/query/queryexamplelogic.go b/app/main/api/internal/logic/query/queryexamplelogic.go index 3c7e367..e41c8f2 100644 --- a/app/main/api/internal/logic/query/queryexamplelogic.go +++ b/app/main/api/internal/logic/query/queryexamplelogic.go @@ -38,6 +38,7 @@ func (l *QueryExampleLogic) QueryExample(req *types.QueryExampleReq) (resp *type // 创建一个空的Query结构体来存储结果 query := types.Query{ ProductName: product.ProductName, + Product: product.ProductEn, QueryData: make([]types.QueryItem, 0), QueryParams: make(map[string]interface{}), } diff --git a/app/main/api/internal/logic/query/querylistlogic.go b/app/main/api/internal/logic/query/querylistlogic.go index 90029ca..8f17823 100644 --- a/app/main/api/internal/logic/query/querylistlogic.go +++ b/app/main/api/internal/logic/query/querylistlogic.go @@ -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) } query.ProductName = product.ProductName - + query.Product = product.ProductEn // 检查订单状态,如果订单已退款,则设置查询状态为已退款 order, findOrderErr := l.svcCtx.OrderModel.FindOne(l.ctx, queryModel.OrderId) if findOrderErr == nil && order.Status == model.OrderStatusRefunded { diff --git a/app/main/api/internal/logic/query/querysharedetaillogic.go b/app/main/api/internal/logic/query/querysharedetaillogic.go index 9628468..8680f69 100644 --- a/app/main/api/internal/logic/query/querysharedetaillogic.go +++ b/app/main/api/internal/logic/query/querysharedetaillogic.go @@ -103,6 +103,7 @@ func (l *QueryShareDetailLogic) QueryShareDetail(req *types.QueryShareDetailReq) return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告查询, 获取商品信息失败, %v", err) } query.ProductName = product.ProductName + query.Product = product.ProductEn return &types.QueryShareDetailResp{ Status: "success", Query: query, diff --git a/app/main/api/internal/types/types.go b/app/main/api/internal/types/types.go index 33fae80..e3cd5b5 100644 --- a/app/main/api/internal/types/types.go +++ b/app/main/api/internal/types/types.go @@ -1656,6 +1656,7 @@ type Query struct { Id int64 `json:"id"` // 主键ID OrderId int64 `json:"order_id"` // 订单ID UserId int64 `json:"user_id"` // 用户ID + Product string `json:"product"` // 产品ID ProductName string `json:"product_name"` // 产品ID QueryParams map[string]interface{} `json:"query_params"` QueryData []QueryItem `json:"query_data"` diff --git a/pkg/lzkit/crypto/bcrypt_test.go b/pkg/lzkit/crypto/bcrypt_test.go index 3d7ea11..39eb86f 100644 --- a/pkg/lzkit/crypto/bcrypt_test.go +++ b/pkg/lzkit/crypto/bcrypt_test.go @@ -81,6 +81,9 @@ func TestPasswordHash(t *testing.T) { if PasswordVerify("wrongpassword", hash) { t.Errorf("PasswordVerify() 应该验证失败,但验证成功了") } + + // 输出加密后的密码,便于人工检查 + t.Logf("原始密码: %s, 加密后: %s", tc.password, hash) }) } }