取消必填多余字段
This commit is contained in:
parent
c8a6b557a9
commit
c9bd4612f2
|
|
@ -7,21 +7,21 @@ import "validate/validate.proto";
|
|||
message CmbRequest {
|
||||
// 请求公共参数
|
||||
// 合作方唯一ID,32位定长
|
||||
string mid = 1 [json_name = "mid", (validate.rules).string = {min_len: 1,max_len: 100}];
|
||||
string mid = 1 [json_name = "mid"];
|
||||
// 应用唯一ID,32位定长
|
||||
string aid = 2 [json_name = "aid", (validate.rules).string = {min_len: 1,max_len: 100}];
|
||||
string aid = 2 [json_name = "aid"];
|
||||
// 时间戳 yyyyMMddHHmmss
|
||||
string date = 3 [json_name = "date", (validate.rules).string = {min_len: 14}];
|
||||
string date = 3 [json_name = "date"];
|
||||
// 随机字符串,保证签名不可预测,不长于32位
|
||||
string random = 4 [json_name = "random", (validate.rules).string = {min_len: 1,max_len: 50}];
|
||||
string random = 4 [json_name = "random"];
|
||||
// 合作方密钥对别名
|
||||
string keyAlias = 5 [json_name = "keyAlias", (validate.rules).string = {min_len: 2,max_len: 50}];
|
||||
string keyAlias = 5 [json_name = "keyAlias"];
|
||||
// 掌上生活密钥对别名
|
||||
string cmbKeyAlias = 6 [json_name = "cmbKeyAlias", (validate.rules).string = {min_len: 2,max_len: 50}];
|
||||
string cmbKeyAlias = 6 [json_name = "cmbKeyAlias"];
|
||||
// 加密报文,是否需要加密,请查看各API的说明文档
|
||||
string encryptBody = 7 [json_name = "encryptBody", (validate.rules).string = {min_len: 10,max_len: 20000}];
|
||||
string encryptBody = 7 [json_name = "encryptBody", (validate.rules).string = {min_len: 2}];
|
||||
// 签名,具体详见签名规范
|
||||
string sign = 8 [json_name = "sign", (validate.rules).string = {min_len: 10,max_len: 5000}];
|
||||
string sign = 8 [json_name = "sign", (validate.rules).string = {min_len: 2}];
|
||||
}
|
||||
|
||||
message CmbReply {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ type CmbMixRepo interface {
|
|||
// GetMockRequest cmb 券参数mock构建
|
||||
GetMockRequest(ctx context.Context, bizContent string) (*v1.CmbRequest, error)
|
||||
// GetRequest 我们请求cmb参数构建处理
|
||||
GetRequest(_ context.Context, reqBo *bo.CmbRequestBo) (*v1.CmbRequest, error)
|
||||
GetRequest(ctx context.Context, reqBo *bo.CmbRequestBo) (*v1.CmbRequest, error)
|
||||
// GetResponse cmb 请求我们响应返回结果处理
|
||||
GetResponse(ctx context.Context, reqBo *bo.CmbResponseBo) (*v1.CmbReply, error)
|
||||
// VerifyResponse cmb 请求响应返回结果验证
|
||||
|
|
@ -24,5 +24,5 @@ type CmbMixRepo interface {
|
|||
// Request cmb 请求
|
||||
Request(ctx context.Context, req *v1.CmbRequest, uri string) (*v1.CmbReply, error)
|
||||
// Decrypt cmb 业务参数 解密
|
||||
Decrypt(_ context.Context, encryptBody string) (string, error)
|
||||
Decrypt(ctx context.Context, encryptBody string) (string, error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,11 +238,5 @@ func (s *CmbMixRepoImpl) Request(ctx context.Context, req *v1.CmbRequest, uri st
|
|||
}
|
||||
|
||||
func (s *CmbMixRepoImpl) Decrypt(_ context.Context, encryptBody string) (string, error) {
|
||||
|
||||
encryptBody, err := cmb.Decrypt(s.bc.Cmb.Sm2Prk, encryptBody)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return encryptBody, nil
|
||||
return cmb.Decrypt(s.bc.Cmb.Sm2Prk, encryptBody)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ func (s *VoucherService) CmbOrder(ctx http.Context) error {
|
|||
return ctx.JSON(400, err)
|
||||
}
|
||||
|
||||
log.Warnf("orderNo:%s cmbProductQuery replyBizContent:%s GetResponse: %v", orderNo, string(replyBizContent), reply)
|
||||
return ctx.JSON(200, reply)
|
||||
}
|
||||
|
||||
|
|
@ -120,8 +119,6 @@ func (s *VoucherService) CmbQuery(ctx http.Context) error {
|
|||
return ctx.JSON(400, err)
|
||||
}
|
||||
|
||||
log.Warnf("CmbQuery GetResponse: %v", reply)
|
||||
|
||||
return ctx.JSON(200, reply)
|
||||
}
|
||||
|
||||
|
|
@ -183,8 +180,6 @@ func (s *VoucherService) CmbProductQuery(ctx http.Context) error {
|
|||
return ctx.JSON(400, err)
|
||||
}
|
||||
|
||||
log.Warnf("cmbProductQuery replyBizContent:%s GetResponse: %v", string(replyBizContent), reply)
|
||||
|
||||
return ctx.JSON(200, reply)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue