You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

281 lines
11 KiB
Protocol Buffer

syntax = "proto3";
package approval;
import "github.com/mwitkow/go-proto-validators/validator.proto";
option go_package = "./;approval";
// The approval service definition.
service Approval {
rpc Create(CreateRequest) returns (ApprovalResponse) {};
rpc Detail(DetailRequest) returns (CreateRequest) {};
rpc Update(CreateRequest) returns (ApprovalResponse) {};
rpc Remove(RemoveRequest) returns (RemoveResponse) {};
rpc MyWork(ListRequest) returns (ListResponse) {};// 我的工作---待处理
rpc MySubmit(ListRequest) returns (ListResponse) {};// 我的提交
rpc NowLevelByInfo(NowLevelByInfoRequest) returns (WorkFlowResponse) {};
rpc Information(InformationRequest) returns (InformationResponse) {};
rpc Viewed(ViewedRequest) returns (ApprovalResponse) {};
rpc SetStatus(StatusRequest) returns (StatusResponse) {};
rpc DetailSetting(DetailSettingRequest) returns (SettingRequest) {};
rpc UpdateSetting(SettingRequest) returns (SettingResponse) {};
rpc CreateType(CreateTypeRequest) returns (TypeResponse) {};
rpc DetailType(TypeResponse) returns (CreateTypeRequest) {};
rpc UpdateType(CreateTypeRequest) returns (TypeResponse) {};
rpc AllType(CommonRequest) returns (AllTypeResponse) {};
rpc RemoveType(RemoveRequest) returns (StatusResponse) {};
}
message NowLevelByInfoRequest {
string Domain = 1 [json_name = "domain"];
uint64 ApprovalID = 2 [json_name = "ApprovalID"];
}
message WorkFlowResponse {
uint64 ID = 2 [json_name = "ID"];
string Reply = 3 [json_name = "Reply"];
uint64 Status = 5 [json_name = "status"];
uint64 UserID = 7 [json_name = "userID"];
}
message CommonRequest {
string Domain = 1 [json_name = "domain"];
uint64 Page = 2 [json_name = "Page"];
uint64 PageSize = 3 [json_name = "pageSize"];
}
message CreateTypeRequest {
string Domain = 1 [json_name = "domain"];
uint64 ID = 2 [json_name = "ID"];
string Title = 3 [json_name = "title"];
string Remark = 5 [json_name = "remark"];
string KeyWord = 6 [json_name = "keyWord"];
}
message TypeResponse {
uint64 ID = 1;
string Domain = 2;
}
message AllTypeResponse {
repeated CreateTypeRequest Data = 1;
uint64 Count = 2;
}
message StatusRequest {
string Domain = 1 [json_name = "domain"];
uint64 ID = 2 [json_name = "ID"];
string Reply = 3 [json_name = "Reply"];
uint64 WorkFlowId = 4 [json_name = "workFlowId"];
uint64 Status = 5 [json_name = "status",(validator.field) = {int_lt: 4,int_gt: 0,human_error: "状态非法"}];
uint64 Level = 6 [json_name = "level"];
}
message StatusResponse {
}
message ListRequest {
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "环境变量必须要有"} ];
uint64 PageSize = 2 [json_name = "PageSize"]; //
uint64 Page = 3 [json_name = "Page"]; //
uint64 Status = 4 [json_name = "status"];//0待审批 1-审批成功 2-拒绝 4-是所有
string Type = 5 [json_name = "type"]; //类型
uint64 UserID = 6 [json_name = "userID"]; //
}
message ListResponse {
uint64 Count = 1 [json_name = "count"];
repeated CreateRequest data = 2 [json_name = "data"];
}
message ViewedRequest {
string Domain = 1 [json_name = "domain"];
uint64 ID = 2 [json_name = "ID"];
uint64 UserID = 3 [json_name = "userID"];
}
message InformationRequest {
string Domain = 1 [json_name = "domain"];
uint64 UserID = 2 [json_name = "userID"];
string Type = 3 [json_name = "type"];
}
message Information {
uint64 Total = 1 [json_name = "total"]; // 已提交的审批 (总量)
uint64 DoingTotal = 2 [json_name = "doingTotal"]; // 正在审批数量
uint64 SuccessTotal = 3 [json_name = "successTotal"]; // 审批完成数量
uint64 FailTotal = 4 [json_name = "failTotal"]; // 审批未通过
}
message InformationResponse {
Information MySubmitInfo = 1 [json_name = "mySubmitInfo"]; // 我提交的;
Information SubmitMeInfo = 2 [json_name = "submitMeInfo"]; // 提交给我的;
Information DomainInfo = 3 [json_name = "domainInfo"]; // 大盘数据;
//Information CopyMeInfo = 4 [json_name = "copyMeInfo"]; // 抄送给我的;
}
message Bundle {
uint64 ID = 1 [json_name = "ID"];
string ReturnAt = 2 [json_name = "returnAt"];
string ReceivedAt = 3 [json_name = "receivedAt"];
uint64 ApplicationsNum = 4 [json_name = "applicationsNum"];
}
message Show {
uint64 ID =1 [json_name = "ID"];
uint64 ArtistNum =2 [json_name = "artistNum"];
string ShowAt =3 [json_name = "ShowAt"];
}
message ApprovalWork {
uint64 ID =1 [json_name = "ID"];
uint64 WorkID =2 [json_name = "WorkID"];
uint64 ApprovalID =3 [json_name = "ApprovalID"];
uint64 ArtworkID =4 [json_name = "artworkID"];
string ArtworkName =5 [json_name = "artworkName"];
string ArtistName =6 [json_name = "artistName"];
string ArtworkCover =7 [json_name = "artworkCover"];
uint64 ArtworkNumber =8 [json_name = "artworkNumber"];
}
message Work {
uint64 ID =1 [json_name = "ID"];
string ReturnAt = 2 [json_name = "returnAt"];
string ReceivedAt = 3 [json_name = "receivedAt"];
repeated ApprovalWork ApprovalWorks = 4 [json_name = "approvalWorks"];
}
message ApprovalExhibition {
uint64 ID =1 [json_name = "ID"];
uint64 ExhibitionID =2 [json_name = "exhibitionID"];
uint64 ApprovalID =3 [json_name = "approvalID"];
string PackageName =4 [json_name = "packageName"];
uint64 PackageID =5 [json_name = "packageID"];
uint64 PackageSize =6 [json_name = "packageSize"];
string PackageNumber =7 [json_name = "packageNumber"];
}
message Exhibition {
uint64 ID =1 [json_name = "ID"];
string ReceivedAt =2 [json_name = "receivedAt"];
string Address =3 [json_name = "address"];
uint64 PidApprovalID =4 [json_name = "pidApprovalID"];
repeated ApprovalExhibition ApprovalExhibitions = 5 [json_name = "approvalExhibitions"];
}
message CreateRequest {
uint64 ID = 1 [json_name = "ID"];
string Domain = 2 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "环境变量必须要有"} ];
uint64 Status = 3 [json_name = "status"];
string Type = 4 [json_name = "type",(validator.field) = {string_not_empty: true,human_error: "类型必须要有"} ];
uint64 SubmitterID = 7 [json_name = "submitterID"];//审批人
string SubmitterName = 8 [json_name = "submitterName"];
repeated CopyUser CopyUsers = 9 [json_name = "copyName"];//抄送人
string Content = 10 [json_name = "content"];//申请内容
string Reply = 11 [json_name = "reply"];//回复
bool CanView = 12 [json_name = "canView"];//是否可以阅读
Work Work = 13 [json_name = "work"];
Show Show = 14 [json_name = "show"];
Exhibition Exhibition = 15 [json_name = "exhibition"];
Bundle Bundle = 16 [json_name = "bundle"];
repeated ApprovalUser ApprovalUsers= 17 [json_name = "approvalUsers"];//审批的人
bool CanApproval = 18 [json_name = "canApproval"];//审批的人
repeated WorkFlow WorkFlows = 19 [json_name = "workFlows"];//审批的人
uint64 AllStatus = 20 [json_name = "allStatus"];//状态 0 1 2 3已阅读 4-待阅读
uint64 NowUserId = 21 [json_name = "nowUserId"];
string NowUserName = 22 [json_name = "nowUserName"];
uint64 Level = 23 [json_name = "level"];
uint64 NowLevel = 24 [json_name = "nowLevel"];
string CreatedAt = 25 [json_name = "createdAt"];
}
message WorkFlow {
uint64 ID = 1 [json_name = "ID"];
uint64 UserID = 3 [json_name = "userID"];
string Name = 4 [json_name = "name"];
uint64 Level = 5 [json_name = "level"];
uint64 Status = 6 [json_name = "status"];
string Reply = 7 [json_name = "reply"];
string OperatedAt = 8 [json_name = "operatedAt"];
}
message DetailRequest {
uint64 ID=1 [json_name = "ID"];
string Domain=2 [json_name = "domain"];
uint64 UserId=3 [json_name = "userId"];
}
message RemoveRequest {
repeated uint64 IDs=1 [json_name = "IDs"];
string Domain=2 [json_name = "domain"];
}
message ApprovalResponse {
uint64 ID=1 [json_name = "ID"];
bool Success=2 [json_name = "success"];
}
message RemoveResponse {
bool Success=1 [json_name = "success"];
}
message ApprovalExhibitionRemove {
bool Success=1 [json_name = "success"];
}
message ApprovalExhibitionRequest {
uint64 ID=1 [json_name = "ID"];
uint64 DeletedAt=2 [json_name = "deletedAt"];
string CreatedAt=3 [json_name = "createdAt"];
string UpdatedAt=4 [json_name = "updatedAt"];
uint64 ApprovalID=5 [json_name = "approvalID"];
uint64 ExhibitionID=6 [json_name = "exhibitionID"];
string ExhibitionName=7 [json_name = "exhibitionName"];
uint64 ArtworkID=8 [json_name = "artworkID"];
string ExhibitionSize=9 [json_name = "exhibitionSize"];
string ExhibitionNumber=10 [json_name = "exhibitionNumber"];
}
message ApprovalExhibitionDetail {
uint64 ID=1 [json_name = "ID"];
string Domain=2 [json_name = "domain"];
}
message CopyUser {
uint64 ID =1 [json_name = "ID"];
string Name =2 [json_name = "name"];
bool IsViewed =3 [json_name = "isViewed"];
}
message ApprovalUser {
uint64 ID =1 [json_name = "ID"];
string Name =2 [json_name = "name"];
string Level =3 [json_name = "Level"];
}
message SettingRequest {
uint64 ID = 1 [json_name = "ID"];
uint64 DeletedAt = 2 [json_name = "deletedAt"];
string CreatedAt = 3 [json_name = "createdAt"];
string UpdatedAt = 4 [json_name = "updatedAt"];
string KeyWord = 5 [json_name = "keyWord"];
repeated CopyUser CopyUsers = 6 [json_name = "copyUsers"];
repeated ApprovalUser ApprovalUsers = 9 [json_name = "approvalUsers"];
string Domain = 10 [json_name = "domain"];
}
message DetailSettingRequest {
string KeyWord=1 [json_name = "keyWord"];
string Domain=2 [json_name = "domain"];
}
message SettingResponse {
uint64 ID=1 [json_name = "ID"];
bool Success=2 [json_name = "success"];
}