forked from suyuan32/simple-admin-job
-
Notifications
You must be signed in to change notification settings - Fork 1
/
job.proto
115 lines (97 loc) · 2.22 KB
/
job.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
syntax = "proto3";
package job;
option go_package="./job";
message IDReq {
uint64 id = 1;
}
message TaskListResp {
uint64 total = 1;
repeated TaskInfo data = 2;
}
message TaskLogListReq {
uint64 page = 1;
uint64 page_size = 2;
optional uint64 task_id = 3;
optional uint32 result = 4;
}
// base message
message Empty {}
message TaskListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string name = 3;
optional string task_group = 4;
}
message TaskLogInfo {
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional int64 started_at = 4;
optional int64 finished_at = 5;
optional uint32 result = 6;
}
message TaskLogListResp {
uint64 total = 1;
repeated TaskLogInfo data = 2;
}
message TaskInfo {
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional uint32 status = 4;
optional string name = 5;
optional string task_group = 6;
optional string cron_expression = 7;
optional string pattern = 8;
optional string payload = 9;
}
message UUIDsReq {
repeated string ids = 1;
}
message UUIDReq {
string id = 1;
}
message BaseResp {
string msg = 1;
}
message PageInfoReq {
uint64 page = 1;
uint64 page_size = 2;
}
message IDsReq {
repeated uint64 ids = 1;
}
message BaseUUIDResp {
string id = 1;
string msg = 2;
}
message BaseIDResp {
uint64 id = 1;
string msg = 2;
}
service Job {
// group: base
rpc initDatabase(Empty) returns (BaseResp);
// Task management
// group: task
rpc createTask(TaskInfo) returns (BaseIDResp);
// group: task
rpc updateTask(TaskInfo) returns (BaseResp);
// group: task
rpc getTaskList(TaskListReq) returns (TaskListResp);
// group: task
rpc getTaskById(IDReq) returns (TaskInfo);
// group: task
rpc deleteTask(IDsReq) returns (BaseResp);
// TaskLog management
// group: tasklog
rpc createTaskLog(TaskLogInfo) returns (BaseIDResp);
// group: tasklog
rpc updateTaskLog(TaskLogInfo) returns (BaseResp);
// group: tasklog
rpc getTaskLogList(TaskLogListReq) returns (TaskLogListResp);
// group: tasklog
rpc getTaskLogById(IDReq) returns (TaskLogInfo);
// group: tasklog
rpc deleteTaskLog(IDsReq) returns (BaseResp);
}