mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-16 05:46:34 +08:00
增加工单相关接口定义
This commit is contained in:
24
pkg/rpc/protos/models/model_user_ticket.proto
Normal file
24
pkg/rpc/protos/models/model_user_ticket.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_user_ticket_category.proto";
|
||||
import "models/model_user.proto";
|
||||
import "models/model_user_ticket_log.proto";
|
||||
|
||||
// 工单
|
||||
message UserTicket {
|
||||
int64 id = 1;
|
||||
int64 categoryId = 2;
|
||||
int64 userId = 3;
|
||||
string subject = 4;
|
||||
string body = 5;
|
||||
string status = 6;
|
||||
int64 createdAt = 7;
|
||||
int64 lastLogAt = 8;
|
||||
|
||||
UserTicketCategory userTicketCategory = 30;
|
||||
User user = 31;
|
||||
UserTicketLog latestUserTicketLog = 32;
|
||||
}
|
||||
11
pkg/rpc/protos/models/model_user_ticket_category.proto
Normal file
11
pkg/rpc/protos/models/model_user_ticket_category.proto
Normal file
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
// 工单分类
|
||||
message UserTicketCategory {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
bool isOn = 3;
|
||||
}
|
||||
22
pkg/rpc/protos/models/model_user_ticket_log.proto
Normal file
22
pkg/rpc/protos/models/model_user_ticket_log.proto
Normal file
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_admin.proto";
|
||||
import "models/model_user.proto";
|
||||
|
||||
// 工单日志
|
||||
message UserTicketLog {
|
||||
int64 id = 1;
|
||||
int64 adminId = 2;
|
||||
int64 userId = 3;
|
||||
int64 ticketId = 4;
|
||||
string status = 5;
|
||||
string comment = 6;
|
||||
int64 createdAt = 7;
|
||||
bool isReadonly = 8;
|
||||
|
||||
Admin admin = 30;
|
||||
User user = 31;
|
||||
}
|
||||
81
pkg/rpc/protos/service_user_ticket.proto
Normal file
81
pkg/rpc/protos/service_user_ticket.proto
Normal file
@@ -0,0 +1,81 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_user_ticket.proto";
|
||||
import "models/rpc_messages.proto";
|
||||
|
||||
// 工单服务
|
||||
service UserTicketService {
|
||||
// 创建工单
|
||||
rpc createUserTicket(CreateUserTicketRequest) returns (CreateUserTicketResponse);
|
||||
|
||||
// 修改工单
|
||||
rpc updateUserTicket(UpdateUserTicketRequest) returns (RPCSuccess);
|
||||
|
||||
// 删除工单
|
||||
rpc deleteUserTicket(DeleteUserTicketRequest) returns (RPCSuccess);
|
||||
|
||||
// 计算工单数量
|
||||
rpc countUserTickets(CountUserTicketsRequest) returns (RPCCountResponse);
|
||||
|
||||
// 列出单页工单
|
||||
rpc listUserTickets(ListUserTicketsRequest) returns (ListUserTicketsResponse);
|
||||
|
||||
// 查找单个工单
|
||||
rpc findUserTicket(FindUserTicketRequest) returns (FindUserTicketResponse);
|
||||
}
|
||||
|
||||
// 创建工单
|
||||
message CreateUserTicketRequest {
|
||||
int64 userTicketCategoryId = 1;
|
||||
string subject = 2;
|
||||
string body = 3;
|
||||
}
|
||||
|
||||
message CreateUserTicketResponse {
|
||||
int64 userTicketId = 1;
|
||||
}
|
||||
|
||||
// 修改工单
|
||||
message UpdateUserTicketRequest {
|
||||
int64 userTicketId = 1;
|
||||
int64 userTicketCategoryId = 2;
|
||||
string subject = 3;
|
||||
string body = 4;
|
||||
}
|
||||
|
||||
// 删除工单
|
||||
message DeleteUserTicketRequest {
|
||||
int64 userTicketId = 1;
|
||||
}
|
||||
|
||||
// 计算工单数量
|
||||
message CountUserTicketsRequest {
|
||||
int64 userId = 1;
|
||||
int64 userTicketCategoryId = 2;
|
||||
string status = 3;
|
||||
}
|
||||
|
||||
// 列出单页工单
|
||||
message ListUserTicketsRequest {
|
||||
int64 userId = 1;
|
||||
int64 userTicketCategoryId = 2;
|
||||
string status = 3;
|
||||
int64 offset = 4;
|
||||
int64 size = 5;
|
||||
}
|
||||
|
||||
message ListUserTicketsResponse {
|
||||
repeated UserTicket userTickets = 1;
|
||||
}
|
||||
|
||||
// 查找单个工单
|
||||
message FindUserTicketRequest {
|
||||
int64 userTicketId = 1;
|
||||
}
|
||||
|
||||
message FindUserTicketResponse {
|
||||
UserTicket userTicket = 1;
|
||||
}
|
||||
76
pkg/rpc/protos/service_user_ticket_category.proto
Normal file
76
pkg/rpc/protos/service_user_ticket_category.proto
Normal file
@@ -0,0 +1,76 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_user_ticket_category.proto";
|
||||
import "models/rpc_messages.proto";
|
||||
|
||||
// 工单分类服务
|
||||
service UserTicketCategoryService {
|
||||
// 创建分类
|
||||
rpc createUserTicketCategory(CreateUserTicketCategoryRequest) returns (CreateUserTicketCategoryResponse);
|
||||
|
||||
// 修改分类
|
||||
rpc updateUserTicketCategory(UpdateUserTicketCategoryRequest) returns (RPCSuccess);
|
||||
|
||||
// 删除分类
|
||||
rpc deleteUserTicketCategory(DeleteUserTicketCategoryRequest) returns (RPCSuccess);
|
||||
|
||||
// 查找所有分类
|
||||
rpc findAllUserTicketCategories(FindAllUserTicketCategoriesRequest) returns (FindAllUserTicketCategoriesResponse);
|
||||
|
||||
// 查找所有启用中的分类
|
||||
rpc findAllOnUserTicketCategories(FindAllOnUserTicketCategoriesRequest) returns (FindAllOnUserTicketCategoriesResponse);
|
||||
|
||||
// 查询单个分类
|
||||
rpc findUserTicketCategory(FindUserTicketCategoryRequest) returns (FindUserTicketCategoryResponse);
|
||||
}
|
||||
|
||||
// 创建分类
|
||||
message CreateUserTicketCategoryRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CreateUserTicketCategoryResponse {
|
||||
int64 userTicketCategoryId = 1;
|
||||
}
|
||||
|
||||
// 修改分类
|
||||
message UpdateUserTicketCategoryRequest {
|
||||
int64 userTicketCategoryId = 1;
|
||||
string name = 2;
|
||||
bool isOn = 3;
|
||||
}
|
||||
|
||||
// 删除分类
|
||||
message DeleteUserTicketCategoryRequest {
|
||||
int64 userTicketCategoryId = 1;
|
||||
}
|
||||
|
||||
// 查找所有分类
|
||||
message FindAllUserTicketCategoriesRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindAllUserTicketCategoriesResponse {
|
||||
repeated UserTicketCategory userTicketCategories = 1;
|
||||
}
|
||||
|
||||
// 查找所有启用中的分类
|
||||
message FindAllOnUserTicketCategoriesRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindAllOnUserTicketCategoriesResponse {
|
||||
repeated UserTicketCategory userTicketCategories = 1;
|
||||
}
|
||||
|
||||
// 查询单个分类
|
||||
message FindUserTicketCategoryRequest {
|
||||
int64 userTicketCategoryId = 1;
|
||||
}
|
||||
|
||||
message FindUserTicketCategoryResponse {
|
||||
UserTicketCategory userTicketCategory = 1;
|
||||
}
|
||||
54
pkg/rpc/protos/service_user_ticket_log.proto
Normal file
54
pkg/rpc/protos/service_user_ticket_log.proto
Normal file
@@ -0,0 +1,54 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_user_ticket_log.proto";
|
||||
import "models/rpc_messages.proto";
|
||||
|
||||
// 工单日志服务
|
||||
service UserTicketLogService {
|
||||
// 创建日志
|
||||
rpc createUserTicketLog(CreateUserTicketLogRequest) returns (CreateUserTicketLogResponse);
|
||||
|
||||
// 删除日志
|
||||
rpc deleteUserTicketLog(DeleteUserTicketLogRequest) returns (RPCSuccess);
|
||||
|
||||
// 查询日志数量
|
||||
rpc countUserTicketLogs(CountUserTicketLogsRequest) returns (RPCCountResponse);
|
||||
|
||||
// 列出单页日志
|
||||
rpc listUserTicketLogs(ListUserTicketLogsRequest) returns (ListUserTicketLogsResponse);
|
||||
}
|
||||
|
||||
// 创建日志
|
||||
message CreateUserTicketLogRequest {
|
||||
int64 userTicketId = 1;
|
||||
string status = 2;
|
||||
string comment = 3;
|
||||
}
|
||||
|
||||
message CreateUserTicketLogResponse {
|
||||
int64 userTicketLogId = 1;
|
||||
}
|
||||
|
||||
// 删除日志
|
||||
message DeleteUserTicketLogRequest {
|
||||
int64 userTicketLogId = 1;
|
||||
}
|
||||
|
||||
// 查询日志数量
|
||||
message CountUserTicketLogsRequest {
|
||||
int64 userTicketId = 1;
|
||||
}
|
||||
|
||||
// 列出单页日志
|
||||
message ListUserTicketLogsRequest {
|
||||
int64 userTicketId = 1;
|
||||
int64 offset = 2;
|
||||
int64 size = 3;
|
||||
}
|
||||
|
||||
message ListUserTicketLogsResponse {
|
||||
repeated UserTicketLog userTicketLogs = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user