voucher/api/v1/cmb_cpn.proto

217 lines
7.2 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package api.v1;
option go_package = "voucher/api/v1;v1";
import "validate/validate.proto";
import "google/api/annotations.proto";
service Cmb {
rpc Order (CmbRequest) returns (CmbReply) {
option (google.api.http) = {
post: "/voucher/cmb/v1/order",
body: "*"
};
}
rpc Query (CmbRequest) returns (CmbReply) {
option (google.api.http) = {
post: "/voucher/cmb/v1/query",
body: "*"
};
}
rpc QueryProduct (CmbRequest) returns (CmbReply) {
option (google.api.http) = {
post: "/voucher/cmb/v1/product/query",
body: "*"
};
}
rpc OrderMock (CmbOrderRequest) returns (CmbRequest) {
option (google.api.http) = {
post: "/voucher/cmb/v1/orderMock",
body: "*"
};
}
rpc QueryMock (CmbQueryRequest) returns (CmbRequest) {
option (google.api.http) = {
post: "/voucher/cmb/v1/queryMock",
body: "*"
};
}
rpc QueryProductMock (CmbQueryProductRequest) returns (CmbRequest) {
option (google.api.http) = {
post: "/voucher/cmb/v1/product/queryMock",
body: "*"
};
}
rpc DecryptBody (EncryptBodyRequest) returns (DecryptBodyReply) {
option (google.api.http) = {
post: "/voucher/cmb/v1/decryptBody",
body: "*"
};
}
}
message CmbRequest {
// 请求公共参数
// 合作方唯一ID32位定长
string mid = 1 [json_name = "mid"];
// 应用唯一ID32位定长
string aid = 2 [json_name = "aid"];
// 时间戳 yyyyMMddHHmmss
string date = 3 [json_name = "date"];
// 随机字符串保证签名不可预测不长于32位
string random = 4 [json_name = "random"];
// 合作方密钥对别名
string keyAlias = 5 [json_name = "keyAlias"];
// 掌上生活密钥对别名
string cmbKeyAlias = 6 [json_name = "cmbKeyAlias"];
// 加密报文是否需要加密请查看各API的说明文档
string encryptBody = 7 [json_name = "encryptBody"];
// 签名,具体详见签名规范
string sign = 8 [json_name = "sign"];
}
message CmbReply {
// 响应公共参数
// 接口调用返回码1000 成功1001 失败
string respCode = 1 [json_name = "respCode"];
// 返回话术,失败信息落此字段
string respMsg = 2 [json_name = "respMsg"];
// 时间戳 yyyyMMddHHmmss
string date = 3 [json_name = "date"];
// 合作方密钥对别名
string keyAlias = 5 [json_name = "keyAlias"];
// 掌上生活密钥对别名
string cmbKeyAlias = 6 [json_name = "cmbKeyAlias"];
// 加密报文是否需要加密请查看各API的说明文档
string encryptBody = 7 [json_name = "encryptBody"];
// 签名,具体详见签名规范
string sign = 8 [json_name = "sign"];
}
message CmbOrderRequest {
// 业务参数
// 唯一流水号需支持14天内幂等
string transactionId = 9 [json_name = "transactionId", (validate.rules).string = {min_len: 1,max_len: 50}];
// 外部合作方权益批次号
string activityId = 10 [json_name = "activityId", (validate.rules).string = {min_len: 1,max_len: 32}];
// 招商银行用户号 用户标识比如手机号、支付宝openId
string cmbUid = 11 [json_name = "cmbUid", (validate.rules).string = {min_len: 1,max_len: 50}];
// 应用id
string appId = 14 [json_name = "appId", (validate.rules).string = {min_len: 1,max_len: 20}];
// 用户标识类型0-手机号1-支付宝openId
string cmbUidType = 12 [json_name = "cmbUidType", (validate.rules).string = {min_len: 1,max_len: 10}];
// 时间戳长度为13位精度为毫秒
string timestamp = 13 [json_name = "timestamp", (validate.rules).string = {min_len: 1,max_len: 14}];
// 拓展参数
string attach = 15 [json_name = "attach"];
}
message CmbOrderReply {
// 业务参数
// 接口调用返回码1000 成功1001 失败
string respCode = 1 [json_name = "respCode"];
// 返回话术,失败信息落此字段
string respMsg = 2 [json_name = "respMsg"];
// 权益标识优惠券券码最大长度为50位
string codeNo = 9 [json_name = "codeNo"];
// 错误码
string thirdErrCode = 3 [json_name = "thirdErrCode"];
}
message CmbQueryRequest {
// 业务参数
// 外部合作方权益批次号
string codeNo = 9 [json_name = "codeNo", (validate.rules).string = {min_len: 1,max_len: 32}];
}
message CmbQueryReply {
// 优惠券券码codeNo
string ticket = 9 [json_name = "ticket"];
// 更新后串码状态0可使用1已使用
string status = 10 [json_name = "status"];
// 验码日期格式yyyy-mm-dd hh:mm:ss.sss
string transDate = 11 [json_name = "transDate"];
// 发码机构号,固定值,掌上生活优惠券系统提供
string orgNo = 12 [json_name = "orgNo"];
// 扩展字段
string ext = 13 [json_name = "ext"];
}
message CmbQueryProductRequest {
// 业务参数
// 外部合作方权益批次号
string activityId = 9 [json_name = "activityId", (validate.rules).string = {min_len: 1,max_len: 32}];
}
message CmbQueryProductReply {
// 接口调用返回码1000 成功1001 失败
string respCode = 1 [json_name = "respCode"];
// 返回话术,失败信息落此字段
string respMsg = 2 [json_name = "respMsg"];
// 业务参数
// 批次名称
string activityName = 9 [json_name = "activityName"];
// 外部合作方权益批次号
string activityId = 10 [json_name = "activityId"];
// 面额,单位为分
string amount = 11 [json_name = "amount"];
// 门槛,单位为分
string minAmount = 12 [json_name = "minAmount"];
// 有效期形式0固定有效期1动态有效期
string availableType = 13 [json_name = "availableType"];
// 动态有效期天数-非必填
string availableDays = 14 [json_name = "availableDays"];
// 有效期开始时间-非必填
string startTime = 15 [json_name = "startTime"];
// 有效期结束时间-非必填
string endTime = 16 [json_name = "endTime"];
// 当前可用库存
string availableStock = 17 [json_name = "availableStock"];
// 细则描述
string detail = 18 [json_name = "detail"];
// 批次开始日期 格式yyyy-mm-dd hh:mm:ss.sss
// 批次激活时间
string saleStartTime = 19 [json_name = "saleStartTime"];
// 批次结束时间格式yyyy-mm-dd hh:mm:ss.sss
// 批次激活时间
string saleEndTime = 20 [json_name = "saleEndTime"];
// 错误码
string thirdErrCode = 21 [json_name = "thirdErrCode"];
}
message CmbNotifyRequest {
// 优惠券券码codeNo
string ticket = 9 [json_name = "ticket"];
// 更新后串码状态0可使用1已使用
string status = 10 [json_name = "status"];
// 验码日期格式yyyy-mm-dd hh:mm:ss.sss
string transDate = 11 [json_name = "transDate"];
// 发码机构号,固定值,掌上生活优惠券系统提供
string orgNo = 12 [json_name = "orgNo"];
// 扩展字段
string ext = 13 [json_name = "ext"];
string attach = 14 [json_name = "attach"];
}
message CmbNotifyReply {
// 接口调用返回码1000 成功1001 失败
string respCode = 1 [json_name = "respCode"];
// 返回信息,失败信息落此字段
string respMsg = 2 [json_name = "respMsg"];
}
message EncryptBodyRequest {
string encryptBody = 1 [json_name = "encryptBody"];
}
message DecryptBodyReply {
string decryptBody = 1 [json_name = "decryptBody"];
}