Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat show #14

Closed
wants to merge 7 commits into from
62 changes: 55 additions & 7 deletions essay/show/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ message SignUpResp {
string id = 1;
string accessToken = 2;
int64 accessExpire = 3;
string name = 4;
}

// 登录请求
Expand All @@ -42,6 +43,7 @@ message SignInResp {
string id = 1;
string accessToken = 2;
int64 accessExpire = 3;
string name = 4;
}

// 获取用户信息请求
Expand All @@ -53,12 +55,31 @@ message GetUserInfoResp {
message Payload {
string name = 1;
int64 count = 2;
string phone = 3;
}
int64 code = 1;
string msg = 2;
Payload payload = 3;
}

// 更新用户信息
message UpdateUserInfoReq {
string name = 1;
}

// 修改密码请求
message UpdatePasswordReq {
string verifyCode = 1;
string password = 2;
}

// 修改密码相应
message UpdatePasswordResp {
string id = 1;
string accessToken = 2;
int64 accessExpire = 3;
string name = 4;
}

/*
* 作文批改相关
Expand All @@ -69,7 +90,7 @@ message EssayEvaluateReq {
string title = 1;
string text = 2;
int64 grade = 3;
string ocr = 4;
repeated string ocr = 4;
}

// 批改作文的响应
Expand All @@ -93,14 +114,41 @@ message GetEssayEvaluateLogsResp {
message Log {
string id = 1;
int64 grade = 2;
string ocr = 3;
repeated string ocr = 3;
string response = 4;
int64 createTime = 5;
}

// 获取加签后url
message ApplySignedUrlReq {
optional string prefix = 1;
optional string suffix = 2;
}

message ApplySignedUrlResp {
string url = 1;
string sessionToken = 2;
}

// 调用OCR接口
message OCRReq {
repeated string ocr = 1;
}

message OCRResp {
string title = 1;
string text = 2;
}

// 响应
//message Response {
// bool done = 1;
// string msg = 2;
//}
//
message Response {
int64 code = 1;
string msg = 2;
}

// 发送验证码请求
message SendVerifyCodeReq {
string authType = 1;
string authId = 2;
int64 type = 3;
}
20 changes: 20 additions & 0 deletions essay/show/show.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ service show {
rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp) {
option (http.get) = "/user/info";
}
// 更新用户密码
rpc UpdatePassword(UpdatePasswordReq) returns (UpdatePasswordReq) {
option(http.post) = "/user/update_password";
}
// 更新用户信息
rpc UpdateUserInfo(UpdateUserInfoReq) returns (Response) {
option(http.post) = "/user/update";
}
// 文本作文批改
rpc EssayEvaluate(EssayEvaluateReq) returns (EssayEvaluateResp) {
option (http.post) = "/essay/evaluate";
Expand All @@ -31,4 +39,16 @@ service show {
rpc GetEvaluateLogs(GetEssayEvaluateLogsReq) returns (GetEssayEvaluateLogsResp) {
option (http.post) = "/essay/logs";
}
// 获取ocr
rpc OCR(OCRReq) returns (OCRResp) {
option (http.post) = "/sts/ocr";
}
// 获取加签后url
rpc ApplySignedUrl(ApplySignedUrlReq) returns (ApplySignedUrlResp) {
option (http.post) = "/sts/apply";
}
// 发送验证码
rpc SendVerifyCode(SendVerifyCodeReq) returns (Response) {
option (http.post) = "/sts/send_verify_code";
}
}
1 change: 1 addition & 0 deletions openapi/charge/charge.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ service charge {
rpc CreateGradient(CreateGradientReq) returns (CreateGradientResp);
rpc UpdateGradient(UpdateGradientReq) returns (UpdateGradientResp);
rpc GetGradient(GetGradientReq) returns (GetGradientResp);
rpc GetAmount(GetAmountReq) returns (GetAmountResp);

/*
* log.proto
Expand Down
13 changes: 13 additions & 0 deletions openapi/charge/interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,17 @@ message GetGradientReq {
// 获取梯度折扣响应
message GetGradientResp {
Gradient gradient = 1;
}

// 计算价格请求
message GetAmountReq {
int64 increment = 1;
string fullInfId = 2;
}

// 计算价格响应
message GetAmountResp {
int64 rate = 1; // 折扣程度
int64 originAmount = 2; // 原始价格
int64 amount = 3; // 折后价格
}
12 changes: 11 additions & 1 deletion openapi/core_api/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ message GetFullInterfacesResp {
message BuyFullInterfaceReq {
string fullInterfaceId = 1; // 如果之前没有买过则为模板的id,若买过则是用户的id
int64 increment = 2; // 购买的量
bool discount = 3; // 是否有折扣
// bool discount = 3; // 是否有折扣不应该是前端的参数,而是下游服务根据数据库判断
}


Expand All @@ -205,6 +205,16 @@ message GetGradientReq {
message GetGradientResp {
charge.Gradient gradient = 1;
}
message GetAmountReq {
int64 increment = 1;
string fullInfId = 2;
}
// 计算价格响应
message GetAmountResp {
int64 rate = 1; // 折扣程度
int64 originAmount = 2; // 原始价格,如果要扣除则一律给出负数
int64 amount = 3; // 折后价格,如果要扣除则一律给出负数
}


// 获取调用记录请求
Expand Down
3 changes: 3 additions & 0 deletions openapi/core_api/core_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ service charge {
rpc GetGradient(GetGradientReq) returns (GetGradientResp) {
option (http.get) = "/gradient/get";
}
rpc GetAmount(GetAmountReq) returns (GetAmountResp) {
option (http.post) = "/gradient/amount";
}
}

service call {
Expand Down
Loading