修改冲突

This commit is contained in:
蒋海成 2025-05-27 10:49:22 +08:00
commit c1978c9ee7
39 changed files with 34110 additions and 3809 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,8 @@
syntax = "proto3";
package account;
import "github.com/mwitkow/go-proto-validators@v0.3.2/validator.proto";
//import "descriptor.proto";
//import "validator.proto";
option go_package = "./;account";
@ -25,11 +27,25 @@ service Account {
rpc Login (LoginRequest) returns (TokenInfo) {}
rpc RefreshToken (RefreshTokenRequest) returns (TokenInfo) {} //token
rpc Logout (DecryptJwtRequest) returns (CommonResponse) {}
rpc WxApp (WxAppRequest) returns (WxAppResponse) {}//
rpc WxUserInfo (WxUserOrCreateRequest) returns (WxUserResponse) {}//
rpc WxUserCreate (WxUserOrCreateRequest) returns (WxUserResponse) {}//
rpc WxUserUpdate (WxUserUpdateRequest) returns (WxUserResponse) {}//
rpc WxGetOpenIdByCode (WxGetOpenIdByCodeRequest) returns (WxGetOpenIdByCodeResponse) {}//
rpc WxBoxLogin (WxGetOpenIdByCodeRequest) returns (WxBoxUserInfo) {}//
rpc WxBoxUserInfoByOpenId (WxBoxUserInfoRequest) returns (WxBoxUserInfo) {}//
rpc WxBoxTelNumByCode (WxGetOpenIdByCodeRequest) returns (WxBoxTelNumByCodeResponse) {}//
rpc WxBoxUpdateUser (WxBoxUserInfo) returns (CommonResponse) {}//
rpc WxBoxCreateUser (WxBoxUserInfo) returns (CommonResponse) {}//
rpc FddCreateUser (FddCreateUserRequest) returns (CommonResponse) {}//
rpc FddUpdateUser (FddCreateUserRequest) returns (CommonResponse) {}//
rpc FddRemoveUser (FddRemoveUserRequest) 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 Register (RegistRequest) returns (RequestStatus) {}
rpc RegisterOrExist (RegistRequest) returns (RequestStatus) {}
rpc SendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {} //
rpc SendCustomMsg (SendCustomMsgRequest) returns (SendMsgStatusResponse) {}//
rpc SendExCustomMsg (SendCustomMsgRequest) returns (SendMsgStatusResponse) {}//
@ -39,161 +55,103 @@ service Account {
rpc UpdateTelNum (SendNewTelNumMsgRequest) returns (SendMsgStatusResponse) {}//
rpc Authentication (AuthenticationRequest) returns (RequestStatus) {}
rpc DecryptJwt (DecryptJwtRequest) returns (DecryptJwtResponse) {}//
rpc Info (InfoRequest) returns (UserInfoResponse) {}
rpc Info (InfoRequest) returns (InfoResponse) {}
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 WriteOff (WriteOffRequest) returns (RemoveResponse) {} //
rpc WriteOffApp (RemoveRequest) returns (RemoveResponse) {} //app用户注销
rpc WriteOffInfo (WriteOffApproveRequest) returns (WriteOffRequest) {} //
rpc FindWriteOffList (WriteOffListRequest) returns (WriteOffListResponse) {} //
rpc WriteOffUpdate (WriteOffApproveRequest)returns(RemoveResponse){} //
rpc Update (UpdateRequest) returns (UpdateResponse) {}
rpc PrivacyInfo (PrivacyInfoRequest) returns (AccountInfo) {}
rpc UsersByTel (UsersByTelRequest) returns (ListResponse) {}
rpc UserByTel (UserByTelRequest) returns (UserInfoResponse) {}
rpc UserByTel (UserByTelRequest) returns (InfoResponse) {}
rpc CheckBeforeRegister (CheckBeforeRegisterRequest) returns (CommonResponse) {}
rpc OnlySendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {} //
rpc OnlyCheckMsg (CheckMsgRequest) returns (SendMsgStatusResponse) {}//
rpc CreateClockDevice(CreateClockDeviceRequest) returns(ClockDeviceResponse){} //
rpc UpdateClockDevice(UpdateClockDeviceRequest) returns(ClockDeviceResponse){} //
rpc RemoveClockDevice(RemoveClockDeviceRequest) returns(ClockDeviceResponse){} //
rpc ClockDeviceList(ClockDeviceListRequest) returns(ClockDeviceListResponse){} //
rpc ClockDeviceInfo(ClockDeviceInfoRequest) returns(ClockDeviceInfoResponse){} //
rpc ClockDeviceSingleUntie(RemoveClockDeviceRequest) returns(ClockDeviceResponse){} //
rpc ClockDeviceBatchBind(ClockBatchListResponse) returns(ClockDeviceInfoResponse){} //
rpc ClockDeviceBatchUntie(ClockBatchBindRequest) returns(ClockDeviceInfoResponse){} //
rpc ClockDeviceBatchList(ClockBatchBindRequest) returns(ClockBatchListResponse){} //
rpc UpdateDeviceRelevance(ClockUserDeviceBatch) returns(ClockDeviceResponse){} //
rpc MailAccountByNickName(MailAccountByNickNameRequest) returns(MaiAccountResponse){} //
rpc CreateMaiAccount(CreateMaiAccountRequest) returns(CommonResponse){} //
rpc CreateClockLog(ClockLogInfo) returns(ClockDeviceResponse){} //
rpc SendClockInWechat(SendClockInWechatRequest) returns(CommonResponse){} //
rpc FindClockLogList(ClockLogReq) returns(ClockLogListResponse){} //
rpc SendStrangerClockInWechat(SendClockInWechatRequest) returns(CommonResponse){} //
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 CreateChainAccount(CommonRequest) returns (CreateChainAccountResponse) {}//
rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} // --
rpc UpdateLanguage(UpdateLanguageRequest) returns (UpdateLanguageResponse) {}// 使
rpc GenerateSliderCaptcha(GenerateSliderCaptchaRequest) returns (GenerateSliderCaptchaResponse) {}// +
rpc VerifySliderCaptcha(VerifySliderCaptchaRequest) returns (VerifySliderCaptchaResponse) {}//
rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} // --
rpc VerifySliderStatus(VerifySliderStatusRequest) returns (VerifySliderStatusResponse) {}//
rpc SampleAccount (SampleAccountRequest) returns (SampleAccountResponse) {} //
rpc LoginAndSqueezeOther (LoginRequest) returns (TokenInfo) {} //
rpc QueryPersonnelWithTheSameName (QueryPersonnelWithTheSameNameRequest) returns (QueryPersonnelWithTheSameNameResponse) {}//
rpc UsersByJobNum (UsersByJobNumRequest) returns (ListResponse) {}
//
rpc IsSamePerson(IsSamePersonRequest)returns(IsSamePersonResponse){}//
rpc CreateRealNameOrPassPort(UserInfo)returns(CommonResponse){}//
rpc FddCreateUserV2(FddCreateUserRequest) returns(CommonResponse){}//
rpc FddUserFindByUserId(UserInfo)returns(FddInfo){}//userid获取法大大信息
rpc UserInfoById(InfoRequest)returns(UserInfo){}//userid获取实名信息
}
message VerifySliderStatusRequest {
string nonceStr = 1;
message CheckBeforeRegisterRequest{
string domain = 1;
string jobNum = 2;
string telNum = 3;
}
message VerifySliderStatusResponse {
string nonceStr = 1;
int32 status = 2;
message SampleAccountRequest{
string domain = 1;
string password = 2;
string code = 3;
string from = 4;
string telNum = 5;
}
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 SampleAccountResponse{
bool isNowAlreadyLogin = 1;
uint32 num = 2;// 线
}
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 LoginAndSqueezeOtherResponse{
string needDetectImageUrl = 1;
string recentImageUrl = 2;
}
message GenerateSliderCaptchaRequest {
uint64 canvasWidth = 1;
uint64 canvasHeight = 2;
uint64 blockWidth = 3;
uint64 blockHeight = 4;
uint64 blockRadius = 5;
uint64 place = 6;
message IsSamePersonResponse{
bool isPass = 1;
uint32 rate = 2;//
string message = 3;//
}
message CheckRealNameResponse{
uint64 id =1;
string status =2;
message IsSamePersonRequest{
string needDetectImageUrl = 1;
string recentImageUrl = 2;
}
message CheckRealNameRequest{
uint64 id = 1;
bool pass = 2;
string notPassRemarks = 3;
message UpdatePassportStatusRequest{
uint32 ID = 1;
uint32 status = 2;
}
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;
}
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 CreateChainAccountResponse {
string account = 1 ;
string men = 2 ;
string publicKey = 3 ;
}
message UsersByJobNumRequest{
string domain = 1 ;
@ -227,6 +185,7 @@ message ListV2Request {
repeated string departmentNames =16 ;
repeated uint32 positionIds =17 ;
repeated uint32 departmentIds =18 ;
uint32 fatherDepartmentId =19 ;
}
message SendClockInWechatRequest {
@ -256,13 +215,19 @@ message MaiAccountResponse {
string mailAccount = 2;
}
message FddRemoveUserRequest {
uint32 wxUserId = 2;
}
message FddCreateUserRequest {
string openid = 1 ;
uint32 wxUserId = 2;
//string UserId = 3;
uint64 UserId = 3;
string customerId = 4;
bool isVerify = 5;
string transactionNo = 6;
uint32 status = 7;
string idType = 8;
}
message WxBoxUserInfoRequest {
@ -298,6 +263,8 @@ message FddInfo {
string customerId = 2 ;
bool isVerify = 3 ;
string transactionNo = 4;
uint32 status = 5;
string idType =6;
}
message UserInfo {
@ -314,10 +281,13 @@ message UserInfo {
string realIDImgB = 18;
string realNameIDName = 19;
string video = 20;
string idType = 21; //0
Passport passport = 22; //
}
message CommonRequest {
uint64 ID = 1 [json_name = "ID"];
string from = 2 ;
}
message WxAppRequest {
@ -418,7 +388,6 @@ message SendMsgRequest {
uint32 mId = 5;
string scope = 6; //
string zone = 7; //
string nonceStr = 8;
}
message SendCustomMsgRequest {
@ -437,7 +406,6 @@ message CheckMsgRequest {
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 {
@ -488,9 +456,31 @@ 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"];
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"];
string InvitationCode = 24 [json_name = "invitationCode"];
string LeftDate = 25 [json_name = "leftDate"];
string Remark = 26 [json_name = "remark"];
string RecentImg = 27 [json_name = "recentImg"];
string ICNum = 28 [json_name = "icNum"];
string Train = 29 [json_name = "train"];
string Certificate = 30 [json_name = "certificate"];
repeated trainVideo TrainVideos = 31 [json_name = "trainVideos"];
Operator operator = 32;
string SecurityCode = 33 [json_name = "securityCode"];
UserExtend userExtend = 34 ;
}
message Operator {
@ -523,6 +513,18 @@ message ListRequest {
string telNum = 6;
string startEnterDate = 7;
string endEnterDate = 8;
string nickName = 9;
uint32 isReal = 10;
uint32 isMainLand = 11;
string fromCode = 12;
string bankName = 13;
string bankNo = 14;
uint32 sex = 15;
string startRealTime = 16;
string endRealTime = 17;
string endCreatedAt = 18;
string startCreatedAt = 19;
string realName = 20;
}
message ListResponse {
@ -550,6 +552,7 @@ message DecryptJwtResponse {
string Account = 3 [json_name = "account"];
string NickName = 4 [json_name = "nickName"];
bool IsOffline = 5 [json_name = "isOffline"];
string offlineCode = 6 ;//线
}
message DecryptJwtRequest {
@ -575,23 +578,68 @@ message RequestStatus {
}
message RegistRequest {
string domain = 1;
string telNum = 2;
string code = 3;
string address = 4;
string telAreaCode = 5;
string language = 6;
string nickName = 7;
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"];
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"]; //
string RecentImg = 20;
string RealIDImgA = 21;
string RealIDImgB = 22;
string Video = 23;
string ICNum = 24;
string Train = 25;
string Certificate = 26;
string Source =27;
Operator operator = 28;
string Status =29;
string BlockAddr = 30;
Passport passport = 31; //
string leftDate = 32; //
UserExtend UserExtend= 33; //
}
message UserExtend {
string id = 1;
string uuid = 2;
string userID = 3;
string address = 4;
string bankName = 5;
string bankNo = 6;
string zone = 7;
uint32 isMainland = 8;
uint32 isReal = 9; //
string fromCode = 10; // 99999
string realTime = 11; //
string realName = 12; //
string idType = 13; //
string idNo = 14; //
}
message Passport {
string idNum = 1; //
string realIDImgA = 2;//
string realIDImgB = 3;//
string name = 4; //
string idType = 5; // "0" "1" "B" "C"
}
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 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;
string from = 7 [json_name = "from"]; // PC h5
string zone = 8;
}
message TokenInfo {
@ -621,7 +669,7 @@ message AccountInfo {
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 Status = 6 [json_name = "status"];
string Avatar = 7 [json_name = "avatar"];
string CreateAt = 8 [json_name = "createAt"];
uint64 RealNameID = 9 [json_name = "realNameID"];
@ -636,7 +684,7 @@ message AccountInfo {
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"];
uint64 Sex = 21 [json_name = "sex"];
string Title = 22 [json_name = "title"];
repeated Department Departments = 23 [json_name = "departments"];
string Ip = 24 [json_name = "ip"];
@ -659,6 +707,8 @@ message AccountInfo {
string updatedAt = 41;
string SecurityCode = 42 [json_name = "securityCode"];
string BlockAddr = 43 [json_name = "blockAddr"];
string Language = 44 [json_name = "language"];
UserExtend userExtend = 45 ;
}
message UserInfoV2 {
@ -817,4 +867,62 @@ message ClockLogReq{
message ClockLogListResponse{
repeated ClockLogInfo data =1;
uint64 count = 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 UpdateLanguageRequest {
string domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
uint64 ID = 2;
string language = 3;
}
message UpdateLanguageResponse {
uint64 ID = 1;
string telNum = 2;
string language = 3;
}
message GenerateSliderCaptchaRequest {
uint64 canvasWidth = 1;
uint64 canvasHeight = 2;
uint64 blockWidth = 3;
uint64 blockHeight = 4;
uint64 blockRadius = 5;
uint64 place = 6;
}
message GenerateSliderCaptchaResponse {
string nonceStr = 1;
string canvasSrc = 2;
string blockSrc = 3;
uint64 blockY = 4;
uint64 faceY = 5;
uint64 blockX = 6;
}
message VerifySliderCaptchaRequest {
string nonceStr = 1;
float blockX = 2;
}
message VerifySliderCaptchaResponse {
string nonceStr = 1;
}
message VerifySliderStatusRequest {
string nonceStr = 1;
}
message VerifySliderStatusResponse {
string nonceStr = 1;
int32 status = 2;
}

View File

@ -17,65 +17,28 @@ var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *VerifySliderStatusRequest) Validate() error {
func (this *CheckBeforeRegisterRequest) Validate() error {
return nil
}
func (this *VerifySliderStatusResponse) Validate() error {
func (this *SampleAccountRequest) Validate() error {
return nil
}
func (this *SendNationMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.TelNum == "" {
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70001`))
}
func (this *SampleAccountResponse) Validate() error {
return nil
}
func (this *VerifySliderCaptchaResponse) Validate() error {
func (this *LoginAndSqueezeOtherResponse) Validate() error {
return nil
}
func (this *VerifySliderCaptchaRequest) Validate() error {
func (this *IsSamePersonResponse) Validate() error {
return nil
}
func (this *GenerateSliderCaptchaResponse) Validate() error {
func (this *IsSamePersonRequest) Validate() error {
return nil
}
func (this *GenerateSliderCaptchaRequest) Validate() error {
func (this *UpdatePassportStatusRequest) Validate() error {
return nil
}
func (this *CheckRealNameResponse) Validate() error {
return nil
}
func (this *CheckRealNameRequest) Validate() error {
return nil
}
func (this *UserListResponse) Validate() error {
for _, item := range this.UserList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("UserList", err)
}
}
}
return nil
}
func (this *UserListInfo) Validate() error {
return nil
}
func (this *UserListRequest) Validate() error {
return nil
}
func (this *UserInfoResponse) Validate() error {
return nil
}
func (this *RealNameResponse) Validate() error {
return nil
}
func (this *RealNameRequest) Validate() error {
return nil
}
func (this *RegisterResponse) Validate() error {
func (this *CreateChainAccountResponse) Validate() error {
return nil
}
func (this *UsersByJobNumRequest) Validate() error {
@ -114,6 +77,9 @@ func (this *CreateMaiAccountRequest) Validate() error {
func (this *MaiAccountResponse) Validate() error {
return nil
}
func (this *FddRemoveUserRequest) Validate() error {
return nil
}
func (this *FddCreateUserRequest) Validate() error {
return nil
}
@ -146,6 +112,11 @@ func (this *FddInfo) Validate() error {
return nil
}
func (this *UserInfo) Validate() error {
if this.Passport != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Passport); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Passport", err)
}
}
return nil
}
func (this *CommonRequest) Validate() error {
@ -280,6 +251,31 @@ func (this *RemoveResponse) Validate() error {
return nil
}
func (this *UpdateRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.Extend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
}
}
for _, item := range this.TrainVideos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("TrainVideos", err)
}
}
}
if this.Operator != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Operator); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", err)
}
}
if this.UserExtend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.UserExtend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("UserExtend", err)
}
}
return nil
}
func (this *Operator) Validate() error {
@ -346,6 +342,44 @@ func (this *RequestStatus) Validate() error {
return nil
}
func (this *RegistRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.NickName == "" {
return github_com_mwitkow_go_proto_validators.FieldError("NickName", fmt.Errorf(`70005`))
}
if !(len(this.NickName) < 20) {
return github_com_mwitkow_go_proto_validators.FieldError("NickName", fmt.Errorf(`70005`))
}
if !(len(this.Password) > 5) {
return github_com_mwitkow_go_proto_validators.FieldError("Password", fmt.Errorf(`70007`))
}
if this.Extend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
}
}
if this.Operator != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Operator); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", err)
}
}
if this.Passport != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Passport); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Passport", err)
}
}
if this.UserExtend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.UserExtend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("UserExtend", err)
}
}
return nil
}
func (this *UserExtend) Validate() error {
return nil
}
func (this *Passport) Validate() error {
return nil
}
func (this *LoginRequest) Validate() error {
@ -407,6 +441,11 @@ func (this *AccountInfo) Validate() error {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", err)
}
}
if this.UserExtend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.UserExtend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("UserExtend", err)
}
}
return nil
}
func (this *UserInfoV2) Validate() error {
@ -522,3 +561,39 @@ func (this *ClockLogListResponse) Validate() error {
}
return nil
}
func (this *SendNationMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.TelNum == "" {
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70001`))
}
return nil
}
func (this *UpdateLanguageRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *UpdateLanguageResponse) Validate() error {
return nil
}
func (this *GenerateSliderCaptchaRequest) Validate() error {
return nil
}
func (this *GenerateSliderCaptchaResponse) Validate() error {
return nil
}
func (this *VerifySliderCaptchaRequest) Validate() error {
return nil
}
func (this *VerifySliderCaptchaResponse) Validate() error {
return nil
}
func (this *VerifySliderStatusRequest) Validate() error {
return nil
}
func (this *VerifySliderStatusResponse) Validate() error {
return nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,820 @@
/*
* 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@v0.3.2/validator.proto";
option go_package = "./;accountFiee";
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) {}//
}
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;
}
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;
}

View File

@ -0,0 +1,524 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api/accountFiee/accountFiee.proto
package accountFiee
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
regexp "regexp"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *VerifySliderStatusRequest) Validate() error {
return nil
}
func (this *VerifySliderStatusResponse) Validate() error {
return nil
}
func (this *SendNationMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.TelNum == "" {
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70001`))
}
return nil
}
func (this *VerifySliderCaptchaResponse) Validate() error {
return nil
}
func (this *VerifySliderCaptchaRequest) Validate() error {
return nil
}
func (this *GenerateSliderCaptchaResponse) Validate() error {
return nil
}
func (this *GenerateSliderCaptchaRequest) Validate() error {
return nil
}
func (this *CheckRealNameResponse) Validate() error {
return nil
}
func (this *CheckRealNameRequest) Validate() error {
return nil
}
func (this *UserListResponse) Validate() error {
for _, item := range this.UserList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("UserList", err)
}
}
}
return nil
}
func (this *UserListInfo) Validate() error {
return nil
}
func (this *UserListRequest) Validate() error {
return nil
}
func (this *UserInfoResponse) Validate() error {
return nil
}
func (this *RealNameResponse) Validate() error {
return nil
}
func (this *RealNameRequest) Validate() error {
return nil
}
func (this *RegisterResponse) Validate() error {
return nil
}
func (this *UsersByJobNumRequest) Validate() error {
return nil
}
func (this *QueryPersonnelWithTheSameNameRequest) Validate() error {
return nil
}
func (this *QueryPersonnelWithTheSameNameResponse) Validate() error {
return nil
}
func (this *ListV2Request) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *SendClockInWechatRequest) Validate() error {
return nil
}
func (this *MailAccountByNickNameRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.NickName == "" {
return github_com_mwitkow_go_proto_validators.FieldError("NickName", fmt.Errorf(`70005`))
}
if !(len(this.NickName) < 20) {
return github_com_mwitkow_go_proto_validators.FieldError("NickName", fmt.Errorf(`70005`))
}
return nil
}
func (this *CreateMaiAccountRequest) Validate() error {
return nil
}
func (this *MaiAccountResponse) Validate() error {
return nil
}
func (this *FddCreateUserRequest) Validate() error {
return nil
}
func (this *WxBoxUserInfoRequest) Validate() error {
return nil
}
func (this *WxGetOpenIdByCodeRequest) Validate() error {
return nil
}
func (this *WxGetOpenIdByCodeResponse) Validate() error {
return nil
}
func (this *WxBoxTelNumByCodeResponse) Validate() error {
return nil
}
func (this *WxBoxUserInfo) Validate() error {
if this.User != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.User); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("User", err)
}
}
if this.Fdd != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Fdd); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Fdd", err)
}
}
return nil
}
func (this *FddInfo) Validate() error {
return nil
}
func (this *UserInfo) Validate() error {
return nil
}
func (this *CommonRequest) Validate() error {
return nil
}
func (this *WxAppRequest) Validate() error {
return nil
}
func (this *WxAppResponse) Validate() error {
return nil
}
func (this *WxUserUpdateRequest) Validate() error {
return nil
}
func (this *WxUserOrCreateRequest) Validate() error {
if this.OpenID == "" {
return github_com_mwitkow_go_proto_validators.FieldError("OpenID", fmt.Errorf(`缺少openid`))
}
if this.GhID == "" {
return github_com_mwitkow_go_proto_validators.FieldError("GhID", fmt.Errorf(`缺少参数ghid`))
}
return nil
}
func (this *WxUserResponse) Validate() error {
return nil
}
func (this *LoginLogsResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *LoginLog) Validate() error {
return nil
}
func (this *OnlineLogByIdRequest) Validate() error {
return nil
}
func (this *LoginInfosByUserIdRequest) Validate() error {
return nil
}
func (this *SendNewTelNumMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *UserByTelRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *CommonResponse) Validate() error {
return nil
}
func (this *UsersByTelRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *ListByIDsRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *SendMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
var _regex_SendCustomMsgRequest_TelNum = regexp.MustCompile(`^1\d{10}$`)
func (this *SendCustomMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if !_regex_SendCustomMsgRequest_TelNum.MatchString(this.TelNum) {
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70002`))
}
return nil
}
func (this *CheckMsgRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if this.Code == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Code", fmt.Errorf(`70003`))
}
return nil
}
func (this *SendMsgStatusResponse) Validate() error {
return nil
}
func (this *RemoveRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
if !(this.ID > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("ID", fmt.Errorf(`70004`))
}
return nil
}
func (this *WriteOffRequest) Validate() error {
return nil
}
func (this *WriteOffListRequest) Validate() error {
return nil
}
func (this *WriteOffApproveRequest) Validate() error {
return nil
}
func (this *WriteOffListResponse) Validate() error {
for _, item := range this.WriteOffList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("WriteOffList", err)
}
}
}
return nil
}
func (this *RemoveResponse) Validate() error {
return nil
}
func (this *UpdateRequest) Validate() error {
return nil
}
func (this *Operator) Validate() error {
return nil
}
func (this *TrainVideo) Validate() error {
return nil
}
func (this *UpdateResponse) Validate() error {
return nil
}
func (this *PrivacyInfoRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *ListRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *ListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *InfoRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *InfoResponse) Validate() error {
if this.Info != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Info); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Info", err)
}
}
return nil
}
func (this *DecryptJwtResponse) Validate() error {
return nil
}
func (this *DecryptJwtRequest) Validate() error {
return nil
}
func (this *CheckPwdRequest) Validate() error {
return nil
}
func (this *AuthenticationRequest) Validate() error {
if !(len(this.IDNum) == 18) {
return github_com_mwitkow_go_proto_validators.FieldError("IDNum", fmt.Errorf(`70006`))
}
return nil
}
func (this *RequestStatus) Validate() error {
return nil
}
func (this *RegistRequest) Validate() error {
return nil
}
func (this *LoginRequest) Validate() error {
if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
}
return nil
}
func (this *TokenInfo) Validate() error {
if this.AccountInfo != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.AccountInfo); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AccountInfo", err)
}
}
return nil
}
func (this *Extend) Validate() error {
return nil
}
func (this *Department) Validate() error {
return nil
}
func (this *AccountInfo) Validate() error {
if this.Extend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
}
}
for _, item := range this.Departments {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Departments", err)
}
}
}
for _, item := range this.Positions {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Positions", err)
}
}
}
for _, item := range this.Clocks {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Clocks", err)
}
}
}
for _, item := range this.TrainVideos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("TrainVideos", err)
}
}
}
if this.Operator != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Operator); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", err)
}
}
return nil
}
func (this *UserInfoV2) Validate() error {
if this.Extend != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
}
}
if this.Operator != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Operator); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", err)
}
}
return nil
}
func (this *RefreshTokenRequest) Validate() error {
return nil
}
func (this *PositionUser) Validate() error {
return nil
}
func (this *JobNumGetInfoRequest) Validate() error {
return nil
}
func (this *CreateClockDeviceRequest) Validate() error {
return nil
}
func (this *UpdateClockDeviceRequest) Validate() error {
return nil
}
func (this *ClockDeviceResponse) Validate() error {
return nil
}
func (this *RemoveClockDeviceRequest) Validate() error {
return nil
}
func (this *ClockDeviceListRequest) Validate() error {
return nil
}
func (this *ClockDeviceListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *ClockUser) Validate() error {
if this.Device != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Device); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Device", err)
}
}
return nil
}
func (this *ClockDeviceInfo) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *ClockDeviceInfoResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *ClockUserRel) Validate() error {
return nil
}
func (this *ClockDeviceInfoRequest) Validate() error {
return nil
}
func (this *ClockBatchBindRequest) Validate() error {
return nil
}
func (this *ClockBatchListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *ClockUserDeviceBatch) Validate() error {
return nil
}
func (this *ClockLogInfo) Validate() error {
return nil
}
func (this *ClockLogReq) Validate() error {
return nil
}
func (this *ClockLogListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}

File diff suppressed because it is too large Load Diff

8730
api/payment/payment.pb.go Normal file

File diff suppressed because it is too large Load Diff

743
api/payment/payment.proto Normal file
View File

@ -0,0 +1,743 @@
syntax = "proto3";
package payment;
option go_package = "./payment";
//import "pb/descriptor.proto";
service PaymentCent{
//
rpc CreatePay(CreatePayRequest) returns (CreatePayResponse); //
rpc NotifyPay(NotifyPayRequest) returns (NotifyPayResponse); //
rpc QueryPayByOutTradeNo(PayQueryRequest) returns (PayQueryResponse);//
rpc QueryExportPay(ExportPayRequest) returns (ExportPayResponse); //
rpc CreateRefund(CreateRefundRequest) returns (CreateRefundResponse); // 退
rpc StripeGermanyWebhook(GetCheckoutWebhookRequest) returns(GetCheckoutWebhookResponse){};// stripe支付回调,
rpc AliCommonWebhook(NotifyPayRequest) returns (NotifyPayResponse){}; //
rpc WechatFengLianWebhook(NotifyPayRequest) returns (NotifyPayResponse){}; //
rpc AntomWebhook(AntomNotifyPayRequest) returns (AntomNotifyPayResponse){}; // Antom支付回调
rpc QueryAntomPayByCheckoutSessionId(AntomPayQueryRequest) returns (AntomPayQueryResponse){}; // checkoutSessionIds查询支付情况
// ==========
// stripe支付
rpc CreateStripeCheckoutSession(CreateStripeCheckoutSessionRequest) returns (CreateStripeCheckoutSessionResponse){}; //
// rpc CommonCheckoutWebhook(GetCheckoutWebhookRequest) returns(GetCheckoutWebhookResponse){}; // ,
//
rpc AliWapPay(AliWapPayRequest) returns (AliWapPayResponse) {}; // ali网页支付
rpc AliAppPay(AliAppPayRequest) returns (AliAppPayResponse) {}; // aliApp支付
rpc AliNativePay(AliNativePayRequest) returns (AliNativePayResponse) {}; // aliApp当面支付
rpc AliPcWabPay(AliPcWabPayRequest) returns (AliPcWabPayResponse) {}; // ali电脑网页支付
rpc AliReFund(AliReFundRequest) returns (AliReFundResponse) {}; // ali退款
rpc AliNotify(AliNotifyRequest) returns (AliNotifyResponse) {}; // ali回调
rpc AliQueryByOutTradeNo(AliQueryByOutTradeNoRequest) returns (AliQueryByOutTradeNoResponse) {}; // ali查询订单
rpc AliRefundQueryByOutTradeNo(AliRefundQueryByOutTradeNoRequest) returns (AliRefundQueryByOutTradeNoResponse) {}; // ali查询退款订单
//
rpc WechatJsApiPay(WechatJsApiPayRequest) returns (WechatJsApiPayResponse) {}; // jsapi +
rpc WechatJsApiQueryByOutTradeNo(WechatJsApiQueryByOutTradeNoRequest) returns (WechatJsApiQueryByOutTradeNoResponse) {}; // outTrandeNo jsapi
rpc GetPayByOutTradeNo(GetPayByOutTradeNoRequest) returns (GetPayByOutTradeNoResponse) {}; // outTrandeNo id
rpc WechatJsApiRefunds(WechatJsApiRefundsRequest) returns (WechatJsApiRefundsResponse) {}; //
rpc SetPayOk(WechatPayOkRequest) returns (CommonResponse) {}; //
rpc WechatAppPay(WechatAppPayRequest) returns (WechatAppPayResponse) {}; // app +
rpc WechatAppQueryByOutTradeNo(WechatAppQueryByOutTradeNoRequest) returns (WechatAppQueryByOutTradeNoResponse) {}; // outTrandeNo App
rpc WechatNativePay(WechatNativePayRequest) returns (WechatNativePayResponse) {}; // native +
rpc WechatNativeQueryByOutTradeNo(WechatNativeQueryByOutTradeNoRequest) returns (WechatNativeQueryByOutTradeNoResponse) {}; // outTrandeNo App
rpc WechatRefundQueryByOutRefundNo(WechatRefundQueryByOutRefundNoRequest) returns (WechatRefundQueryByOutRefundNoResponse) {}; // wx查询退款订单
rpc WechatH5Pay(WechatH5PayRequest) returns (WechatH5PayResponse) {}; // H5 +
rpc WechatH5QueryByOutTradeNo(WechatH5QueryByOutTradeNoRequest) returns (WechatH5QueryByOutTradeNoResponse) {}; // outTrandeNo H5
}
message AntomPayQueryRequest {
repeated string checkoutSessionIds = 1 [json_name = "checkoutSessionIds"];
}
message AntomPayQueryResponse {
repeated PaymentOrderInfo infos = 1 [json_name = "infos"];
}
message AntomNotifyPayRequest {
string notifyType = 1 [json_name = "notifyType"];
string requestId = 2 [json_name = "requestId"];
string paymentId = 3 [json_name = "paymentId"];
string paymentTime = 4 [json_name = "paymentTime"];
string resultStatus = 5 [json_name = "resultStatus"];
string resultMessage = 6 [json_name = "resultMessage"];
string channelCode = 7 [json_name = "channelCode"];
}
message AntomNotifyPayResponse {
string status = 1 [json_name = "status"];
string outTradeNo = 2 [json_name = "outTradeNo"];
}
message CreatePayRequest {
string postUrl = 1 [json_name = "postUrl"]; //
string subject = 2 [json_name = "subject"]; //
string productUUID = 3 [json_name = "productUUID"]; // uid
string productName = 4 [json_name = "productName"]; //
string productImg = 5 [json_name = "productImg"]; //
string productDescription = 6 [json_name = "productDescription"]; //
string quitUrl = 7 [json_name = "quitUrl"]; // 退url
string notifyUrl = 8 [json_name = "notifyUrl"]; // url
string returnUrl = 9 [json_name = "returnUrl"]; // url
string outTradeNo = 10 [json_name = "outTradeNo"]; //
string channelTradeNo = 11 [json_name = "channelTradeNo"]; //
string checkSessionId = 12 [json_name = "checkSessionId"]; // stripe的支付会话id
int64 amount = 13 [json_name = "amount"]; //
string currency = 14 [json_name = "currency"]; //
string payee = 15 [json_name = "payee"]; //
string channelType = 16 [json_name = "channelType"]; // alipay- wxpay- stripe-Stripe支付
string platform = 17 [json_name = "platform"]; // app还是h5还是jsapi还是wap
string domain = 18 [json_name = "domain"]; // 使
string businessType = 19 [json_name = "businessType"]; // mq发送
string language = 20 [json_name = "language"]; //
string clientIp = 21 [json_name = "clientIp"];
string openID = 22 [json_name = "openID"]; //
int32 timeExpire = 23 [json_name = "timeExpire"]; //
string locale = 24 [json_name = "locale"]; // stripe参数
}
message CreatePayResponse {
string url = 1 [json_name = "url"];
string logRecordID = 2 [json_name = "log_record_ID"];
string msg = 3 [json_name="msg"];
string appid = 4 [json_name = "appid"];
string timeStamp = 5 [json_name = "timeStamp"];
string package = 6 [json_name = "package"];
string signType = 7 [json_name = "signType"];
string nonceStr = 8 [json_name = "nonceStr"];
string paySign = 9 [json_name = "paySign"];
string prepayId = 10 [json_name = "prepayId"];
string partnerId = 11 [json_name = "partnerId"];
string checkoutSessionId = 12 [json_name = "checkoutSessionId"];
}
message CreateRefundRequest {
string postUrl = 1 [json_name = "postUrl"]; //
string subject = 2 [json_name = "subject"]; //
string productUUID = 3 [json_name = "productUUID"]; // uid
string outTradeNo = 4 [json_name = "outTradeNo"]; //
string channelTradeNo = 5 [json_name = "channelTradeNo"]; //
string checkSessionId = 6 [json_name = "checkSessionId"]; // stripe的支付会话id
int64 refundAmount = 7 [json_name = "refundAmount"]; // 退
string currency = 8 [json_name = "currency"]; //
string payee = 9 [json_name = "payee"]; //
string channelType = 10 [json_name = "channelType"]; // alipay- wxpay- stripe-Stripe支付
string platform = 11 [json_name = "platform"]; // app还是h5还是jsapi还是wap
string domain = 12 [json_name = "domain"]; // 使
string businessType = 13 [json_name = "businessType"]; // mq发送
string language = 14 [json_name = "language"]; //
string clientIp = 15 [json_name = "clientIp"];
string openID = 16 [json_name = "openID"]; //
int64 creatorId = 17 [json_name = "creatorId"]; // id
string creatorName = 18 [json_name = "creatorName"]; //
string refundReason = 19 [json_name = "refundReason"]; // 退
}
message CreateRefundResponse {
int64 code = 1 [json_name = "code"];
string msg = 2 [json_name="msg"];
}
message NotifyPayRequest {
string postUrl = 1; //
HttpRequest http_request = 2;
string rawQuery = 3 [json_name="raw_query"];
}
message NotifyPayResponse {
string msg = 1;
string outTradeNo = 2;
}
message HttpRequest {
string method = 1;
string url = 2;
map<string, string> headers = 3;
bytes body = 4;
}
message CommonMsg{
string msg = 1;
}
message EmptyRequest{}
message CreateStripeCheckoutSessionRequest {
string productUUID = 1 [json_name = "productUUID"];
string productName = 2 [json_name = "productName"];
int64 productQuantity = 3 [json_name = "productQuantity"];
int64 productAllPrice = 4 [json_name = "productAllPrice"];
string productDescription = 5 [json_name = "productDescription"];
string productImageUrl = 6 [json_name = "productImageUrl"];
string productPriceCurrency = 7 [json_name = "productPriceCurrency"];
string createrID = 8 [json_name = "createrID"];
string createrName = 9 [json_name = "createrName"];
string domain = 10 [json_name = "domain"];
string successUrl = 11 [json_name = "successUrl"];
string cancelUrl = 12 [json_name = "cancelUrl"];
string outTradeNo = 13 [json_name = "outTradeNo"];
string locale = 14 [json_name = "locale"];
}
message CreateStripeCheckoutSessionResponse {
string checkoutSessionId = 1 [json_name = "checkoutSessionId"];
string checkoutSessionUrl = 2 [json_name = "checkoutSessionUrl"];
}
message GetCheckoutWebhookRequest {
string postUrl = 1; //
string type = 2; // "payment_intent.succeeded"
string payload = 3; // JSON payload
string signature = 4; // Stripe-Signature头的值
string webhookKey = 5; // Webhook密钥
}
message GetCheckoutWebhookResponse {
bool success = 1; //
string message = 2; //
string outTradeNo = 3 [json_name = "outTradeNo"];
string paymentIntentStatus = 4 [json_name = "paymentIntentStatus"];
}
message GetStripePaymentIntentInfoRequest {
string checkoutSessionId = 1 [json_name = "checkoutSessionId"];
string createrID = 2 [json_name = "createrID"];
}
message GetStripePaymentIntentInfoResponse {
string checkoutSessionId = 1 [json_name = "checkoutSessionId"];
string checkoutSessionStatus = 2 [json_name = "checkoutSessionStatus"];
string paymentIntentId = 3 [json_name = "paymentIntentId"];
string paymentIntentCreated = 4 [json_name = "paymentIntentCreated"];
string paymentIntentStatus = 5 [json_name = "paymentIntentStatus"];
string chargeId = 6 [json_name = "chargeId"];
int64 payPrice = 7 [json_name = "payPrice"];
string payExchangeRate = 8 [json_name = "payExchangeRate"];
string payCurrency = 9 [json_name = "payCurrency"];
string accountCurrency = 10 [json_name = "accountCurrency"];
int64 afterRatePayPrice = 11 [json_name = "afterRatePayPrice"];
int64 payHandingFee = 12 [json_name = "payHandingFee"];
int64 afterRatePayNetAmount = 13 [json_name = "afterRatePayNetAmount"];
string customerId = 14 [json_name = "customerId"];
int64 refundPrice = 15 [json_name = "refundPrice"];
string outTradeNo = 16 [json_name = "outTradeNo"];
}
message GetRefundInfoRequest {
string refundId = 1 [json_name = "refundId"];
string createrID = 2 [json_name = "createrID"];
}
message GetRefundInfoResponse {
string refundStatus = 1 [json_name = "refundStatus"];
}
message AliWapPayRequest {
string subject = 1 [json_name = "subject"];
string productCode = 2 [json_name = "product_code"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string quitUrl = 4 [json_name = "quit_url"];
string notifyUrl = 5 [json_name = "notify_url"];
string returnUrl = 6 [json_name = "return_url"];
int32 totalAmount = 7 [json_name = "total_amount"];
int32 timeExpire = 8 [json_name = "time_expire"];
string domain = 9 ;
string platform = 10 ;
}
message AliWapPayResponse {
string url = 1 [json_name = "url"];
string logRecordID = 2 [json_name = "log_record_ID"];
string msg = 3 [json_name="msg"];
}
message AliAppPayRequest {
string subject = 1 [json_name = "subject"];
string productCode = 2 [json_name = "product_code"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string quitUrl = 4 [json_name = "quit_url"];
string notifyUrl = 5 [json_name = "notify_url"];
string returnUrl = 6 [json_name = "return_url"];
string totalAmount = 7 [json_name = "total_amount"];
int32 timeExpire = 8 [json_name = "time_expire"];
string domain = 9 ;
string platform = 10 ;
int32 payType = 11 ;
}
message AliAppPayResponse {
string url = 1 [json_name = "url"];
string logRecordID = 2 [json_name = "log_record_ID"];
string msg = 3 [json_name="msg"];
}
message AliNativePayRequest {
string subject = 1 [json_name = "subject"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string notifyUrl = 3 [json_name = "notify_url"];
int32 totalAmount = 4 [json_name = "total_amount"];
int32 timeExpire = 5 [json_name = "time_expire"];
string domain = 6 [json_name = "domain"];
string platform = 7 [json_name = "platform"];
}
message AliNativePayResponse {
string url = 1 [json_name = "url"];
string msg = 2 [json_name="msg"];
}
message AliPcWabPayRequest {
string subject = 1 [json_name = "subject"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string notifyUrl = 3 [json_name = "notify_url"];
int32 totalAmount = 4 [json_name = "total_amount"];
int32 timeExpire = 5 [json_name = "time_expire"];
string domain = 6 [json_name = "domain"];
string platform = 7 [json_name = "platform"];
string quitUrl = 8 [json_name = "quit_url"];
string returnUrl = 9 [json_name = "return_url"];
}
message AliPcWabPayResponse {
string pageRedirectionData = 1 [json_name = "page_redirection_data"];
string msg = 2 [json_name="msg"];
}
message AliReFundRequest {
string outTradeNo = 1 [json_name = "out_trade_no"];
int32 totalAmount = 2 [json_name = "total_amount"];
}
message AliReFundResponse {
string tradeNo = 1 [json_name = "trade_no"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string buyer_logon_id = 3 [json_name = "buyer_logon_id"];
string refund_fee = 4 [json_name = "refund_fee"];
string msg = 5 [json_name="msg"];
}
message AliNotifyRequest {
string rawQuery = 1 [json_name="raw_query"];
}
message AliNotifyResponse {
string notifyTime = 1 [json_name="notify_time"];
string notifyType = 2 [json_name="notify_type"];
string notifyId = 3 [json_name="notify_id"];
string appId = 4 [json_name="app_id"];
string version = 5 [json_name="version"];
string signType = 6 [json_name="sign_type"];
string sign = 7 [json_name="sign"];
string tradeNo = 8 [json_name="trade_no"];
string outTradeNo = 9 [json_name="out_trade_no"] ;
string buyerLogonId = 10 [json_name="buyer_logon_id"] ;
string buyerId = 11 [json_name="buyer_id"] ;
string tradeStatus = 12 [json_name="trade_status"] ;
}
message AliQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message AliQueryByOutTradeNoResponse {
string tradeNo = 1 [json_name = "trade_no"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string buyerLogonId = 3 [json_name = "buyer_logon_id"];
string tradeStatus = 4 [json_name = "trade_status"];
string totalAmount = 5 [json_name = "total_amount"];
string buyerUserID = 6 [json_name = "buyer_user_id"];
}
message AliRefundQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message AliRefundQueryByOutTradeNoResponse {
string tradeNo = 1 [json_name = "trade_no"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string out_request_no = 3 [json_name = "out_request_no"];
string total_amount = 4 [json_name = "total_amount"];
string refund_amount = 5 [json_name = "refund_amount"];
string refund_status = 6 [json_name = "refund_status"];
}
message WechatJsApiPayRequest {
string Description = 1 [json_name = "description"];
string OutTradeNo = 2 [json_name = "outTradeNo"];
int64 Cent = 3 [json_name = "cent"];
string OpenID = 4 [json_name = "openID"];
string NotifyUrl = 5 [json_name = "notifyUrl"];
string AppID = 6 [json_name = "appID"];
string ClientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 9 ;
string domain = 10 ;
string platform = 11 ;
string scene = 12 ;
int32 timeExpire = 13 [json_name = "time_expire"];
}
message WechatJsApiPayResponse {
string Appid = 1 [json_name = "appid"];
string TimeStamp = 2 [json_name = "timeStamp"];
string Package = 3 [json_name = "package"];
string SignType = 4 [json_name = "signType"];
string NonceStr = 5 [json_name = "nonceStr"];
string PaySign = 6 [json_name = "paySign"];
string PrepayId = 7 [json_name = "prepayId"];
}
message WechatAppPayResponse {
string Appid = 1 [json_name = "appid"];
string TimeStamp = 2 [json_name = "timeStamp"];
string Package = 3 [json_name = "package"];
string SignType = 4 [json_name = "signType"];
string NonceStr = 5 [json_name = "nonceStr"];
string PaySign = 6 [json_name = "paySign"];
string PrepayId = 7 [json_name = "prepayId"];
string PartnerId = 8 [json_name = "partnerId"];
string msg = 9 [json_name="msg"];
}
message WechatJsApiQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatJsApiQueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];
string mchID = 2 [json_name = "mch_id"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string transactionId = 4 [json_name = "transaction_id"];
string tradeType = 5 [json_name = "trade_type"];
string tradeState = 6 [json_name = "trade_state"];
string bankType = 7 [json_name = "bank_ype"];
string successTime = 8 [json_name = "success_time"];
string openID = 9 [json_name = "open_id"];
int32 total = 10 [json_name = "total"];
}
message WechatAppQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatAppQueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];// ID
string mchID = 2 [json_name = "mch_id"];// ID
// string subAppId = 3 [json_name = "sub_appid"]; // ID
// string subMchId = 4 [json_name = "sub_mchid"];// ID
string outTradeNo = 5 [json_name = "out_trade_no"];//
string transactionId = 6 [json_name = "transaction_id"];// ID
string tradeType = 7 [json_name = "trade_type"];//
string tradeState = 8 [json_name = "trade_state"];//
string tradeStateDesc = 9 [json_name = "trade_state_desc"]; //
string bankType = 10 [json_name = "bank_type"]; //
string attach = 11 [json_name = "attach"]; //
string successTime = 12 [json_name = "success_time"];//
message Payer {//
string openid = 1 [json_name = "openid"];
}
message Amount {//
int64 total = 1 [json_name = "total"];//
int64 payerTotal = 2 [json_name = "payer_total"];//
string currency = 3 [json_name = "currency"];//
string payerCurrency = 4 [json_name = "payer_currency"];//
}
message PromotionDetail {//
string couponId = 1 [json_name = "coupon_id"];// ID
string name = 2 [json_name = "name"];//
string scope = 3 [json_name = "scope"];//
string type = 4 [json_name = "type"];//
int64 amount = 5 [json_name = "amount"];//
string stockId = 6 [json_name = "stock_id"];// ID
int64 wechatpayContribute = 7 [json_name = "wechatpay_contribute"];//
int64 merchantContribute = 8 [json_name = "merchant_contribute"];//
int64 otherContribute = 9 [json_name = "other_contribute"];//
string currency = 10 [json_name = "currency"];//
}
//
repeated PromotionDetail promotionDetail = 13 [json_name = "promotion_detail"];
//
Payer payer = 14;
//
Amount amount = 15;
}
message GetPayByOutTradeNoRequest {
string OutTradeNo = 4 [json_name = "OutTradeNo"];
}
message GetPayByOutTradeNoResponse {
string outTradeNo = 1 ;
uint32 recordId = 2 ;
string cent = 3 ;
string platform = 4 ;
string domain = 5 ;
string scene = 6 ;
}
message WechatJsApiRefundsResponse {
string RefundId = 1 [json_name = "RefundId"];
string OutRefundNo = 2 [json_name = "OutRefundNo"];
string TransactionId = 3 [json_name = "TransactionId"];
string OutTradeNo = 4 [json_name = "OutTradeNo"];
string SuccessTime = 5 [json_name = "SuccessTime"];
string CreateTime = 6 [json_name = "CreateTime"];
string Status = 7 [json_name = "Status"];
string Amount = 8 [json_name = "Amount"];
}
message WechatNativePayRequest {
string description = 1 [json_name = "description"];
string outTradeNo = 2 [json_name = "outTradeNo"];
int32 cent = 3 [json_name = "cent"];
string notifyUrl = 5 [json_name = "notifyUrl"];
string appID = 6 [json_name = "appID"];
string clientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 8 ;
string domain = 9 ;
string platform = 10 ;
string scene = 11 ;
int32 timeExpire = 12 [json_name = "time_expire"];
}
message WechatNativePayResponse {
string codeUrl = 1 [json_name = "code_url"];
}
message WechatNativeQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatRefundQueryByOutRefundNoRequest {
string outRefundNo = 1 [json_name = "out_refund_no"];
}
message WechatRefundQueryByOutRefundNoResponse {
string refundId = 1 [json_name = "refund_id"];
string outRefundNo = 2 [json_name = "out_refund_no"];
string transactionId = 3 [json_name = "transaction_id"];
string outTradeNo = 4 [json_name = "out_trade_no"];
string channel = 5 [json_name = "channel"];
string userReceivedAccount = 6 [json_name = "user_received_account"];
string successTime = 7 [json_name = "success_time"];
string createTime = 8 [json_name = "create_time"];
string status = 9 [json_name = "status"];
int32 total = 10 [json_name = "total"];
}
message WechatNativeQueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];
string mchID = 2 [json_name = "mch_id"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string transactionId = 4 [json_name = "transaction_id"];
string tradeType = 5 [json_name = "trade_type"];
string tradeState = 6 [json_name = "trade_state"];
string bankType = 7 [json_name = "bank_ype"];
string successTime = 8 [json_name = "success_time"];
string openID = 9 [json_name = "open_id"];
int32 total = 10 [json_name = "total"];
}
message WechatAppPayRequest {
string Description = 1 [json_name = "description"];
string OutTradeNo = 2 [json_name = "outTradeNo"];
int64 Cent = 3 [json_name = "cent"];
string OpenID = 4 [json_name = "openID"];
string NotifyUrl = 5 [json_name = "notifyUrl"];
string AppID = 6 [json_name = "appID"];
string ClientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 9 ;
string domain = 10 ;
string platform = 11 ;
string scene = 12 ;
int32 timeExpire = 13 [json_name = "time_expire"];
}
message WechatJsApiRefundsRequest {
string Reason = 1 [json_name = "Reason"];
string OutTradeNo = 2 [json_name = "OutTradeNo"];
string OutRefundNo = 3 [json_name = "OutRefundNo"];
string NotifyUrl = 4 [json_name = "NotifyUrl"];
int64 Cent = 5 [json_name = "Cent"];
string OpenID = 6 [json_name = "OpenID"];
int64 Total =7[json_name = "Total"];
}
message WechatH5PayRequest {
string Description = 1 [json_name = "description"];
string OutTradeNo = 2 [json_name = "outTradeNo"];
int64 Cent = 3 [json_name = "cent"];
string OpenID = 4 [json_name = "openID"];
string NotifyUrl = 5 [json_name = "notifyUrl"];
string AppID = 6 [json_name = "appID"];
string ClientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 9 ;
string domain = 10 ;
string platform = 11 ;
string scene = 12 ;
int32 timeExpire = 13 [json_name = "time_expire"];
}
message WechatH5PayResponse {
string h5Url = 1 [json_name = "h5_url"];
}
message WechatH5QueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatH5QueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];
string mchID = 2 [json_name = "mch_id"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string transactionId = 4 [json_name = "transaction_id"];
string tradeType = 5 [json_name = "trade_type"];
string tradeState = 6 [json_name = "trade_state"];
string tradeStateDesc = 7 [json_name = "trade_state_desc"];
string bankType = 8 [json_name = "bank_ype"];
string successTime = 9 [json_name = "success_time"];
string openID = 10 [json_name = "open_id"];
int32 total = 11 [json_name = "total"];
}
message WechatPayOkRequest {
string outTradeNo = 1 ;
string body = 2 ;
}
message CommonResponse {
bool Success = 1 [json_name = "success"];
uint32 ID = 2 ;
}
message PayQueryRequest {
string payType = 1;
string outTradeNo = 2;
}
message PayQueryResponse {
repeated PaymentOrderInfo infos = 1;
}
message PaymentOrderInfo {
int64 id = 1;
string createdAt = 2;
string updatedAt = 3;
string outTradeNo = 4; //
string channelTradeNo = 5; //
int64 amount = 6; //
string currency = 7; //
string status = 8;
string payTime = 9;
string refundTime = 10;
string payee = 11;
string channelType = 12; // alipay- wxpay- stripe-Stripe支付
string platform = 13; // app还是h5还是jsapi还是wap
string domain = 14; // 使
string businessType = 15; // mq发送
int64 logId = 16;
string checkSessionId = 17;
string productUUID = 18;
string productName = 19;
string productImg = 20;
string productDescription = 21;
int64 fee = 22; //
int64 netIncome = 23; // 退
}
message ExportPayRequest {
string startTime = 1; //
string endTime = 2; //
string reportType = 3;
string reportRangeNum = 4; //
string channelType = 5; //
string currency = 6;
string sortBy = 7; // asc,desc
}
message ExportPayResponse {
string reportType = 1; //
int32 orderNum = 2; //
repeated Overview overview = 3; //
repeated ChannelIncome channelIncomes = 4; //
repeated BusinessInfo businessInfos = 5; //
repeated OrderDetail orderDetails = 6; // sheet2,
}
message OrderDetail {
int64 paymentOrderId = 1;
string createdAt = 2;
string updatedAt = 3;
string outTradeNo = 4; //
string channelTradeNo = 5; //
string currency = 6; //
int64 payAmount = 7; //
int64 fee = 8; //
int64 netIncome = 9; //
string status = 10;
string payTime = 11;
string channelType = 12; // alipay- wxpay- stripe-Stripe支付
string platform = 13; // app还是h5还是jsapi还是wap
string domain = 14; // 使
string businessType = 15; // mq发送
int64 logId = 16;
string checkSessionId = 17;
string productUUID = 18;
string productName = 19;
string productImg = 20;
string productDescription = 21;
}
message BusinessInfo {
string BusinessName = 1; //
string currency = 2; //
int32 orderNum = 3; //
int64 totalIncome = 4; //
int64 totalFee = 5; //
int64 totalRefundAmount = 6; // 退
int64 netIncome = 7; //
}
message Overview {
string currency = 1; //
int32 orderNum = 2; //
int64 totalIncome = 3; //
int64 totalFee = 4; //
int64 totalRefundAmount = 5; // 退
int64 netIncome = 6; //
}
message ChannelIncome {
string channelType = 1; //
string currency = 2; //
int32 orderNum = 3; //
int64 totalIncome = 4; //
int64 totalFee = 5; //
int64 totalRefundAmount = 6; // 退
int64 netIncome = 7; //
}

View File

@ -0,0 +1,301 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pb/payment.proto
package payment
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *AntomPayQueryRequest) Validate() error {
return nil
}
func (this *AntomPayQueryResponse) Validate() error {
for _, item := range this.Infos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Infos", err)
}
}
}
return nil
}
func (this *AntomNotifyPayRequest) Validate() error {
return nil
}
func (this *AntomNotifyPayResponse) Validate() error {
return nil
}
func (this *CreatePayRequest) Validate() error {
return nil
}
func (this *CreatePayResponse) Validate() error {
return nil
}
func (this *CreateRefundRequest) Validate() error {
return nil
}
func (this *CreateRefundResponse) Validate() error {
return nil
}
func (this *NotifyPayRequest) Validate() error {
if this.HttpRequest != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.HttpRequest); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("HttpRequest", err)
}
}
return nil
}
func (this *NotifyPayResponse) Validate() error {
return nil
}
func (this *HttpRequest) Validate() error {
// Validation of proto3 map<> fields is unsupported.
return nil
}
func (this *CommonMsg) Validate() error {
return nil
}
func (this *EmptyRequest) Validate() error {
return nil
}
func (this *CreateStripeCheckoutSessionRequest) Validate() error {
return nil
}
func (this *CreateStripeCheckoutSessionResponse) Validate() error {
return nil
}
func (this *GetCheckoutWebhookRequest) Validate() error {
return nil
}
func (this *GetCheckoutWebhookResponse) Validate() error {
return nil
}
func (this *GetStripePaymentIntentInfoRequest) Validate() error {
return nil
}
func (this *GetStripePaymentIntentInfoResponse) Validate() error {
return nil
}
func (this *GetRefundInfoRequest) Validate() error {
return nil
}
func (this *GetRefundInfoResponse) Validate() error {
return nil
}
func (this *AliWapPayRequest) Validate() error {
return nil
}
func (this *AliWapPayResponse) Validate() error {
return nil
}
func (this *AliAppPayRequest) Validate() error {
return nil
}
func (this *AliAppPayResponse) Validate() error {
return nil
}
func (this *AliNativePayRequest) Validate() error {
return nil
}
func (this *AliNativePayResponse) Validate() error {
return nil
}
func (this *AliPcWabPayRequest) Validate() error {
return nil
}
func (this *AliPcWabPayResponse) Validate() error {
return nil
}
func (this *AliReFundRequest) Validate() error {
return nil
}
func (this *AliReFundResponse) Validate() error {
return nil
}
func (this *AliNotifyRequest) Validate() error {
return nil
}
func (this *AliNotifyResponse) Validate() error {
return nil
}
func (this *AliQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *AliQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *AliRefundQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *AliRefundQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatJsApiPayRequest) Validate() error {
return nil
}
func (this *WechatJsApiPayResponse) Validate() error {
return nil
}
func (this *WechatAppPayResponse) Validate() error {
return nil
}
func (this *WechatJsApiQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatJsApiQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse) Validate() error {
for _, item := range this.PromotionDetail {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PromotionDetail", err)
}
}
}
if this.Payer != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Payer); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Payer", err)
}
}
if this.Amount != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Amount", err)
}
}
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse_Payer) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse_Amount) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse_PromotionDetail) Validate() error {
return nil
}
func (this *GetPayByOutTradeNoRequest) Validate() error {
return nil
}
func (this *GetPayByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatJsApiRefundsResponse) Validate() error {
return nil
}
func (this *WechatNativePayRequest) Validate() error {
return nil
}
func (this *WechatNativePayResponse) Validate() error {
return nil
}
func (this *WechatNativeQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatRefundQueryByOutRefundNoRequest) Validate() error {
return nil
}
func (this *WechatRefundQueryByOutRefundNoResponse) Validate() error {
return nil
}
func (this *WechatNativeQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatAppPayRequest) Validate() error {
return nil
}
func (this *WechatJsApiRefundsRequest) Validate() error {
return nil
}
func (this *WechatH5PayRequest) Validate() error {
return nil
}
func (this *WechatH5PayResponse) Validate() error {
return nil
}
func (this *WechatH5QueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatH5QueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatPayOkRequest) Validate() error {
return nil
}
func (this *CommonResponse) Validate() error {
return nil
}
func (this *PayQueryRequest) Validate() error {
return nil
}
func (this *PayQueryResponse) Validate() error {
for _, item := range this.Infos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Infos", err)
}
}
}
return nil
}
func (this *PaymentOrderInfo) Validate() error {
return nil
}
func (this *ExportPayRequest) Validate() error {
return nil
}
func (this *ExportPayResponse) Validate() error {
for _, item := range this.Overview {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Overview", err)
}
}
}
for _, item := range this.ChannelIncomes {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ChannelIncomes", err)
}
}
}
for _, item := range this.BusinessInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BusinessInfos", err)
}
}
}
for _, item := range this.OrderDetails {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderDetails", err)
}
}
}
return nil
}
func (this *OrderDetail) Validate() error {
return nil
}
func (this *BusinessInfo) Validate() error {
return nil
}
func (this *Overview) Validate() error {
return nil
}
func (this *ChannelIncome) Validate() error {
return nil
}

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,16 @@ dubbo:
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.micro.account
interface: com.fontree.microservices.common.Account
filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
AccountFieeClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.micro.account.fiee
# filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
# params:
# .accessKeyId: "Accountksl"

View File

@ -24,7 +24,21 @@ dubbo:
retries: 0
interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
AccountFieeClientImpl:
protocol: tri
retries: 3
interface: com.fontree.microservices.common.micro.account
interface: com.fontree.microservices.common.micro.account.fiee
# filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter
PaymentCentClientImpl:
interface: com.fontree.microservices.common.payment # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,auth
params:
.accessKeyId: "Paymentksl"
.secretAccessKey: "BSDY-FDF1-Fontree_payment"

View File

@ -25,4 +25,20 @@ dubbo:
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.micro.account
interface: com.fontree.microservices.common.Account
filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
AccountFieeClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.micro.account.fiee
PaymentCentClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.payment.cent # must be compatible with grpc or dubbo-java
# filter: cshutdown,sign,auth
params:
.accessKeyId: "Paymentksl"
.secretAccessKey: "BSDY-FDF1-Fontree_payment"

32
go.mod
View File

@ -2,24 +2,11 @@ module fonchain-fiee
go 1.18
//github.com/fonchain_enterprise/utils/aes => ./docs/utils/aes
//github.com/fonchain_enterprise/utils/chain => ./docs/utils/chain
//github.com/fonchain_enterprise/utils/jwt => ./docs/utils/jwt
//github.com/fonchain_enterprise/utils/logger => ./docs/utils/logger
//github.com/fonchain_enterprise/utils/rand => ./docs/utils/rand
replace (
github.com/fonchain_enterprise/utils/aes => ../utils/aes
github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
)
//github.com/fonchain/electronic-contract => ../../electronic-contract
//github.com/fonchain_enterprise/utils/aes => ../utils/aes
//github.com/fonchain_enterprise/utils/baidu => ../utils/baidu
//github.com/fonchain_enterprise/utils/bankQuery => ../utils/bankQuery
//github.com/fonchain_enterprise/utils/chain => ../utils/chain
//github.com/fonchain_enterprise/utils/feie => ../utils/feie
//github.com/fonchain_enterprise/utils/ipAddrQuery => ../utils/ipAddrQuery
//github.com/fonchain_enterprise/utils/jwt => ../utils/jwt
//github.com/fonchain_enterprise/utils/logger => ../utils/logger
replace github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-/utils/objstorage
//replace github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
//
require (
dubbo.apache.org/dubbo-go/v3 v3.0.2
@ -28,7 +15,7 @@ require (
//github.com/fonchain_enterprise/utils/jwt v0.0.0-00010101000000-000000000000
//github.com/fonchain_enterprise/utils/logger v0.0.0-00010101000000-000000000000
github.com/gin-contrib/gzip v0.0.5
github.com/gin-gonic/gin v1.9.1
github.com/gin-gonic/gin v1.9.0
github.com/golang/protobuf v1.5.4
github.com/mwitkow/go-proto-validators v0.3.2
github.com/pkg/errors v0.9.1 // indirect
@ -57,7 +44,7 @@ require (
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@ -70,7 +57,7 @@ require (
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
@ -109,7 +96,9 @@ require (
)
require (
github.com/360EntSecGroup-Skylar/excelize v1.4.1
github.com/BurntSushi/toml v1.2.1
github.com/PuerkitoBio/goquery v1.8.1
github.com/disintegration/imaging v1.6.2
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
github.com/gin-contrib/pprof v1.4.0
@ -124,10 +113,10 @@ require (
require (
cloud.google.com/go v0.65.0 // indirect
github.com/360EntSecGroup-Skylar/excelize v1.4.1 // indirect
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect
github.com/alibaba/sentinel-golang v1.0.4 // indirect
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/aws/aws-sdk-go v1.38.20 // indirect
github.com/baidubce/bce-sdk-go v0.9.123 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
@ -143,7 +132,6 @@ require (
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-co-op/gocron v1.9.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect

33
go.sum
View File

@ -48,6 +48,8 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/RoaringBitmap/roaring v1.1.0 h1:b10lZrZXaY6Q6EKIRrmOF519FIyQQ5anPgGr3niw2yY=
github.com/RoaringBitmap/roaring v1.1.0/go.mod h1:icnadbWcNyfEHlYdr+tDlOTih1Bf/h+rzPpv4sbomAA=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
@ -74,6 +76,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDH
github.com/aliyun/aliyun-oss-go-sdk v2.2.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/aliyun/aliyun-oss-go-sdk v2.2.6+incompatible h1:KXeJoM1wo9I/6xPTyt6qCxoSZnmASiAjlrr0dyTUKt8=
github.com/aliyun/aliyun-oss-go-sdk v2.2.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/dubbo-getty v1.4.8 h1:Q9WKXmVu4Dm16cMJHamegRbxpDiYaGIU+MnPGhJhNyk=
github.com/apache/dubbo-getty v1.4.8/go.mod h1:cPJlbcHUTNTpiboMQjMHhE9XBni11LiBiG8FdrDuVzk=
@ -237,8 +241,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@ -250,8 +252,8 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k=
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0=
github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k=
@ -293,8 +295,8 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU=
github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s=
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY=
@ -576,8 +578,8 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
@ -872,6 +874,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zouyx/agollo/v3 v3.4.5 h1:7YCxzY9ZYaH9TuVUBvmI6Tk0mwMggikah+cfbYogcHQ=
github.com/zouyx/agollo/v3 v3.4.5/go.mod h1:LJr3kDmm23QSW+F1Ol4TMHDa7HvJvscMdVxJ2IpUTVc=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
@ -949,6 +952,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
@ -991,6 +995,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -1036,10 +1041,13 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@ -1061,6 +1069,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -1134,14 +1143,18 @@ golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -1151,6 +1164,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -1218,6 +1232,7 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View File

@ -38,7 +38,7 @@ const (
NotExistInentifier = 202
ERROR = 500
InvalidParams = 400
NotLoginSqueeze = 409
//成员错误
ErrorExistNick = 10001
ErrorExistUser = 10002
@ -146,3 +146,14 @@ const (
NotFilled = 3
Save = 4
)
var OfflineMap = map[string]string{
"ErrOfflineZhCN": "您已经下线",
"ErrOfflineEN": "You have been offline",
"ErrOfflineZhTW": "您已經下線",
}
var LoginMap = map[string]string{
"ErrNotLoginZhCN": "请先登录",
"ErrNotLoginEN": "Please login first",
"ErrNotLoginZhTW": "請先登錄",
}

View File

@ -4,6 +4,8 @@ const (
SERVER_CONFIG = "conf.ini"
SERVER_DUBBOGO_CONFIG = "dubbogo.yaml"
MODE_ENV = "MODE_ENV"
LoginFromPC = "pc"
OfflineSqueeze = "squeeze"
)
const (

1093
pkg/e/oa_msg.go Normal file

File diff suppressed because it is too large Load Diff

132
pkg/logic/language.go Normal file
View File

@ -0,0 +1,132 @@
package logic
import (
"fonchain-fiee/pkg/e"
"github.com/gin-gonic/gin"
"strings"
)
func GetLanguage(c *gin.Context) string {
lang := c.Request.Header.Get("Accept-Language")
lang = strings.Split(lang, ",")[0]
if lang == "zh-CN" || lang == "zh" || lang == "ZhCN" {
lang = "ZhCN"
} else if lang == "zh-TW" || lang == "ZhTW" {
lang = "ZhTW"
} else if lang == "en" || lang == "EN" {
lang = "EN"
}
return lang
}
func ConvertOfflineMsg(c *gin.Context, key string) string {
language := GetLanguage(c)
switch language {
case "EN":
return e.OfflineMap[strings.Join([]string{key, "EN"}, "")]
case "ZhCN":
return e.OfflineMap[strings.Join([]string{key, "ZhCN"}, "")]
case "ZhTW":
return e.OfflineMap[strings.Join([]string{key, "ZhTW"}, "")]
default:
return key
}
}
func ConvertLoginMsg(c *gin.Context, key string) string {
language := GetLanguage(c)
switch language {
case "EN":
return e.LoginMap[strings.Join([]string{key, "EN"}, "")]
case "ZhCN":
return e.LoginMap[strings.Join([]string{key, "ZhCN"}, "")]
case "ZhTW":
return e.LoginMap[strings.Join([]string{key, "ZhTW"}, "")]
default:
return key
}
}
func ConvertWeek(language string, week int32) string {
switch language {
case "EN":
switch week {
case 1:
return "Monday"
case 2:
return "Tuesday"
case 3:
return "Wednesday"
case 4:
return "Thursday"
case 5:
return "Friday"
case 6:
return "Saturday"
case 7:
return "Sunday"
}
case "ZhCN":
switch week {
case 1:
return "星期一"
case 2:
return "星期二"
case 3:
return "星期三"
case 4:
return "星期四"
case 5:
return "星期五"
case 6:
return "星期六"
case 7:
return "星期日"
}
case "ZhTW":
switch week {
case 1:
return "星期一"
case 2:
return "星期二"
case 3:
return "星期三"
case 4:
return "星期四"
case 5:
return "星期五"
case 6:
return "星期六"
case 7:
return "星期日"
}
}
return ""
}
func ConvertAmPm(language string, amPm string) string {
switch language {
case "EN":
switch amPm {
case "上午":
return "AM"
case "下午":
return "PM"
}
}
return amPm
}
func ConvertOaMsg(c *gin.Context, key string) string {
language := GetLanguage(c)
switch language {
case "EN":
return e.GetMsgEN(strings.Join([]string{key, "EN"}, ""))
case "ZhCN":
return e.GetMsgZhCN(strings.Join([]string{key, "ZhCN"}, ""))
case "ZhTW":
return e.GetMsgZhTW(strings.Join([]string{key, "ZhTW"}, ""))
default:
return key
}
}

View File

@ -1,19 +1,25 @@
package middleware
import (
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors"
"fmt"
api "fonchain-fiee/api/account"
"fonchain-fiee/api/account"
api "fonchain-fiee/api/accountFiee"
jwt2 "fonchain-fiee/pkg/common/jwt"
"fonchain-fiee/pkg/common/m"
"fonchain-fiee/pkg/e"
"fonchain-fiee/pkg/logic"
"fonchain-fiee/pkg/model"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils/secret"
"github.com/gin-gonic/gin"
"time"
)
// CheckLogin 检测登陆
func CheckLogin(provider *api.AccountClientImpl) gin.HandlerFunc {
func CheckLogin(provider *api.AccountFieeClientImpl) gin.HandlerFunc {
return func(ctx *gin.Context) {
@ -38,7 +44,7 @@ func CheckLogin(provider *api.AccountClientImpl) gin.HandlerFunc {
Domain: jwt.Domain,
}
infoRes, err := service.AccountProvider.UserByTel(ctx, infoReq)
infoRes, err := service.AccountFieeProvider.UserByTel(ctx, infoReq)
if err != nil {
service.Error(ctx, err)
return
@ -69,3 +75,108 @@ func CheckLogin(provider *api.AccountClientImpl) gin.HandlerFunc {
ctx.Next()
}
}
func CheckWebLogin(provider *account.AccountClientImpl) gin.HandlerFunc {
return func(ctx *gin.Context) {
startTime := time.Now()
//如果没有登录
authorization := ctx.GetHeader(e.Authorization)
if authorization == "" {
service.NotLoginRes(ctx, logic.ConvertLoginMsg(ctx, e.ErrNotLogin))
return
}
jwt, err := secret.GetJwtFromStr(authorization)
logger.Info("---------end帐号转jwt:时间:", time.Now().Sub(startTime))
if err != nil {
service.NotLoginRes(ctx, err.Error())
return
}
//0 解密
req := account.DecryptJwtRequest{
Token: jwt,
Domain: "fontree",
}
info, err := service.AccountProvider.DecryptJwt(ctx, &req)
logger.Info("---------end帐号微服务解密:时间:", time.Now().Sub(startTime))
if err != nil {
service.NotLoginRes(ctx, err.Error())
return
}
//if info.OfflineCode == e.OfflineSqueeze {
// service.Error(ctx, e.NotLoginSqueeze, errors.New(e.ErrOfflineSqueeze))
// return
//}
if info.IsOffline == true {
service.ErrorWeb(ctx, e.NotLogin, errors.New(logic.ConvertOfflineMsg(ctx, e.ErrOffline)))
return
}
//1 获取用户的账号信息
infoReq := &account.InfoRequest{
ID: info.ID,
Scene: "base",
Domain: "fontree",
}
infoRes, err := service.AccountProvider.Info(ctx, infoReq)
logger.Info("---------end帐号info时间:", time.Now().Sub(startTime))
if err != nil {
service.ErrorWeb(ctx, e.Error, err)
return
}
//3 获取用户的岗位信息
//uReq := rule.RulesRequest{
// AccountID: info.ID,
//}
//
//qres, err1 := service.RuleProvider.UserInfo(ctx, &uReq)
//
//logger.Info("---------end帐号,rule的userInfo:时间:", time.Now().Sub(startTime))
//if err1 != nil {
// service.Error(ctx, e.Error, err)
// return
//}
loginInfo := login.Info{
Domain: info.Domain,
ID: info.ID,
//Account: info.Account,
//NickName: info.NickName,
//PositionUsers: qres.PositionUsers,
//Extend: infoRes.Info.Extend,
TelNum: infoRes.Info.TelNum,
//Avatar: infoRes.Info.Avatar,
//JumpTo: "",
//DepartmentName: "",
}
//if infoRes.Info.Extend != nil {
// loginInfo.JumpTo = infoRes.Info.Extend.JumpTo
//}
//
//if len(qres.PositionUsers) >= 1 {
// loginInfo.DepartmentName = qres.PositionUsers[0].DepartmentName
//}
ctx.Set("jwtInfo", loginInfo)
var mLoginInfo model.LoginInfo
mLoginInfo.ID = loginInfo.ID
mLoginInfo.NickName = loginInfo.Name
mLoginInfo.Phone = loginInfo.TelNum
//mLoginInfo.PositionUsers = qres.PositionUsers
ctx.Set("mLoginInfo", mLoginInfo)
logger.Info("---------check_login:总时间", time.Now().Sub(startTime))
ctx.Next()
}
}

18
pkg/model/middleware.go Normal file
View File

@ -0,0 +1,18 @@
package model
import (
api "fonchain-fiee/api/account"
//"github.com/fonchain_enterprise/fonchain-main/api/rule"
)
type LoginInfo struct {
Domain string
ID uint64
Account string
NickName string
JumpTo string
DepartmentName string
Phone string
Extend *api.Extend
//PositionUsers []*rule.PositionUser
}

View File

@ -1,13 +1,15 @@
package router
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle"
"github.com/gin-gonic/gin"
)
func BundleRouter(r *gin.RouterGroup) {
bundleRoute := r.Group("bundle")
bundleRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
// 套餐
{
bundleClientRoute := bundleRoute.Group("system")

View File

@ -11,18 +11,25 @@ import (
func BundleOrderRouter(r *gin.RouterGroup) {
r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook)
r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调
bundleOrderRoute := r.Group("bundle-order")
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountProvider))
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
bundleOrderWebRoute := r.Group("bundle-order")
bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
// 套餐
{
bundleOrderClientRoute := bundleOrderRoute.Group("common")
bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
{
bundleOrderClientRoute.POST("bundle-order-list", bundle.OrderRecordsList)
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
}
bundleOrderClientAppRoute := bundleOrderRoute.Group("common/app")
{
bundleOrderClientAppRoute.POST("bundle-order-list", bundle.OrderRecordsList)
}
bundleOrderWebRoute := bundleOrderRoute.Group("web")
//bundleOrderWebRoute := bundleOrderRoute.Group("web")
{
bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfoOss)
@ -35,7 +42,8 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail)
// stripe
bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateStripeCheckoutSession)
//bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateStripeCheckoutSession) // stripe支付
bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateAntomPay) // Antom国际支付
}
}

View File

@ -26,10 +26,10 @@ func NewRouter() *gin.Engine {
r.Use(gzip.Gzip(gzip.BestSpeed)) // 中间件占用绝大部分内存
//加入日志中间件,跨域中间件
r.Use(middleware.NewLogger(), middleware.Cors(), middleware.GinRecovery(true))
privateGroup := r.Group("api")
privateGroup := r.Group("api/fiee")
privateGroup.Use(middleware.NewLogger(), middleware.Cors(), middleware.GinRecovery(true))
//加入日志中间件,跨域中间件
v1 := r.Group("api")
v1 := r.Group("api/fiee")
GiteaRoute(v1)
v1.GET("test", func(c *gin.Context) {
@ -55,20 +55,25 @@ func NewRouter() *gin.Engine {
privateGroup.POST("generate/captcha", account.GenerateCaptcha) //生成滑块验证码
privateGroup.POST("validate/captcha", account.ValidateCaptcha) //验证滑块验证码
acRoute := privateGroup.Group("/user")
acRoute.Use(middleware.CheckLogin(service.AccountProvider))
acRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
{
acRoute.POST("real-name", account.RealName) //实名
acRoute.POST("info", account.UserInfo) //用户详情
acRoute.POST("update", account.UserUpdate) //用户更新
}
webAcRouter := privateGroup.Group("/user")
webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
{
acRoute.POST("list", account.UserList) //用户列表
acRoute.POST("approval", account.UserApproval) //实名审核
webAcRouter.POST("list", account.UserList) //用户列表
webAcRouter.POST("approval", account.UserApproval) //实名审核
}
}
{
v1.GET("chart/forward/test", redirect.ForwardTest)
}
// 上传
upData := privateGroup.Group("upload")
upData.Use(middleware.CheckLogin(service.AccountProvider))
upData.Use(middleware.CheckLogin(service.AccountFieeProvider))
{
upData.POST("img", upload.UploadImg)
}

View File

@ -10,7 +10,7 @@ import (
func ValueAddBundleRouter(r *gin.RouterGroup) {
valueAddBundleRoute := r.Group("valueAdd-bundle")
valueAddBundleRoute.Use(middleware.CheckLogin(service.AccountProvider))
valueAddBundleRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
// 增值套餐
{

25
pkg/serializer/common.go Normal file
View File

@ -0,0 +1,25 @@
package serializer
// Response 基础序列化器
type Response struct {
Status int `json:"status"`
Data interface{} `json:"data"`
Msg string `json:"msg"`
Code int `json:"code"`
Error error `json:"error"`
Err string `json:"err"`
Keys []string `json:"keys"`
Mark string `json:"mark,omitempty"`
Page *PageInfo `json:"page,omitempty"`
Positions interface{} `json:"positions"`
}
type PageInfo struct {
Page int32 `json:"page" query:"page"`
PageSize int32 `json:"pageSize" query:"pageSize"`
Total int32 `json:"total"`
}
type UseFaceClockIn struct {
Result int `json:"Result"`
Msg string `json:"Msg"`
}

View File

@ -3,7 +3,7 @@ package account
import (
"context"
"fmt"
"fonchain-fiee/api/account"
account "fonchain-fiee/api/accountFiee"
"fonchain-fiee/pkg/e"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/model/union"
@ -18,7 +18,7 @@ func UserApproval(c *gin.Context) {
service.Error(c, err)
return
}
res, err := service.AccountProvider.CheckRealName(context.Background(), &req)
res, err := service.AccountFieeProvider.CheckRealName(c, &req)
if err != nil {
service.Error(c, err)
return
@ -34,7 +34,7 @@ func UserList(c *gin.Context) {
return
}
req.Domain = "app"
res, err := service.AccountProvider.UserList(context.Background(), &req)
res, err := service.AccountFieeProvider.UserList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
@ -48,7 +48,7 @@ func UserInfo(c *gin.Context) {
user := login.GetUserInfoFromC(c)
req.ID = user.ID
req.Domain = user.Domain
res, err := service.AccountProvider.Info(context.Background(), &req)
res, err := service.AccountFieeProvider.Info(c, &req)
if err != nil {
service.Error(c, err)
return
@ -67,7 +67,7 @@ func UserUpdate(c *gin.Context) {
user := login.GetUserInfoFromC(c)
req.ID = user.ID
req.Domain = user.Domain
res, err := service.AccountProvider.Update(context.Background(), &account.UpdateRequest{
res, err := service.AccountFieeProvider.Update(c, &account.UpdateRequest{
ID: req.ID,
Domain: req.Domain,
Language: req.Language,
@ -88,7 +88,7 @@ func SendMsg(c *gin.Context) {
service.Error(c, err)
return
}
data, err := service.AccountProvider.VerifySliderStatus(context.Background(), &account.VerifySliderStatusRequest{
data, err := service.AccountFieeProvider.VerifySliderStatus(c, &account.VerifySliderStatusRequest{
NonceStr: req.NonceStr,
})
fmt.Println("data=============>", data, err)
@ -151,7 +151,7 @@ func SendMsg(c *gin.Context) {
MId: req.MId,
Scope: req.Scope,
}
res, err := service.AccountProvider.SendNationMsg(context.Background(), tempReq)
res, err := service.AccountFieeProvider.SendNationMsg(context.Background(), tempReq)
if err != nil {
service.Error(c, err)
return
@ -159,7 +159,7 @@ func SendMsg(c *gin.Context) {
service.Success(c, res)
return
} else {
res, err := service.AccountProvider.SendMsg(context.Background(), &req)
res, err := service.AccountFieeProvider.SendMsg(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
@ -171,7 +171,7 @@ func SendMsg(c *gin.Context) {
//req.Domain = "app"
//req.SignNo = uint32(config.DefaultSignNo)
//res, err := service.AccountProvider.SendMsg(context.Background(), &req)
//res, err := service.AccountFieeProvider.SendMsg(context.Background(), &req)
//if err != nil {
// service.Error(c, err)
// return
@ -187,7 +187,7 @@ func RealName(c *gin.Context) {
}
user := login.GetUserInfoFromC(c)
req.Id = user.ID
res, err := service.AccountProvider.RealName(context.Background(), &req)
res, err := service.AccountFieeProvider.RealName(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
@ -207,7 +207,7 @@ func CheckMsg(c *gin.Context) {
return
}
req.TelNum = req.Zone + req.TelNum
res, err := service.AccountProvider.CheckMsg(context.Background(), &req)
res, err := service.AccountFieeProvider.CheckMsg(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
@ -225,7 +225,7 @@ func GenerateCaptcha(c *gin.Context) {
return
}
res, err := service.AccountProvider.GenerateSliderCaptcha(context.Background(), &req)
res, err := service.AccountFieeProvider.GenerateSliderCaptcha(context.Background(), &req)
if err != nil {
service.Error(c, err)
@ -245,7 +245,7 @@ func ValidateCaptcha(c *gin.Context) {
return
}
res, err := service.AccountProvider.VerifySliderCaptcha(context.Background(), &req)
res, err := service.AccountFieeProvider.VerifySliderCaptcha(context.Background(), &req)
if err != nil {
service.Error(c, err)
@ -258,7 +258,7 @@ func ValidateCaptcha(c *gin.Context) {
func UserLogout(c *gin.Context) {
req := account.DecryptJwtRequest{}
req.Token = c.GetHeader(e.Authorization)
res, err := service.AccountProvider.Logout(c, &req)
res, err := service.AccountFieeProvider.Logout(c, &req)
if err != nil {
service.Error(c, err)
return
@ -274,12 +274,12 @@ func UserRegister(c *gin.Context) {
return
}
req.Domain = "app"
res, err := service.AccountProvider.Register(context.Background(), &req)
res, err := service.AccountFieeProvider.Register(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
tokenInfo, err := service.AccountProvider.Login(context.Background(), &account.LoginRequest{
tokenInfo, err := service.AccountFieeProvider.Login(context.Background(), &account.LoginRequest{
Domain: req.Domain,
TelNum: req.TelNum,
Code: req.Code,
@ -303,7 +303,7 @@ func UserLogin(c *gin.Context) {
}
req.Ip = c.ClientIP()
req.Domain = "fontree"
res, err := service.AccountProvider.Login(c, &req)
res, err := service.AccountFieeProvider.Login(c, &req)
if err != nil {
service.Error(c, err)
return

View File

@ -0,0 +1,283 @@
package model
// 或签 会签
const (
AndSignType = "AND"
OrSignType = "OR"
ErrorSignType = "签核类型错误"
)
var OaTypeMap = map[string]string{
"leave": "leave", // 事假
"sick": "leave", // 病假
"annualLeave": "leave", // 年假
"dayOff": "leave", // 调休
"maritalLeave": "leave", // 婚假
"matingCheckLeave": "leave", // 孕检假
"maternityLeave": "leave", // 产假
"paternityLeave": "leave", // 陪产假
"parentalLeave": "leave", // 育儿假
"nursingLeave": "leave", // 独生子女护理假
"funeralLeave": "leave", // 丧假
"abortLeave": "leave", // 流产假
"breastFeedingLeave": "leave", // 哺乳假
"makeUp": "makeUp", // 补卡
"overTime": "overTime", // 加班
"outWork": "outWork", // 外勤
"handover": "handover", // 离职
"handover-1": "handover", // 离职
"handover-2": "handover", // 离职
"handover-3": "handover", // 离职
"handover-4": "handover", // 离职
"handover-5": "handover", // 离职
"handover-6": "handover", // 离职
"handover-7": "handover", // 离职
"handover-8": "handover", // 离职
"handover-9": "handover", // 离职
"handover-10": "handover", // 离职
"handover-11": "handover", // 离职
"handover-12": "handover", // 离职
"handover-13": "handover", // 离职
"handover-14": "handover", // 离职
"handover-15": "handover", // 离职
"handover-16": "handover", // 离职
"handover-17": "handover", // 离职
"handover-18": "handover", // 离职
"handover-19": "handover", // 离职
"handover-20": "handover", // 离职
"handover-21": "handover", // 离职
"handover-22": "handover", // 离职
"handover-23": "handover", // 离职
"handover-24": "handover", // 离职
"handover-25": "handover", // 离职
"handover-26": "handover", // 离职
"handover-27": "handover", // 离职
"handover-28": "handover", // 离职
"handover-29": "handover", // 离职
"handover-30": "handover", // 离职
"handover-31": "handover", // 离职
"handover-32": "handover", // 离职
"handover-33": "handover", // 离职
"handover-34": "handover", // 离职
"handover-35": "handover", // 离职
"handover-36": "handover", // 离职
"handover-37": "handover", // 离职
"handover-38": "handover", // 离职
"handover-39": "handover", // 离职
"handover-40": "handover", // 离职
"handover-41": "handover", // 离职
"handover-42": "handover", // 离职
"handover-43": "handover", // 离职
"handover-44": "handover", // 离职
"handover-45": "handover", // 离职
"handover-46": "handover", // 离职
"handover-47": "handover", // 离职
"handover-48": "handover", // 离职
"handover-49": "handover", // 离职
"handover-50": "handover", // 离职
"handover-51": "handover", // 离职
"handover-52": "handover", // 离职
"handover-53": "handover", // 离职
"turnover": "turnover", // 离职
"turnover-1": "turnover", // 离职
"turnover-2": "turnover", // 离职
"turnover-3": "turnover", // 离职
"turnover-4": "turnover", // 离职
"turnover-5": "turnover", // 离职
"turnover-6": "turnover", // 离职
"turnover-7": "turnover", // 离职
"turnover-8": "turnover", // 离职
"turnover-9": "turnover", // 离职
"turnover-10": "turnover", // 离职
"turnover-11": "turnover", // 离职
"turnover-12": "turnover", // 离职
"turnover-13": "turnover", // 离职
"turnover-14": "turnover", // 离职
"turnover-15": "turnover", // 离职
"turnover-16": "turnover", // 离职
"turnover-17": "turnover", // 离职
"turnover-18": "turnover", // 离职
"turnover-19": "turnover", // 离职
"turnover-20": "turnover", // 离职
"turnover-21": "turnover", // 离职
"turnover-22": "turnover", // 离职
"turnover-23": "turnover", // 离职
"turnover-24": "turnover", // 离职
"turnover-25": "turnover", // 离职
"turnover-26": "turnover", // 离职
"turnover-27": "turnover", // 离职
"turnover-28": "turnover", // 离职
"turnover-29": "turnover", // 离职
"turnover-30": "turnover", // 离职
"turnover-31": "turnover", // 离职
"turnover-32": "turnover", // 离职
"turnover-33": "turnover", // 离职
"turnover-34": "turnover", // 离职
"turnover-35": "turnover", // 离职
"turnover-36": "turnover", // 离职
"turnover-37": "turnover", // 离职
"turnover-38": "turnover", // 离职
"turnover-39": "turnover", // 离职
"turnover-40": "turnover", // 离职
"turnover-41": "turnover", // 离职
"turnover-42": "turnover", // 离职
"turnover-43": "turnover", // 离职
"turnover-44": "turnover", // 离职
"turnover-45": "turnover", // 离职
"turnover-46": "turnover", // 离职
"turnover-47": "turnover", // 离职
"turnover-48": "turnover", // 离职
"turnover-49": "turnover", // 离职
"turnover-50": "turnover", // 离职
"turnover-51": "turnover", // 离职
"turnover-52": "turnover", // 离职
"turnover-53": "turnover", // 离职
"businessTrip": "businessTrip", // 出差
"goOut": "goOut", // 外出
"annualLeaveApply": "leaveApply", // 年假申请
"maritalLeaveApply": "leaveApply", // 婚假申请
"matingCheckLeaveApply": "leaveApply", // 孕检假申请
"maternityLeaveApply": "leaveApply", // 产假申请
"paternityLeaveApply": "leaveApply", // 陪产假申请
"parentalLeaveApply": "leaveApply", // 育儿假申请
"nursingLeaveApply": "leaveApply", // 独生子女护理假申请
"funeralLeaveApply": "leaveApply", // 丧假申请
}
var EnglishMap = map[string]string{
"普通审批": "General approval",
"画作申请审批": "Approval of the painting application",
"画展包审批": "Approval of the exhibition package",
"画展包数量审批": "Approval of the number of painting packages",
"画展审批": "Approval of art exhibitions",
"画展包付款单申请": "Application for payment slip for exhibition package",
"画作润格审批": "Painting Runge Approval",
"画展包修改审批": "Approval of modification of the exhibition package",
"任命审批": "Appointment approval",
"人员增补申请": "Personnel Supplement Request",
"录用申请": "Job application",
"签到申请": "Check-in application",
"退回审批": "Return for approval",
"特殊画展包生成审批": "Approval of special painting package generation",
"事假": "Leave", // 事假
"病假": "sick leave", // 病假
"年假": "annual leave", // 年假
"调休": "Compensatory leave", // 调休
"婚假": "Marriage leave", // 婚假
"孕检假": "Pregnancy test leave", // 孕检假
"产假": "maternity leave", // 产假
"陪产假": "Paternity leave", // 陪产假
"育儿假": "Parental leave", // 育儿假
"独生子女护理假": "Nursing leave for an only child", // 独生子女护理假
"丧假": "Bereavement leave", // 丧假
"流产假": "Miscarriage leave", // 流产假
"哺乳假": "Breastfeeding leave", // 哺乳假
"补卡": "makeUp", // 补卡
"加班": "overtime", // 加班
"外勤": "out work", // 外勤
"离职申请": "Resignation application", // 离职
"离职交接": "Separation handover", // 离职交接
"出差": "business trip", // 出差
"外出": "Out", // 外出
"育儿假额度申请": "parentalLeaveApply", // 育儿假申请
"独生子女护理假申请": "nursingLeaveApply", // 独生子女护理假申请
"岗位申请": "employ application", //岗位申请
"上午": "AM",
"下午": "PM",
"开始时间不应晚于结束时间": "The start time should not be later than the end time",
"未申请假期余额": "Leave balance is not requested",
"请填写完整信息": "Please fill in the complete information",
"所选时间段已有申请": "There is already an application for the selected time period",
"请填写撤销理由": "Please fill in the reason for withdrawal",
"您今天已经对该审批人同类的审批发送过短信!": "You've already sent an SMS message today for an approval of the same type as that approver",
"当前状态无法修改": "The current status cannot be modified",
"请假时长超出范围": "The length of the leave is out of range",
"该请假类型申请时间不在本年度": "This leave type is not available in the current year",
"假期余额不足": "Insufficient leave balance",
"该请假类型申请时间不在本月": "This leave type is not available in this month",
"离职申请未完成": "The resignation application is not complete",
"用户已提交过离职申请": "The user has submitted a resignation request",
"用户已提交过离职交接": "The user has submitted an off-boarding handover",
"该工号已存在": "The job number already exists",
"考勤规则查询错误": "Attendance rule query error",
}
var ChineseTraditionalMap = map[string]string{
"普通审批": "普通審批",
"画作申请审批": "畫作申請審批",
"画展包审批": "畫展包審批",
"画展包数量审批": "畫展包數量審批",
"画展审批": "畫展審批",
"画展包付款单申请": "畫展包付款單申請",
"画作润格审批": "畫作潤格審批",
"画展包修改审批": "畫展包修改審批",
"任命审批": "任命審批",
"人员增补申请": "人員增補申請",
"录用申请": "錄用申請",
"签到申请": "簽到申請",
"退回审批": "退回審批",
"特殊画展包生成审批": "特殊畫展包生成審批",
"事假": "事假", // 事假
"病假": "病假", // 病假
"年假": "年假", // 年假
"调休": "調休", // 调休
"婚假": "婚假", // 婚假
"孕检假": "孕檢假", // 孕检假
"产假": "產假", // 产假
"陪产假": "陪產假", // 陪产假
"育儿假": "育兒假", // 育儿假
"独生子女护理假": "獨生子女護理假", // 独生子女护理假
"丧假": "喪假", // 丧假
"流产假": "流產假", // 流产假
"哺乳假": "哺乳假", // 哺乳假
"补卡": "補卡", // 补卡
"加班": "加班", // 加班
"外勤": "外勤", // 外勤
"离职申请": "離職申請", // 离职
"离职交接": "離職交接", // 离职交接
"出差": "出差", // 出差
"外出": "外出", // 外出
"育儿假额度申请": "育兒假額度申請", // 育儿假申请
"独生子女护理假申请": "獨生子女護理假申請", // 独生子女护理假申请
"岗位申请": "崗位申請", //岗位申请
"上午": "上午",
"下午": "下午",
"开始时间不应晚于结束时间": "開始時間不應晚於結束時間",
"未申请假期余额": "未申請假期餘額",
"请填写完整信息": "請填寫完整資訊",
"所选时间段已有申请": "所選時間段已有申請",
"请填写撤销理由": "請填寫撤銷理由",
"您今天已经对该审批人同类的审批发送过短信!": "您今天已經對該審批人同類的審批發送過簡訊",
"当前状态无法修改": "當前狀態無法修改",
"请假时长超出范围": "請假時長超出範圍",
"该请假类型申请时间不在本年度": "該請假類型申請時間不在本年度",
"假期余额不足": "假期餘額不足",
"该请假类型申请时间不在本月": "該請假類型申請時間不在本月",
"离职申请未完成": "離職申請未完成",
"用户已提交过离职申请": "使用者已提交過離職申請",
"用户已提交过离职交接": "使用者已提交過離職交接",
"该工号已存在": "該工號已存在",
"考勤规则查询错误": "考勤规则查询错误",
}
func GetOaType(k string) string {
return OaTypeMap[k]
}
func GetLanguageType(lang string, k string) string {
if lang == "EN" && EnglishMap[k] != "" {
return EnglishMap[k]
} else if lang == "ZhTW" && ChineseTraditionalMap[k] != "" {
return ChineseTraditionalMap[k]
} else {
return k
}
}

View File

@ -1,7 +1,12 @@
package service
import (
"fmt"
"fonchain-fiee/pkg/common"
"fonchain-fiee/pkg/e"
"fonchain-fiee/pkg/logic"
"fonchain-fiee/pkg/serializer"
"fonchain-fiee/pkg/service/approval/model"
"github.com/gin-gonic/gin"
"net/http"
)
@ -56,6 +61,43 @@ func Success1(c *gin.Context, msg string, datas ...interface{}) {
c.Abort()
}
// Error 统一错误返回
func ErrorWeb(c *gin.Context, code int, err error, msg ...string) {
fmt.Println("err:", err)
status := e.Failed
if code == e.NotLogin {
status = e.NotLogin
}
if code == e.NotLoginSqueeze {
status = e.NotLoginSqueeze
}
var msgStr string
if msg != nil {
msgStr = msg[0]
} else if err != nil {
msgStr = err.Error()
}
// 国际化
if e.VerifyMsgKey(msgStr) {
msgStr = logic.ConvertOaMsg(c, msgStr)
} else {
lang := c.Request.Header.Get("Accept-Language")
msgStr = model.GetLanguageType(lang, msgStr)
}
c.JSON(e.Success, serializer.Response{
Status: status,
Msg: msgStr,
Data: nil,
})
c.Abort()
}
// Error 统一错误返回
func Error(c *gin.Context, err error) {
@ -103,6 +145,19 @@ func Retry(c *gin.Context, err error) {
c.Abort()
}
// NotLoginRes 未登录的返回
func NotLoginRes(c *gin.Context, msg string) {
c.JSON(e.Success, serializer.Response{
Code: 401,
Status: 1,
Msg: msg,
Data: nil,
})
c.Abort()
}
func NotLoginError(c *gin.Context, err error) {
errMsg := ""

View File

@ -4,7 +4,7 @@ import (
"context"
"errors"
"fmt"
"fonchain-fiee/api/account"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/order"
"fonchain-fiee/pkg/model/login"
@ -260,7 +260,7 @@ func OrderRecordsList(c *gin.Context) {
continue
}
userInfo, _ := service.AccountProvider.Info(context.Background(), &account.InfoRequest{
userInfo, _ := service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
Domain: "app",
ID: userID,
})
@ -357,7 +357,7 @@ func ExportOrderInfo(c *gin.Context) {
continue
}
userInfo, _ := service.AccountProvider.Info(context.Background(), &account.InfoRequest{
userInfo, _ := service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
Domain: "app",
ID: userID,
})

View File

@ -2,10 +2,12 @@ package bundle
import (
"context"
"encoding/json"
"errors"
"fmt"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/order"
"fonchain-fiee/api/payment"
"fonchain-fiee/pkg/config"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
@ -127,6 +129,131 @@ func CreateStripeCheckoutSession(c *gin.Context) {
}
func CreateAntomPay(c *gin.Context) {
var req order.CreateStripeCheckoutSessionRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
// 获取 用户信息
userInfo := login.GetUserInfoFromC(c)
// 检查 订单信息
detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
OrderNo: req.OutTradeNo,
})
if detailErr != nil {
service.Error(c, detailErr)
return
}
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
// 判断 是否是 本人操作
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
service.Error(c, errors.New(common.NotMatchOrderInfo))
return
}
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
//金额校验
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
if orderAmountInCents != reqAmountInCents {
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
// 查询支付结果
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
})
if stripeInfosErr != nil {
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
return
}
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 {
for _, info := range stripeInfosRes.Infos {
if info.OutTradeNo == detail.OrderRecord.OrderNo && info.Status == "paid" {
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid,
Status: bundleModel.OrderPaid,
PayTime: common.GetBeijingTime(),
})
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid)
if updateOrderRecordErr != nil {
service.Error(c, detailErr)
return
}
service.Success(c, &service.Response{
Msg: common.HadPay,
Code: 0,
})
return
}
}
}
}
var antomReq payment.CreatePayRequest
antomReq.Payee = "Antom"
antomReq.Platform = "antom"
antomReq.ChannelType = "antom"
antomReq.ProductDescription = req.ProductDescription
antomReq.BusinessType = "useless"
antomReq.Domain = "fiee"
antomReq.Amount = req.ProductAllPrice
antomReq.Currency = req.ProductPriceCurrency
antomReq.OutTradeNo = req.OutTradeNo
antomReq.ReturnUrl = req.SuccessUrl
//调用微服务获取支付地址
result, err := service.PaymentProvider.CreatePay(context.Background(), &antomReq)
if err != nil {
service.Error(c, err)
return
}
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
fmt.Println("result.Url :", result.Url)
//更新订单状态
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid,
CheckoutSessionId: result.CheckoutSessionId,
CheckoutSessionUrl: result.Url,
})
fmt.Println("=====================================")
resp := &order.CreateStripeCheckoutSessionResponse{}
resp.CheckoutSessionUrl = result.Url
resp.CheckoutSessionId = result.CheckoutSessionId
fmt.Println("resp:", resp)
if updateOrderRecordErr != nil {
fmt.Println("有更新报错:", updateOrderRecordErr)
service.Error(c, updateOrderRecordErr)
return
}
service.Success(c, resp)
}
func StripeCheckoutSessionWebhook(c *gin.Context) {
var req order.GetCheckoutWebhookRequest
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, int64(65536))
@ -160,3 +287,82 @@ func StripeCheckoutSessionWebhook(c *gin.Context) {
}
service.Success(c)
}
func AntomWebhook(c *gin.Context) {
var err error
data, err := io.ReadAll(c.Request.Body)
if err != nil {
service.Error(c, err)
return
}
// 将数据转换为字符串形式并记录日志(如果数据过大则不记录)
dataStr := string(data)
fmt.Println("================ Antom回调参数", dataStr)
// 将读取到的数据解析为 map[string]interface{}
var reqMap map[string]interface{}
if err := json.Unmarshal(data, &reqMap); err != nil {
service.Error(c, err)
return
}
// 提取需要的字段
notifyType, _ := reqMap["notifyType"].(string)
resultMap, resultExists := reqMap["result"].(map[string]interface{})
if !resultExists {
service.Error(c, errors.New("result 字段不存在或类型错误"))
return
}
requestId, _ := reqMap["paymentRequestId"].(string)
paymentId, _ := reqMap["paymentId"].(string)
paymentTime, _ := reqMap["paymentTime"].(string)
// 提取 result 字段中的子字段
resultStatus, _ := resultMap["resultStatus"].(string)
resultMessage, _ := resultMap["resultMessage"].(string)
// 打印提取的字段(可以根据需要处理)
fmt.Println("通知类型:", notifyType)
fmt.Println("订单号:", requestId)
fmt.Println("支付ID:", paymentId)
fmt.Println("支付时间:", paymentTime)
fmt.Println("支付结果状态:", resultStatus)
fmt.Println("支付结果消息:", resultMessage)
/*
* S: notifyType 为PAYMENT_RESULT时表示支付成功 notifyType 为PAYMENT_PENDING时表示支付处理中
* F: 表示支付失败
* */
params := &payment.AntomNotifyPayRequest{
NotifyType: notifyType,
RequestId: requestId,
PaymentId: paymentId,
PaymentTime: paymentTime,
ResultStatus: resultStatus,
ResultMessage: resultMessage,
ChannelCode: "Antom", // fiee对应payment的渠道码
}
resp, err := service.PaymentProvider.AntomWebhook(c, params)
if err != nil {
service.Error(c, err)
return
}
fmt.Println("resp.Status:", resp.Status)
if resp.Status == "paid" {
//支付成功
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
OrderNo: resp.OutTradeNo,
PayTime: common.GetBeijingTime(),
Status: bundleModel.OrderPaid,
})
if updateStatusErr != nil {
service.Error(c, err)
return
}
}
service.Success(c)
}

View File

@ -6,21 +6,27 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/imports"
"fmt"
"fonchain-fiee/api/account"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/order"
"fonchain-fiee/api/payment"
pkConfig "fonchain-fiee/pkg/config"
"os"
)
var AccountProvider = new(account.AccountClientImpl)
var AccountFieeProvider = new(accountFiee.AccountFieeClientImpl)
var BundleProvider = new(bundle.BundleClientImpl)
var OrderProvider = new(order.OrderClientImpl)
var PaymentProvider = new(payment.PaymentCentClientImpl)
func init() {
config.SetConsumerService(BundleProvider)
config.SetConsumerService(OrderProvider)
config.SetConsumerService(AccountProvider)
config.SetConsumerService(PaymentProvider)
config.SetConsumerService(AccountFieeProvider)
if err := config.Load(); err != nil {
panic(err)

View File

@ -4,8 +4,10 @@ import (
"errors"
"fmt"
"fonchain-fiee/pkg/service"
"github.com/PuerkitoBio/goquery"
"github.com/gin-gonic/gin"
"net/http"
"strings"
"time"
)
@ -32,3 +34,105 @@ func ToRedirectRealUrlAdnRand(c *gin.Context) {
c.Redirect(http.StatusMovedPermanently, realUrl+fmt.Sprintf("?time=%d", time.Now().Unix()))
}
func ForwardTest(c *gin.Context) {
url := "https://stockanalysis.com/quote/otc/MINM/"
// Create HTTP client with timeout
client := &http.Client{
Timeout: 10 * time.Second,
}
// Make request
resp, err := client.Get(url)
if err != nil {
sendErrorResponse(c, http.StatusInternalServerError, "请求失败", err.Error())
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
sendErrorResponse(c, http.StatusInternalServerError, "请求失败", fmt.Sprintf("status code: %d", resp.StatusCode))
return
}
// Parse HTML
doc, err := goquery.NewDocumentFromReader(resp.Body)
if err != nil {
sendErrorResponse(c, http.StatusInternalServerError, "解析失败", err.Error())
return
}
var (
openValue string
volumeValue string
daysRangeValue string
week52Value string
marketCapValue string
changeValue []string
)
type StockData struct {
Open string `json:"Open"`
Volume string `json:"Volume"`
DaysRange string `json:"DaysRange"`
Week52Range string `json:"Week52Range"`
MarketCap string `json:"MarketCap"`
Change []string `json:"change"`
}
// Get price
priceDiv := doc.Find("div.text-4xl.font-bold.transition-colors.duration-300.inline-block").First()
price := strings.TrimSpace(priceDiv.Text())
// Get change
changeDiv := priceDiv.NextFiltered("div.font-semibold.inline-block.text-2xl.text-red-vivid")
change := strings.TrimSpace(changeDiv.Text())
if price != "" && change != "" {
changeValue = []string{price, change}
}
// Find other values in table
doc.Find("td").Each(func(i int, s *goquery.Selection) {
text := strings.TrimSpace(s.Text())
switch text {
case "Open":
openValue = strings.TrimSpace(s.Next().Text())
case "Volume":
volumeValue = strings.TrimSpace(s.Next().Text())
case "Day's Range":
daysRangeValue = strings.TrimSpace(s.Next().Text())
case "52-Week Range":
week52Value = strings.TrimSpace(s.Next().Text())
case "Market Cap":
marketCapValue = strings.TrimSpace(s.Next().Text())
}
})
// Check if all values were found
if openValue != "" && volumeValue != "" && daysRangeValue != "" &&
week52Value != "" && marketCapValue != "" && len(changeValue) == 2 {
c.JSON(http.StatusOK, StockData{
Open: openValue,
Volume: volumeValue,
DaysRange: daysRangeValue,
Week52Range: week52Value,
MarketCap: marketCapValue,
Change: changeValue,
})
} else {
c.JSON(http.StatusNotFound, gin.H{
"error": "未找到全部数据",
"Open": openValue,
"Volume": volumeValue,
"DaysRange": daysRangeValue,
"Week52Range": week52Value,
"MarketCap": marketCapValue,
"change": changeValue,
})
}
}
func sendErrorResponse(c *gin.Context, statusCode int, errorMsg string, detail string) {
c.JSON(statusCode, gin.H{
"error": errorMsg,
"detail": detail,
})
}

View File

@ -0,0 +1,77 @@
package aes
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"errors"
)
//高级加密标准Adevanced Encryption Standard ,AES
//16,24,32位字符串的话分别对应AES-128AES-192AES-256 加密方法
//key不能泄露
var PwdKey = []byte("tyfon918tyfon918")
//PKCS7 填充模式
func PKCS7Padding(ciphertext []byte, blockSize int) []byte {
padding := blockSize - len(ciphertext)%blockSize
//Repeat()函数的功能是把切片[]byte{byte(padding)}复制padding个然后合并成新的字节切片返回
padtext := bytes.Repeat([]byte{byte(padding)}, padding)
return append(ciphertext, padtext...)
}
//填充的反向操作,删除填充字符串
func PKCS7UnPadding(origData []byte) ([]byte, error) {
//获取数据长度
length := len(origData)
if length == 0 {
return nil, errors.New("加密字符串错误!")
} else {
//获取填充字符串长度
unpadding := int(origData[length-1])
//截取切片,删除填充字节,并且返回明文
return origData[:(length - unpadding)], nil
}
}
//实现加密
func AesEcrypt(origData []byte, key []byte) ([]byte, error) {
//创建加密算法实例
block, err := aes.NewCipher(key)
if err != nil {
return nil, err
}
//获取块的大小
blockSize := block.BlockSize()
//对数据进行填充,让数据长度满足需求
origData = PKCS7Padding(origData, blockSize)
//采用AES加密方法中CBC加密模式
blocMode := cipher.NewCBCEncrypter(block, key[:blockSize])
crypted := make([]byte, len(origData))
//执行加密
blocMode.CryptBlocks(crypted, origData)
return crypted, nil
}
//实现解密
func AesDeCrypt(cypted []byte, key []byte) ([]byte, error) {
//创建加密算法实例
block, err := aes.NewCipher(key)
if err != nil {
return nil, err
}
//获取块大小
blockSize := block.BlockSize()
//创建加密客户端实例
blockMode := cipher.NewCBCDecrypter(block, key[:blockSize])
origData := make([]byte, len(cypted))
//这个函数也可以用来解密
blockMode.CryptBlocks(origData, cypted)
//去除填充字符串
origData, err = PKCS7UnPadding(origData)
if err != nil {
return nil, err
}
return origData, err
}

View File

@ -0,0 +1,36 @@
package aes
import (
"encoding/hex"
"testing"
)
func TestSecret(t *testing.T) {
textA := "我是王德法"
textABytes := []byte(textA)
token, err := AesEcrypt(textABytes, PwdKey)
if err != nil {
t.Errorf("加密错误 %s", err.Error())
}
//fmt.Println(token)
tokenStr := hex.EncodeToString(token)
tokenByte, err := hex.DecodeString(tokenStr)
if err != nil {
t.Errorf("hex加密错误 %s", err.Error())
}
res, err := AesDeCrypt(tokenByte, PwdKey)
if err != nil {
t.Errorf("解密错误 %s", err.Error())
}
if string(res) == textA {
t.Logf("加解密通过 %s", string(res))
} else {
t.Errorf("解析内容不符合")
}
}

105
pkg/utils/secret/secret.go Normal file
View File

@ -0,0 +1,105 @@
package secret
import (
"encoding/hex"
"errors"
"fmt"
"fonchain-fiee/pkg/utils/secret/aes"
"strings"
)
func GetPositionCode(positionName string) string {
code := "other"
positionMap := map[string]string{"宣传部": "xcb", "鉴证科": "jzk", "经纪人": "jjr", "普通用户": "com"}
if v, ok := positionMap[positionName]; ok {
code = v
}
return code
}
func CombineSecret(position, name, toke string) (string, error) {
abc := position + "(~!@)" + name + "(~!@)" + toke
b, err := aes.AesEcrypt([]byte(abc), aes.PwdKey)
if err != nil {
return "", errors.New("解析错误")
}
return hex.EncodeToString(b), nil
}
func getToken(token string) (string, error) {
if strings.Contains(token, "(~!@)") == false {
return "", errors.New("解析错误")
}
str1 := strings.Split(token, "(~!@)")
if len(str1) != 3 {
return "", errors.New("解析数量错误")
}
return str1[2], nil
}
func GetJwtFromStr(authorization string) (string, error) {
tokenByte, err := hex.DecodeString(authorization)
if err != nil {
return "", err
}
defer func() {
if msg := recover(); msg != nil {
fmt.Println("panic信息:", msg, "---recover恢复---")
}
}()
token, err := aes.AesDeCrypt(tokenByte, aes.PwdKey)
if err != nil {
return "", err
}
//解密下
jwt, err := getToken(string(token))
if err != nil {
return "", err
}
return jwt, nil
}
func CommonCombineSecret(abc string) (string, error) {
b, err := aes.AesEcrypt([]byte(abc), aes.PwdKey)
if err != nil {
return "", errors.New("解析错误")
}
return hex.EncodeToString(b), nil
}
func CommonDec(abc string) (string, error) {
tokenByte, err := hex.DecodeString(abc)
if err != nil {
return "", err
}
defer func() {
if msg := recover(); msg != nil {
fmt.Println("panic信息:", msg, "---recover恢复---")
}
}()
token, err := aes.AesDeCrypt(tokenByte, aes.PwdKey)
if err != nil {
return "", err
}
return string(token), nil
}

View File

@ -0,0 +1,58 @@
package secret
import (
"fmt"
"testing"
)
func TestCodetInfo(t *testing.T) {
if GetPositionCode("鉴证科") != "jzk" {
t.Errorf("验证错误 ")
}
if GetPositionCode("鉴证科1") == "jzk" {
t.Errorf("验证错误 ")
}
}
func TestSecretInfo(t *testing.T) {
token := "abc"
position := "pppp"
name := "王德发"
str, err := CombineSecret(position, name, token)
if err != nil {
t.Errorf("组合加密错误 %s", err.Error())
return
}
t.Logf("加密之后 %s", str)
tokenExample, err := GetJwtFromStr(str)
if err != nil {
t.Errorf("获取token组合加密错误 %s", err.Error())
return
}
if tokenExample != token {
t.Errorf("解密不符合 %s", "解析内容不匹配")
}
t.Logf("加解密通过 %s", tokenExample)
}
func TestCommonCombineSecret(t *testing.T) {
a := "zzzz"
str, err := CommonCombineSecret(a)
if err != nil {
t.Errorf("组合加密错误 %s", err.Error())
return
}
t.Logf("加密之后 %s", str)
tokenExample, err := CommonDec(str)
fmt.Println(tokenExample, err)
}