Skip to content

Commit

Permalink
feat: 下游服务添加了提供流水txId查询的接口
Browse files Browse the repository at this point in the history
  • Loading branch information
universero committed Nov 19, 2024
1 parent e1dd254 commit 887a52f
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 2 deletions.
3 changes: 3 additions & 0 deletions openapi/charge/charge.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ service charge {
// 调用记录部分
rpc CreateLog(CreateLogReq) returns (CreateLogResp);
rpc GetLog(GetLogReq) returns (GetLogResp);

// 流水管理部分
rpc GetAccountByTxId(GetAccountByTxIdReq) returns (GetAccountByTxIdResp);
}

14 changes: 12 additions & 2 deletions openapi/charge/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ message FullInterface {

message Margin {
string id = 1;
string userId= 2;
string userId = 2;
string fullInterfaceId = 3;
int64 margin = 4;
int64 createTime = 5;
Expand Down Expand Up @@ -104,4 +104,14 @@ message Log {
int64 value = 8; // 调用扣费
int64 timestamp = 9; // 调用时间
int64 createTime = 10; // 创建时间
}
}

message Account {
string id = 1;
string txId = 2;
int64 increment = 3;
string marginId = 4;
int64 createTime = 5;
}


8 changes: 8 additions & 0 deletions openapi/charge/log.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,12 @@ message GetLogReq {
message GetLogResp {
repeated Log logs = 1;
int64 total = 2;
}

message GetAccountByTxIdReq {
string id = 1;
}

message GetAccountByTxIdResp {
Account account=1;
}
8 changes: 8 additions & 0 deletions openapi/user/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,12 @@ message GetKeyForCheckResp {
bool check = 3; // 校验结果
string msg = 4; // 校验信息反馈
Role role = 5; // 用户身份类型
}

message GetAccountByTxIdReq {
string id = 1;
}

message GetAccountByTxIdResp {
Account account = 1;
}
8 changes: 8 additions & 0 deletions openapi/user/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ message Key {
int64 expireTime = 8; // 到期时间
int64 createTime = 9;
int64 updateTime = 10;
}

message Account {
string id = 1;
string txId = 2;
int64 increment = 3;
string userId = 4;
int64 createTime = 5;
}
5 changes: 5 additions & 0 deletions openapi/user/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ service user {
* 充值、余额等相关接口
*/
rpc SetRemain(SetRemainReq) returns (SetRemainResp);

/*
* 流水查询接口
*/
rpc GetAccountByTxId(GetAccountByTxIdReq) returns (GetAccountByTxIdResp);
}

0 comments on commit 887a52f

Please sign in to comment.