/*
 * 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 accountFiee;
import "github.com/mwitkow/go-proto-validators/validator.proto";
option go_package = "./;accountFiee";

//protoc -I . -I C:\Users\lenovo\go\src  --go_out=. --go-triple_out=. ./accountFiee.proto
service AccountFiee {
  rpc Login (LoginRequest) returns (TokenInfo) {}
  rpc RefreshToken (RefreshTokenRequest) returns (TokenInfo) {} //刷新token
  rpc Logout (DecryptJwtRequest) returns (CommonResponse) {}
  rpc OffLine (CommonRequest) returns (CommonResponse) {}
  rpc OnlineLog (LoginInfosByUserIdRequest) returns (LoginLogsResponse) {}//根据用户id获取登录的信息
  rpc OnlineLogById (OnlineLogByIdRequest) returns (LoginLog) {}//根据用户id获取登录的信息
  rpc CheckPwd (CheckPwdRequest) returns (UpdateResponse) {}//检测密码是否正确
//  rpc RegisterOrExist (RegistRequest) returns (RequestStatus) {}
  rpc SendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {} //登陆发送验证码
  rpc SendCustomMsg (SendCustomMsgRequest) returns (SendMsgStatusResponse) {}//定制化发送内容
  rpc SendExCustomMsg (SendCustomMsgRequest) 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 (UserInfoResponse) {}
  rpc JobNumGetInfo (JobNumGetInfoRequest) 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 UsersByTel (UsersByTelRequest) returns (ListResponse) {}
  rpc UserByTel (UserByTelRequest) returns (UserInfoResponse) {}
  rpc OnlySendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {} //仅发验证码
  rpc OnlyCheckMsg (CheckMsgRequest) returns (SendMsgStatusResponse) {}//仅校验之前发送的验证码
  rpc MailAccountByNickName(MailAccountByNickNameRequest) returns(MaiAccountResponse){} //根据昵称姓名获取昵称的邮箱和拼音名称
  rpc ListV2 (ListV2Request) returns (ListResponse) {}// 新版列表 查询
  rpc QueryPersonnelWithTheSameName (QueryPersonnelWithTheSameNameRequest) returns (QueryPersonnelWithTheSameNameResponse) {}// 查询同名的员工
  rpc UsersByJobNum (UsersByJobNumRequest) returns (ListResponse) {}
  rpc RealName (RealNameRequest) returns (RealNameResponse) {}//实名认证
  rpc Register (RegistRequest) returns (RegisterResponse) {}//注册
  rpc UserList (UserListRequest) returns (UserListResponse) {}//用户列表
  rpc CheckRealName (CheckRealNameRequest) returns (CheckRealNameResponse) {}//审核实名
  rpc GenerateSliderCaptcha(GenerateSliderCaptchaRequest) returns (GenerateSliderCaptchaResponse) {}// 生成滑块验证码图片+位置
  rpc VerifySliderCaptcha(VerifySliderCaptchaRequest) returns (VerifySliderCaptchaResponse) {}// 验证滑块验证码位置
  rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} //发送境外国际短信验证码 --艺术商城
  rpc VerifySliderStatus(VerifySliderStatusRequest) returns (VerifySliderStatusResponse) {}// 验证滑块验证码状态

  // submit info
  rpc SaveSubmitInfo(SubmitInfoRequest) returns (CommonResponse);

  //-----------------------------客服聊天系统--------------------------------
  rpc CreateChatUser ( ChatUserData )returns( CreateChatUserResp ){} //创建聊天用户
  rpc UpdateChatUser ( ChatUserData )returns( CommonMsg ){} //更新聊天用户
  rpc SaveChatUser ( ChatUserData )returns( CommonMsg ){} //覆盖聊天用户
  rpc DeleteChatUser ( DeleteChatUserRequest )returns( CommonMsg ){}   //删除聊天用户
  rpc GetChatUserDetail ( GetChatUserByIdRequest )returns( ChatUserData ){}   //查询聊天用户详情
  rpc GetChatUserList ( GetChatUserListRequest )returns( GetChatUserListResp ){}   //查询聊天用户列表
  rpc GetChatUserList2 ( GetChatUserListRequest2 )returns( GetChatUserListResp2 ){}   //查询聊天用户列表2
  rpc RegisterWaiter ( RegisterWaiterRequest )returns( RegisterWaiterResp ){} //注册客服账号
  rpc CreateChatRecord ( ChatRecordData )returns( CreateChatRecordResp ){} //创建ChatRecord
  rpc UpdateChatRecord ( ChatRecordData )returns( CommonMsg ){} //更新ChatRecord
  rpc SaveChatRecord ( ChatRecordData )returns( CommonMsg ){} //覆盖ChatRecord
  rpc DeleteChatRecord ( DeleteChatRecordRequest )returns( CommonMsg ){}   //删除ChatRecord
  rpc GetChatRecordDetail ( GetChatRecordByIdRequest )returns( ChatRecordData ){}   //查询ChatRecord详情
  rpc GetChatRecordList ( GetChatRecordListRequest )returns( GetChatRecordListResp ){}   //查询ChatRecord列表
  rpc CreateChatMedia ( ChatMediaData )returns( CreateChatMediaResp ){} //创建ChatMedia
  rpc UpdateChatMedia ( ChatMediaData )returns( CommonMsg ){} //更新ChatMedia
  rpc SaveChatMedia ( ChatMediaData )returns( CommonMsg ){} //覆盖ChatMedia
  rpc DeleteChatMedia ( DeleteChatMediaRequest )returns( CommonMsg ){}   //删除ChatMedia
  rpc GetChatMediaDetail ( GetChatMediaByIdRequest )returns( ChatMediaData ){}   //查询ChatMedia详情
  rpc GetChatMediaList ( GetChatMediaListRequest )returns( GetChatMediaListResp ){}   //查询ChatMedia列表
  rpc CreateChatAutoReplyRuler ( ChatAutoReplyRulerData )returns( CreateChatAutoReplyRulerResp ){} //创建自动回复规则
  rpc UpdateChatAutoReplyRuler ( ChatAutoReplyRulerData )returns( CommonMsg ){} //更新自动回复规则
  rpc SaveChatAutoReplyRuler ( ChatAutoReplyRulerData )returns( CommonMsg ){} //覆盖自动回复规则
  rpc DeleteChatAutoReplyRuler ( DeleteChatAutoReplyRulerRequest )returns( CommonMsg ){}   //删除自动回复规则
  rpc GetChatAutoReplyRulerDetail ( GetChatAutoReplyRulerByIdRequest )returns( ChatAutoReplyRulerData ){}   //查询自动回复规则详情
  rpc GetChatAutoReplyRulerList ( GetChatAutoReplyRulerListRequest )returns( GetChatAutoReplyRulerListResp ){}   //查询自动回复规则列表
}

message VerifySliderStatusRequest {
  string nonceStr = 1;
}

message VerifySliderStatusResponse {
  string nonceStr = 1;
  int32 status = 2;
}

message SendNationMsgRequest {
  string Domain   = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
  string TelNum   = 2 [json_name = "telNum",(validator.field) = {string_not_empty: true,human_error: "70001"}];
  string Project  = 3 [json_name = "project"];
  uint32 signNo  = 4;
  uint32 mId  = 5;
  string scope  = 6;//标记模块
}
message VerifySliderCaptchaResponse {
  string nonceStr = 1;
}

message VerifySliderCaptchaRequest {
  string nonceStr = 1;
  float blockX = 2;
}
message GenerateSliderCaptchaResponse {
  string nonceStr = 1;
  string canvasSrc = 2;
  string blockSrc = 3;
  uint64 blockY = 4;
  uint64 faceY = 5;
  uint64 blockX = 6;
}

message GenerateSliderCaptchaRequest {
  uint64 canvasWidth = 1;
  uint64 canvasHeight = 2;
  uint64 blockWidth = 3;
  uint64 blockHeight = 4;
  uint64 blockRadius = 5;
  uint64 place = 6;
}
message CheckRealNameResponse{
  uint64 id =1;
  string status =2;
}
message CheckRealNameRequest{
  uint64 id = 1;
  bool pass = 2;
  string notPassRemarks = 3;
}
message UserListResponse{
  uint64 count = 1;
  uint64 page = 2;
  uint64 pageSize = 3;
  repeated UserListInfo userList = 4;
}
message UserListInfo{
  uint64 id = 1;
  int32 status = 2;
  string name = 3;
  string sex = 4;
  string nationality = 5;
  int32 documentType =6;
  string certificatePicture = 7;
  string validity = 8;
  string placeOfResidence = 9;
  string groupPhoto = 10;
  string attachment = 11;
  string registrationTime = 12;
  string auditTime = 13;
  string subNum = 14;
  string notPassRemarks = 15;
  string telNum = 16;
  string telAreaCode = 17;
  string language = 18;
  string subscriberNumber = 19;
  string nickName = 20;
}
message UserListRequest{
  string domain = 1;
  string subNum = 2;
  int32 realNameOrNot = 3;
  string name = 4;
  string sex = 5;
  int32 documentType = 6;
  int32 auditStatus = 7;
  uint64 page = 8;
  uint64 pageSize = 9;
  string blurNameTel = 10;
  repeated int64 ids = 11;
  string nationality = 12;
}
message UserInfoResponse{
  uint64 id = 1;
  int32 status = 2;
  string name = 3;
  string sex = 4;
  string nationality = 5;
  int32 documentType =6;
  string certificatePicture = 7;
  string validity = 8;
  string placeOfResidence = 9;
  string groupPhoto = 10;
  string attachment = 11;
  string subNum = 12;
  string notPassRemarks = 13;
  string domain = 14;
  string language = 15;
  string subscriberNumber = 16;
  string nickName = 17;
  string telNum = 18;
}
message RealNameResponse{
  uint64 id = 1;
  string status = 2;
}
message RealNameRequest{
  uint64 id = 1;
  string name = 2;
  string sex = 3;
  string nationality = 4;
  int32 documentType = 5;
  string certificatePicture = 6;
  string validity = 7;
  string placeOfResidence = 8;
  string groupPhoto = 9;
  string attachment = 10;
}
message RegisterResponse{
  uint64 ID = 1;
  uint64 status = 2;
  string token = 3;
}
message UsersByJobNumRequest{
  string domain = 1 ;
  repeated string jobNum =2 ;
}
message QueryPersonnelWithTheSameNameRequest{
  repeated string names = 1 ;
  string domain = 2 ;
  string status = 3 ;
}
message QueryPersonnelWithTheSameNameResponse{
  repeated string names = 1 ;
  uint64 count = 2 ;
}
message ListV2Request {
  string domain   = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
  uint64 pageSize    = 2 ;
  uint64 page   = 3 ;
  string key   = 4 ;
  string nickName   = 5;
  string telNum   = 6 ;
  string status   = 7 ;
  string positionName   = 8 ;
  string jobNum   = 9 ;
  string mailAccount   = 10 ;
  string startEnterDate   = 11 ;
  string endEnterDate   = 12 ;
  uint32 positionId   = 13 ;
  uint32 departmentId   = 14 ;
  string departmentName =15 ;
  repeated string departmentNames =16 ;
  repeated uint32 positionIds =17 ;
  repeated uint32 departmentIds =18 ;
}

message SendClockInWechatRequest {
  string domain = 1;
  string telNum =2;
  string operatedAt =3;
  string clockType =4;
  uint32 userId =5;
  string ghId =6;
  string address =7;
  uint64 logId = 8;
}
message MailAccountByNickNameRequest {
  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"}];
  uint32 ID                     = 3 ;
}

message CreateMaiAccountRequest {
  uint32 ID        = 1 ;
  string nickName      = 2;
  string domain        = 3 ;
}

message MaiAccountResponse {
  string englishName        = 1 ;
  string mailAccount      = 2;
}

message FddCreateUserRequest {
  string openid        = 1 ;
  uint32 wxUserId      = 2;
  //string UserId        = 3;
  string customerId    = 4;
  bool   isVerify      = 5;
  string   transactionNo      = 6;
}

message WxBoxUserInfoRequest {
  string openid        = 2 ;
  string ghId         = 3;
}

message WxGetOpenIdByCodeRequest {
  string code         = 1 ;
  string state        = 2 ;
  string ghId         = 3;
}

message WxGetOpenIdByCodeResponse {
  string openId         = 1 ;
}

message WxBoxTelNumByCodeResponse {
  string telNum         = 1 ;
}

message WxBoxUserInfo {
  string openId       = 1 ;
  string ghId         = 2 ;
  bool isNew          = 3 ;
  UserInfo user       = 4 ;
  uint32 wxUserId     = 5 ;
  FddInfo fdd         = 6 ;
}

message FddInfo {
  uint64    ID              = 1 ;
  string    customerId      = 2 ;
  bool      isVerify        = 3 ;
  string    transactionNo   = 4;
}

message UserInfo {
  uint64    ID              = 1 ;
  string    nickName        = 3 ;
  string    telNum          = 5 ;
  string    avatar          = 7 ;
  string    createAt        = 8 ;
  uint64    realNameID      = 9 ;
  string    realName        = 10;
  string    iDNum           = 11;
  string    domain          = 12;
  string    realIDImgA      = 17;
  string    realIDImgB      = 18;
  string    realNameIDName = 19;
  string    video = 20;
}

message CommonRequest {
  uint64 ID         = 1 [json_name = "ID"];
}

message WxAppRequest {
  string GhId         = 1 [json_name = "ID"];
}

message WxAppResponse {
  string AppID        = 1 [json_name = "appID"];
  string AppSecret    = 2 [json_name = "appSecret"];
}

message WxUserUpdateRequest {
  uint32 wxID          = 1 [json_name = "wxId" ,(validator.field) = {string_not_empty: true,human_error: "缺少参数wxID"} ];
  uint32 userID        = 2 [json_name = "userID"];
}

message WxUserOrCreateRequest {
  string OpenID        = 1 [json_name = "openID" ,(validator.field) = {string_not_empty: true,human_error: "缺少openid"} ];
  string GhID          = 2 [json_name = "ghID" ,(validator.field) = {string_not_empty: true,human_error: "缺少参数ghid"} ];
}

message WxUserResponse {
  string OpenID        = 1 [json_name = "openID"];
  uint32 UserID        = 2 [json_name = "userID"];
  string GhID          = 3 [json_name = "ghID"];
  string RoleAuth      = 4 [json_name = "roleAuth"];
  uint32 ID            = 5 [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"];
  string CreatedAt  = 10 [json_name = "createdAt"];
  string Address    = 11 [json_name = "address"];
}

message OnlineLogByIdRequest {
  string Domain = 1 [json_name = "domain"];
  uint64 ID     = 2 [json_name = "ID"];
}

message LoginInfosByUserIdRequest {
  string Domain     = 1 [json_name = "domain"];
  uint64 UserId     = 2 [json_name = "userId"];
}

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"];
  uint32 signNo     = 6 ;
}

message UserByTelRequest {
  string Domain   = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
  string Tel =2 [json_name = "tel"];
}

message CommonResponse {
}

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"} ];
  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"];

}

message SendMsgRequest {
  string Domain   = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
  string TelNum   = 2 [json_name = "telNum"];
  //string TelNum   = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
  string Project  = 3 [json_name = "project"];
  uint32 signNo  = 4;
  uint32 mId  = 5;
  string scope  = 6;  //标记模块
  string zone  = 7;   //地区 不同地区切换不同发送帐号
  string nonceStr = 8;
}

message SendCustomMsgRequest {
  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 = "project"];
  string Url      = 4 [json_name = "Url"];
  uint64 ID       = 5 [json_name = "ID"];
  uint64 MId      = 6 [json_name = "mId"];
  uint64 Location = 7 [json_name = "location"];
  uint32 SigNo = 8 [json_name = "sigNo"];
}

message CheckMsgRequest {
  string Domain   = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
  string TelNum   = 2 [json_name = "telNum"];
  string Code     = 3 [json_name = "code",(validator.field) = {string_not_empty: true,human_error: "70003"} ];
  string scope    = 4;//标记模块
  string zone  = 5;   //地区 不同地区切换不同发送帐号
}

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"} ];
  string code = 3;
}
message WriteOffRequest{
  uint64 id = 1;
  string domain = 2;
  uint64 userId = 3;
  string tel = 4;
  string jonNum = 5;
  string userName = 6;
  string enterDate = 7;
  string positionName =8;
  uint64 positionId = 9;
  string siteName = 10;
  uint64 siteId =11;
  string authUrl =12;
  string type =13;
  uint32 status =14;
  string submitDate=15;
}
message WriteOffListRequest{
  uint64 page = 1;
  uint64 pageSize =2;
  string domain = 3;
  string userName =4;
  uint64 userId = 5;
  uint64 siteId =6;
  string type =7;
  uint32 status =8;
}
message WriteOffApproveRequest{
  uint64 id = 1;
  uint32 status = 2;
}
message WriteOffListResponse{
  int64 total = 1;
  repeated WriteOffRequest writeOffList = 2;
}
message RemoveResponse {
}

message UpdateRequest {
  uint64 ID                           = 1 [json_name = "ID"];  //ID
  string Domain                       = 2 [json_name = "domain"];
  string Language                     = 3 [json_name = "language"];
  string NickName = 4 [json_name = "nickName"];
}

message  Operator {
  uint32  ID = 1;
  string  Name = 2;
}

message  trainVideo {
  string  trainUUID = 1 [json_name = "trainUUID"];
  string  trainDesc = 2 [json_name = "trainDesc"];
  string  video = 3 [json_name = "video"];
  string SecurityCode = 31 [json_name = "securityCode"];
}

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"} ];
  string SecurityCode = 3 [json_name = "securityCode"];
}

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"];
  string key      = 4 [json_name = "key"];
  string status   = 5 ;
  string telNum = 6;
  string startEnterDate = 7;
  string endEnterDate = 8;
}

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"];
  string scene    = 3 ;//场景值 base-默认仅仅user数据
}

message InfoResponse {
  string      Status    = 1 [json_name = "status"];
  AccountInfo Info    = 2 [json_name = "accountInfo"];
  bool        IsExist     = 3 [json_name = "isExist"];
}

message DecryptJwtResponse {
  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"];
}

message DecryptJwtRequest {
  string token = 1 [json_name = "token"];
  string Domain = 2 [json_name = "Domain"];
}

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"];
  bool isExist     = 3;
}

message RegistRequest {
  string domain = 1;
  string telNum = 2;
  string code = 3;
  string address = 4;
  string telAreaCode = 5;
  string language = 6;
  string nickName = 7;
}

message LoginRequest {
  string Domain     = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
  string TelNum     = 2 [json_name = "telNum"];
  string Code       = 3 [json_name = "code"];
  string Password   = 4 [json_name = "password"];
  string Ip         = 5 [json_name = "ip"];
  bool passCheckIp  = 6 ;
  string telAreaCode = 7;
}

message TokenInfo {
  AccountInfo AccountInfo   = 1 [json_name = "accountInfo"];
  string Token              = 2 [json_name = "token"];
  string RefreshToken            = 4 [json_name = "refresh"];
  bool IsSampleAddress      = 3 [json_name = "isSampleAddress"];
  string nowAddress        = 5 [json_name = "nowAddress"];
}

message Extend {
  string JumpTo = 1 [json_name = "jumpTo"];
  string Lang = 2 [json_name = "lang"];
  bool CanScan = 3 [json_name = "canScan"];
  bool ResolutionRatio = 4 [json_name = "resolutionRatio"];
}

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"];
  int32    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"];
  string    Sex             = 21 [json_name = "sex"];
  string    Title           = 22 [json_name = "title"];
  repeated Department   Departments          = 23 [json_name = "departments"];
  string    Ip              = 24 [json_name = "ip"];
  string    LoginDate       = 25 [json_name = "loginDate"];
  string    InvitationCode  = 26 [json_name = "invitationCode"];
  uint64    NowLogId        = 27 [json_name = "nowLogId"];
  bool      CanScan         = 28 [json_name = "canScan"];
  string    LeftDate        = 29 [json_name = "leftDate"];
  repeated  PositionUser  Positions = 30 [json_name = "positions"];
  string    Remark        = 31 [json_name = "remark"];
  string recentImg =32;
  repeated ClockUser clocks = 33;
  string mailAccount  = 34;
  string ICNum = 35 [json_name = "icNum"];
  string englishName  = 36;
  string Train = 37 [json_name = "train"];
  string Certificate = 38 [json_name = "certificate"];
  repeated trainVideo TrainVideos = 39 [json_name = "trainVideos"];
  Operator  operator        = 40;
  string    updatedAt       = 41;
  string SecurityCode = 42 [json_name = "securityCode"];
  string BlockAddr = 43 [json_name = "blockAddr"];
}

message UserInfoV2 {
  uint64    ID              = 1 ;
  string    Account         = 2 ;
  string    NickName        = 3 ;
  string    TelNum          = 4 ;
  string    Status          = 5 ;
  string    Avatar          = 6 ;
  string    CreateAt        = 7 ;
  string    RealName        = 8;
  string    IDNum           = 9;
  string    EnterDate       = 10;
  Extend    Extend          = 11;
  string    JobNum          = 12;
  string    recentImg       = 13;
  string    mailAccount     = 14;
  Operator  operator        = 15;
  string    updatedAt       = 16;
}

message RefreshTokenRequest {
  string    refreshToken    = 1 ;
  string    domain          = 2;
  string    ip              = 3 ;
}

message PositionUser {
  uint64            PositionID          = 1     [json_name = "positionID"];
  string            PositionName        = 2     [json_name = "positionName"];
  uint64            DepartmentId        = 3     [json_name = "departmentId"];
  string            DepartmentCode      = 4     [json_name = "departmentCode"];
  string            DepartmentName      = 5     [json_name = "departmentName"];
  uint64            UserId              = 6     [json_name = "userId"];
  string            UserName            = 7     [json_name = "userName"];
}
message JobNumGetInfoRequest{
  string jobNum = 1;
  string    domain          = 2;
}
message CreateClockDeviceRequest{
  string deviceNum =1;
  string deviceName =2;
  string deviceSite = 3;
}
message UpdateClockDeviceRequest{
  uint64 id = 1;
  string deviceNum =2;
  string deviceName =3;
  string deviceSite = 4;
}
message ClockDeviceResponse{
  uint64 id = 1;
}
message RemoveClockDeviceRequest{
  uint64 id = 1;
}
message ClockDeviceListRequest{
  uint64 id =1;
  string deviceSite = 2;
  string deviceNum = 3;
  string deviceName = 4;
  uint64 page = 5 ;
  uint64 pageSize = 6 ;
  repeated uint64 ids = 7;
}
message ClockDeviceListResponse{
  uint64 count =1;
  repeated ClockDeviceInfo data = 2;
}
message ClockUser{
  uint64 id       =1;
  string createdAt =2;
  string updatedAt =3;
  string deletedAt =4;
  uint64 deviceID  =5;
  uint64 userId    =6;
  uint64 status    =7;
  ClockDeviceInfo device = 8;
}
message ClockDeviceInfo {
  uint64 id = 1 ;
  string createAt = 2 ;
  string updateAt = 3 ;
  string deviceSite = 4;
  string deviceNum = 5;
  string deviceName = 6;
  uint64 userNum = 7;
  repeated ClockUserRel data = 8 ;
}

message ClockDeviceInfoResponse{
  uint64 count = 1;
  repeated ClockUserRel data = 2 ;
}
message ClockUserRel {
  uint64    id = 1 ;
  string    createAt = 2 ;
  string    updateAt = 3;
  string    nickName = 4 ;
  string    jobNum = 5 ;
  string icNum = 6;
}
message ClockDeviceInfoRequest{
  uint64 id = 1;
  uint64 page = 2 ;
  uint64 pageSize = 3 ;
}
message ClockBatchBindRequest{
  uint64 id = 1;
  repeated uint64 userId = 2;
  repeated uint64 deviceId =3;
}
message ClockBatchListResponse{
 repeated ClockUserDeviceBatch data = 1;
}
message ClockUserDeviceBatch{
  uint64 userId = 1;
  uint64 deviceId = 2;
  string JobNum = 3;
  string deviceNum = 4;
  string deviceName = 5;
  string workStatus = 6;
}
message ClockLogInfo{
  uint64 id = 1;
  string sn = 2;
  string userId =3;
  string recogType =4;
  string recogTime =5;
  float gender =6;
  string photo =7;
  float passStatus =8;
  string userName =9;
  float userType =10;
  string confidence =11;
  float reflectivity =12;
  string cardNumber =13;
  string passWord =14;
  string qrCode =15;
  string tel = 16;
  string reasonVisit = 17;
  string receiverTel = 18;
  uint64 numOfPeople = 19;
}
message ClockLogReq{
  uint64 id = 1;
  uint64 page = 2;
  uint64 pageSize = 3;
  string userName = 4;
  string recogType = 5;
  string deviceNum = 6;
  string recogDate = 7;
  uint64 userId = 8;
}
message ClockLogListResponse{
  repeated ClockLogInfo data =1;
  uint64 count = 2;
}
message SubmitInfoRequest{
  string firstName = 1;
  string lastName = 2;
  string email = 3;
  string company = 4;
  string phone = 5;
}

message CommonMsg{
  string msg = 1;
}
enum MsgType{
  UnknownMsgType = 0 ;//未知类型
  TextMsgType  = 1   ;//文本
  ImageMsgType = 2   ;//图片
  AudioMsgType = 3   ;//音频
  VideoMsgType = 4   ;//视频
  FileType     = 5   ;//文件
}
message ChatRecordData{
  int64 ID=1;
  string createdAt=2;
  string updatedAt=3;
  int64  deletedAt=4;
  string sessionId = 5; //会话UID
  int64 userId = 6; //用户ID
  string name = 7; //名称
  string avatar = 8; //头像
  MsgType msgType = 9; //消息类型
  string content = 10; //消息内容
  repeated ChatMediaData medias = 11; //媒体
  int32 waiterRead=12;//客服是否已读 1=已读 2=未读 (被任意客服读取过均为已读)
  int64 localStamp = 13; //本地时间戳 用户端的消息唯一值,用于用户本地的一些逻辑处理
  string domain =14;//域
}
message CreateChatRecordResp{
  ChatRecordData data=1;
  string msg=2;
}
message DeleteChatRecordRequest{
  int64 id=1; //二选一,数据id
  repeated int64 ids=2;//二选一,数据id列表
}
message GetChatRecordByIdRequest{
  int64 id=1; //数据id
}
message GetChatRecordListRequest{
  ChatRecordData query =1;
  int64 page=2;
  int64 pageSize=3;
  string where=4;
  string order=5;
}
message GetChatRecordListResp{
  repeated ChatRecordData list=1;
  int64 page=2;
  int64 pageSize=3;
  int64 Total=4;
}

message RegisterWaiterRequest{
  string origin=1; //来源
  int64  originId=2; //来源对应的用户ID
  string nickName=3; //名称
  string avatar=4; //头像
  string telNum=5; //电话
  string invitationCode=6; //邀请码
  string account=7;
}
message RegisterWaiterResp{
  int64 userId=1;
}

message ChatMediaData{
  int64 ID=1;
  string createdAt=2;
  string updatedAt=3;
  int64  deletedAt=4;
  string url = 5; //url
  string md5 = 6; //md5值
  string size = 7; //尺寸
  string ext = 8; //后缀格式
  string convText=9; //语音转文字内容
  int64 duration=10;//时长
}
message CreateChatMediaResp{
  ChatMediaData data=1;
  string msg=2;
}
message DeleteChatMediaRequest{
  int64 id=1; //二选一,数据id
  repeated int64 ids=2;//二选一,数据id列表
}
message GetChatMediaByIdRequest{
  int64 id=1; //数据id
}
message GetChatMediaListRequest{
  ChatMediaData query =1;
  int64 page=2;
  int64 pageSize=3;
  string where=4;
  string order=5;
}
message GetChatMediaListResp{
  repeated ChatMediaData list=1;
  int64 page=2;
  int64 pageSize=3;
  int64 Total=4;
}
message GetChatUserListRequest2{
  int64 page=1;
  int64 pageSize=2;
  string where=3;
  string name=4;
  repeated int64 userIdIn=5;
}
message ChatUser2{
  int64 userId=1;
  string name=2;
  string avatar=3;
  string origin=4;
  string originId=5;
}
message GetChatUserListResp2{
  repeated ChatUser2 list=1;
  int64 page=2;
  int64 pageSize=3;
  int64 Total=4;
  string where=5;
}
message ChatAutoReplyRulerData{
  int64 ID = 1; //
  string createdAt = 2; //
  string updatedAt = 3; //
  int64 deletedAt = 4; //
  string title = 5; //标题
  string ruler = 6; //规则内容
  int32 status = 7; //规则状态: 1=启用 2=禁用
  string response =8; //回复内容
}

message CreateChatAutoReplyRulerResp{
  ChatAutoReplyRulerData data=1;
  string msg=2;
}
message DeleteChatAutoReplyRulerRequest{
  int64 id=1; //二选一,数据id
  repeated int64 ids=2;//二选一,数据id列表
}
message GetChatAutoReplyRulerByIdRequest{
  int64 id=1; //数据id
}
message GetChatAutoReplyRulerListRequest{
  ChatAutoReplyRulerData query =1;
  int64 page=2;
  int64 pageSize=3;
  string where=4;
  string order=5;
}
message GetChatAutoReplyRulerListResp{
  repeated ChatAutoReplyRulerData list=1;
  int64 page=2;
  int64 pageSize=3;
  int64 Total=4;
}
message ChatUserData{
  int64 ID = 1; //
  string createdAt = 2; //
  string updatedAt = 3; //
  int64 deletedAt = 4; //
  string nickName = 5; //昵称
  string account = 6; //账号
  int32 role = 7; //聊天角色 1=用户 2=客服
  string origin = 8; //数据来源
  int64 originId = 9; //数据来源对应的用户ID
  string avatar = 10; //头像

}

message CreateChatUserResp{
  ChatUserData data=1;
  string msg=2;
}
message DeleteChatUserRequest{
  int64 id=1; //二选一,数据id
  repeated int64 ids=2;//二选一,数据id列表
}
message GetChatUserByIdRequest{
  int64 id=1; //数据id
}
message GetChatUserListRequest{
  ChatUserData query =1;
  int64 page=2;
  int64 pageSize=3;
  string where=4;
  string order=5;
}
message GetChatUserListResp{
  repeated ChatUserData list=1;
  int64 page=2;
  int64 pageSize=3;
  int64 Total=4;
}