2023-02-15 01:10:11 +00:00
|
|
|
/*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership.
|
|
|
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
* (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
package account;
|
2023-02-24 02:51:35 +00:00
|
|
|
import "github.com/mwitkow/go-proto-validators@v0.3.2/validator.proto";
|
2023-02-15 01:10:11 +00:00
|
|
|
|
|
|
|
option go_package = "./;account";
|
|
|
|
|
|
|
|
service Account {
|
|
|
|
rpc Login (LoginRequest) returns (TokenInfo) {}
|
2023-02-24 02:51:35 +00:00
|
|
|
rpc Logout (DecryptJwtRequest) returns (CommonResponse) {}
|
|
|
|
rpc OffLine (CommonRequest) returns (CommonResponse) {}
|
|
|
|
rpc OnlineLog (LoginInfosByUserIdRequest) returns (LoginLogsResponse) {}//根据用户id获取登录的信息
|
2023-02-15 01:10:11 +00:00
|
|
|
rpc CheckPwd (CheckPwdRequest) returns (UpdateResponse) {}//检测密码是否正确
|
|
|
|
rpc Register (RegistRequest) returns (RequestStatus) {}
|
|
|
|
rpc SendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {}
|
|
|
|
rpc SendMsgRegister (SendMsgRequest) returns (SendMsgStatusResponse) {}
|
|
|
|
rpc CheckMsg (CheckMsgRequest) returns (SendMsgStatusResponse) {}
|
|
|
|
rpc SendNewTelNumMsg (SendNewTelNumMsgRequest) returns (SendMsgStatusResponse) {}//发送新账号验证码,不携带新号码
|
|
|
|
rpc UpdateTelNum (SendNewTelNumMsgRequest) returns (SendMsgStatusResponse) {}//更新新手机号,校验新号码验证码
|
|
|
|
rpc Authentication (AuthenticationRequest) returns (RequestStatus) {}
|
|
|
|
rpc DecryptJwt (DecryptJwtRequest) returns (DecryptJwtResponse) {}//最好放在调用方
|
|
|
|
rpc Info (InfoRequest) returns (InfoResponse) {}
|
|
|
|
rpc List (ListRequest) returns (ListResponse) {}
|
|
|
|
rpc RandList (ListRequest) returns (ListResponse) {}
|
|
|
|
rpc ListByIDs (ListByIDsRequest) returns (ListResponse) {}
|
|
|
|
rpc Remove (RemoveRequest) returns (RemoveResponse) {}
|
|
|
|
rpc Update (UpdateRequest) returns (UpdateResponse) {}
|
|
|
|
rpc PrivacyInfo (PrivacyInfoRequest) returns (AccountInfo) {}
|
|
|
|
rpc UsersByTel (UsersByTelRequest) returns (ListResponse) {}
|
|
|
|
rpc UserByTel (UserByTelRequest) returns (InfoResponse) {}
|
|
|
|
}
|
|
|
|
|
2023-02-24 02:51:35 +00:00
|
|
|
message CommonRequest {
|
|
|
|
uint64 ID = 1 [json_name = "ID"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoginLogsResponse {
|
|
|
|
repeated LoginLog Data = 1 [json_name = "data"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoginLog {
|
|
|
|
string Domain = 1 [json_name = "domain"];
|
|
|
|
uint64 ID = 2 [json_name = "ID"];
|
|
|
|
uint64 UserId = 3 [json_name = "userId"];
|
|
|
|
string Ip = 4 [json_name = "ip"];
|
|
|
|
string Token = 5 [json_name = "token"];
|
|
|
|
uint64 Status = 6 [json_name = "status"];
|
|
|
|
string ExpireDate = 7 [json_name = "expireDate"];
|
|
|
|
string LastDate = 8 [json_name = "lastDate"];
|
|
|
|
string LogoutDate = 9 [json_name = "logoutDate"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoginInfosByUserIdRequest {
|
|
|
|
string Domain = 1 [json_name = "domain"];
|
|
|
|
uint64 UserId = 2 [json_name = "userId"];
|
|
|
|
}
|
|
|
|
|
2023-02-15 01:10:11 +00:00
|
|
|
message SendNewTelNumMsgRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
uint64 ID = 2 [json_name = "ID",(validator.field) = {string_not_empty: true,human_error: "缺少参数"} ];
|
|
|
|
string NewTelNum = 3 [json_name = "newTelNum"];
|
|
|
|
string Code = 4 [json_name = "code"];
|
|
|
|
string Project = 5 [json_name = "project"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message UserByTelRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
string Tel =2 [json_name = "tel"];
|
|
|
|
}
|
|
|
|
|
2023-02-24 02:51:35 +00:00
|
|
|
message CommonResponse {
|
|
|
|
}
|
|
|
|
|
2023-02-15 01:10:11 +00:00
|
|
|
message UsersByTelRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
repeated string Tels =2 [json_name = "tels"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListByIDsRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
2023-02-24 02:51:35 +00:00
|
|
|
repeated uint64 IDs = 2 [json_name = "IDs"];
|
|
|
|
uint64 OrderType = 3 [json_name = "OrderType"];
|
|
|
|
uint64 Page = 4 [json_name = "page"];
|
|
|
|
uint64 PageSize = 5 [json_name = "pageSize"];
|
|
|
|
string NickName = 6 [json_name = "nickName"];
|
|
|
|
repeated string InvitationCode = 7 [json_name = "invitationCode"];
|
|
|
|
|
2023-02-15 01:10:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SendMsgRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
|
|
|
string Project = 3 [json_name = "telNum"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message CheckMsgRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
|
|
|
string Code = 3 [json_name = "code",(validator.field) = {string_not_empty: true,human_error: "70003"} ];
|
|
|
|
}
|
|
|
|
|
|
|
|
message SendMsgStatusResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
uint64 ID = 2 [json_name = "ID",(validator.field) = {int_gt: 0,human_error: "70004"} ];
|
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateRequest {
|
|
|
|
uint64 ID = 1 [json_name = "ID"]; //ID
|
|
|
|
string Domain = 2 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
string NickName = 3 [json_name = "nickName"];
|
|
|
|
string Password = 4 [json_name = "password"]; //密码
|
|
|
|
string Avatar = 5 [json_name = "avatar"]; //头像
|
|
|
|
string Status = 7 [json_name = "status"];
|
|
|
|
string TelNum = 8 [json_name = "telNum"];
|
|
|
|
string EnterDate = 14 [json_name = "enterDate"];
|
|
|
|
Extend Extend = 17 [json_name = "extend"];
|
|
|
|
string Title = 18 [json_name = "title"];
|
|
|
|
string JobNum = 19 [json_name = "jobNum"];
|
|
|
|
string BirthDate = 20 [json_name = "birthDate"];
|
|
|
|
uint64 Sex = 21 [json_name = "sex"];
|
|
|
|
string IdNum = 22 [json_name = "idNum"];
|
|
|
|
string RealName = 23 [json_name = "realName"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message PrivacyInfoRequest {
|
|
|
|
uint64 ID = 1 [json_name = "ID"]; //ID
|
|
|
|
string Domain = 2 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
uint64 PageSize = 2 [json_name = "pageSize"];
|
|
|
|
uint64 Page = 3 [json_name = "page"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListResponse {
|
|
|
|
string Status = 1 [json_name = "status"];
|
|
|
|
uint64 Count = 2 [json_name = "count"];
|
|
|
|
repeated AccountInfo Data = 3 [json_name = "data"];
|
|
|
|
uint64 AllCount = 4 [json_name = "allCount"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message InfoRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
uint64 ID = 2 [json_name = "id"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message InfoResponse {
|
|
|
|
string Status = 1 [json_name = "status"];
|
|
|
|
AccountInfo Info = 2 [json_name = "accountInfo"];
|
|
|
|
bool IsExist = 3 [json_name = "isExist"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message DecryptJwtResponse {
|
2023-02-24 02:51:35 +00:00
|
|
|
string Domain = 1 [json_name = "status"];
|
|
|
|
uint64 ID = 2 [json_name = "id"];
|
|
|
|
string Account = 3 [json_name = "account"];
|
|
|
|
string NickName = 4 [json_name = "nickName"];
|
|
|
|
bool IsOffline = 5 [json_name = "isOffline"];
|
2023-02-15 01:10:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message DecryptJwtRequest {
|
|
|
|
string token = 1 [json_name = "token"];
|
2023-02-24 02:51:35 +00:00
|
|
|
string Domain = 2 [json_name = "Domain"];
|
2023-02-15 01:10:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message CheckPwdRequest {
|
|
|
|
string Token = 1 [json_name = "token"];
|
|
|
|
string Password = 2 [json_name = "password"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message AuthenticationRequest {
|
|
|
|
string Name = 1 [json_name = "name"];
|
|
|
|
string IDNum = 2 [json_name = "idNum",(validator.field) = {length_eq: 18,human_error: "70006"}];
|
|
|
|
string Token = 3 [json_name = "token"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message RequestStatus {
|
|
|
|
string Status = 1 [json_name = "status"];
|
|
|
|
uint64 ID = 2 [json_name = "ID"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message RegistRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"}];
|
|
|
|
string NickName = 2 [json_name = "nickName",(validator.field) = {length_lt: 20,string_not_empty: true,human_error: "70005"}];
|
|
|
|
string TelNum = 3 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
|
|
|
string Password = 4 [json_name = "password",(validator.field) = {length_gt: 5,human_error: "70007"}]; //密码
|
|
|
|
string Avatar = 5 [json_name = "avatar"]; //头像
|
|
|
|
string EnterDate = 14 [json_name = "enterDate"];
|
|
|
|
Extend Extend = 15 [json_name = "extend"];
|
|
|
|
string JobNum = 16 [json_name = "JobNum"]; //工号
|
|
|
|
string Code = 17 [json_name = "code"]; //工号
|
|
|
|
string IdNum = 18 [json_name = "idNum"]; //年龄
|
|
|
|
string RealName = 19 [json_name = "realName"]; //
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoginRequest {
|
|
|
|
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
|
|
|
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
|
|
|
string Code = 3 [json_name = "code"];
|
|
|
|
string Password = 4 [json_name = "password"];
|
2023-02-24 02:51:35 +00:00
|
|
|
string Ip = 5 [json_name = "ip"];
|
2023-02-15 01:10:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message TokenInfo {
|
|
|
|
AccountInfo AccountInfo = 1 [json_name = "accountInfo"];
|
|
|
|
string Token = 2 [json_name = "token"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message Extend {
|
|
|
|
string JumpTo = 1 [json_name = "jumpTo"];
|
|
|
|
string Lang = 2 [json_name = "lang"];
|
|
|
|
}
|
|
|
|
|
|
|
|
message Department {
|
|
|
|
uint64 ID = 1 [json_name = "ID"];
|
|
|
|
string Name = 2 [json_name = "name"];
|
|
|
|
}
|
|
|
|
|
|
|
|
// The response message containing the greetings
|
|
|
|
message AccountInfo {
|
|
|
|
uint64 ID = 1 [json_name = "id"];
|
|
|
|
string Account = 2 [json_name = "account"];
|
|
|
|
string NickName = 3 [json_name = "nickName"];
|
|
|
|
int64 Type = 4 [json_name = "type"];
|
|
|
|
string TelNum = 5 [json_name = "telNum"];
|
|
|
|
string Status = 6 [json_name = "status"];
|
|
|
|
string Avatar = 7 [json_name = "avatar"];
|
|
|
|
string CreateAt = 8 [json_name = "createAt"];
|
|
|
|
uint64 RealNameID = 9 [json_name = "realNameID"];
|
|
|
|
string RealName = 10 [json_name = "realName"];
|
|
|
|
string IDNum = 11 [json_name = "iDNum"];
|
|
|
|
string MnemonicWords = 12 [json_name = "mnemonicWords"];
|
|
|
|
uint64 IsNeedChange = 13 [json_name = "isNeedChange"];
|
|
|
|
string EnterDate = 14 [json_name = "enterDate"];
|
|
|
|
float WorkYear = 15 [json_name = "workYear"];
|
|
|
|
string Domain = 16 [json_name = "domain"];
|
|
|
|
Extend Extend = 17 [json_name = "extend"];
|
|
|
|
string JobNum = 18 [json_name = "jobNum"];
|
|
|
|
string BirthDate = 19 [json_name = "birth_date"];
|
|
|
|
uint64 Age = 20 [json_name = "age"];
|
|
|
|
uint64 Sex = 21 [json_name = "sex"];
|
|
|
|
string Title = 22 [json_name = "title"];
|
|
|
|
repeated Department Departments = 23 [json_name = "departments"];
|
2023-02-24 02:51:35 +00:00
|
|
|
string Ip = 24 [json_name = "ip"];
|
|
|
|
string LoginDate = 25 [json_name = "loginDate"];
|
|
|
|
string InvitationCode = 26 [json_name = "invitationCode"];
|
2023-02-15 01:10:11 +00:00
|
|
|
}
|