Skip to content

Commit ec04505

Browse files
committed
feat(server): refactor model
feat(server): refactor model
1 parent 3ccb5e3 commit ec04505

35 files changed

Lines changed: 404 additions & 250 deletions

server/desc/api/v1/manage/menu.api

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ type AddRequest {
1818
Component string `json:"component"`
1919
Icon string `json:"icon"`
2020
IconType string `json:"iconType"`
21-
ParentId uint64 `json:"parentId"`
21+
ParentId int64 `json:"parentId"`
2222
Status string `json:"status"`
2323
KeepAlive bool `json:"keepAlive"`
2424
Constant bool `json:"constant"`
25-
Order uint64 `json:"order"`
25+
Order int64 `json:"order"`
2626
HideInMenu bool `json:"hideInMenu"`
2727
Href string `json:"href,optional"`
2828
MultiTab bool `json:"multiTab,optional"`
@@ -55,7 +55,7 @@ type ListRequest {
5555
}
5656

5757
type SystemMenu {
58-
Id uint64 `json:"id"`
58+
Id int64 `json:"id"`
5959
ActiveMenu string `json:"activeMenu,optional"`
6060
MenuType string `json:"menuType"`
6161
MenuName string `json:"menuName"`
@@ -64,11 +64,11 @@ type SystemMenu {
6464
Component string `json:"component"`
6565
Icon string `json:"icon"`
6666
IconType string `json:"iconType"`
67-
ParentId uint64 `json:"parentId"`
67+
ParentId int64 `json:"parentId"`
6868
Status string `json:"status"`
6969
KeepAlive bool `json:"keepAlive"`
7070
Constant bool `json:"constant"`
71-
Order uint64 `json:"order"`
71+
Order int64 `json:"order"`
7272
HideInMenu bool `json:"hideInMenu"`
7373
Href string `json:"href,optional"`
7474
MultiTab bool `json:"multiTab,optional"`
@@ -88,25 +88,25 @@ type ListResponse {
8888
type TreeRequest {}
8989

9090
type TreeResponse {
91-
Id uint64 `json:"id"`
91+
Id int64 `json:"id"`
9292
Label string `json:"label"`
93-
PId uint64 `json:"pId"`
94-
Order uint64 `json:"-"`
93+
PId int64 `json:"pId"`
94+
Order int64 `json:"-"`
9595
Children []TreeResponse `json:"children"`
9696
}
9797

9898
type GetAllPagesRequest {
99-
RoleId uint64 `form:"roleId,optional"`
99+
RoleId int64 `form:"roleId,optional"`
100100
}
101101

102102
type DeleteRequest {
103-
Ids []uint64 `json:"ids"`
103+
Ids []int64 `json:"ids"`
104104
}
105105

106106
type DeleteResponse {}
107107

108108
type EditRequest {
109-
Id uint64 `json:"id"`
109+
Id int64 `json:"id"`
110110
ActiveMenu string `json:"activeMenu,optional"`
111111
MenuType string `json:"menuType"`
112112
MenuName string `json:"menuName"`
@@ -115,11 +115,11 @@ type EditRequest {
115115
Component string `json:"component"`
116116
Icon string `json:"icon"`
117117
IconType string `json:"iconType"`
118-
ParentId uint64 `json:"parentId"`
118+
ParentId int64 `json:"parentId"`
119119
Status string `json:"status"`
120120
KeepAlive bool `json:"keepAlive"`
121121
Constant bool `json:"constant"`
122-
Order uint64 `json:"order"`
122+
Order int64 `json:"order"`
123123
HideInMenu bool `json:"hideInMenu"`
124124
Href string `json:"href,optional"`
125125
MutiTab bool `json:"mutiTab,optional"`

server/desc/api/v1/manage/role.api

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
type ManageRole {
13-
Id uint64 `json:"id"`
13+
Id int64 `json:"id"`
1414
RoleName string `json:"roleName"`
1515
RoleCode string `json:"roleCode"`
1616
RoleDesc string `json:"roleDesc"`
@@ -34,7 +34,7 @@ type ListResponse {
3434
type GetAllRequest {}
3535

3636
type GetAllResponse {
37-
Id uint64 `json:"id"`
37+
Id int64 `json:"id"`
3838
RoleName string `json:"roleName"`
3939
RoleCode string `json:"roleCode"`
4040
}
@@ -49,7 +49,7 @@ type AddRequest {
4949
type AddResponse {}
5050

5151
type EditRequest {
52-
Id uint64 `json:"id"`
52+
Id int64 `json:"id"`
5353
RoleName string `json:"roleName"`
5454
RoleCode string `json:"roleCode"`
5555
RoleDesc string `json:"roleDesc"`
@@ -59,35 +59,35 @@ type EditRequest {
5959
type EditResponse {}
6060

6161
type DeleteRequest {
62-
Ids []uint64 `json:"ids"`
62+
Ids []int64 `json:"ids"`
6363
}
6464

6565
type DeleteResponse {}
6666

6767
type SetMenusRequest {
68-
RoleId uint64 `json:"roleId"`
69-
MenuIds []uint64 `json:"menuIds"`
68+
RoleId int64 `json:"roleId"`
69+
MenuIds []int64 `json:"menuIds"`
7070
}
7171

7272
type SetMenusResponse {}
7373

7474
type GetMenusRequest {
75-
RoleId uint64 `form:"roleId"`
75+
RoleId int64 `form:"roleId"`
7676
}
7777

7878
type GetMenusResponse {
79-
MenuIds []uint64 `json:"menuIds"`
79+
MenuIds []int64 `json:"menuIds"`
8080
}
8181

8282
type UpdateHomeRequest {
83-
RoleId uint64 `json:"roleId"`
83+
RoleId int64 `json:"roleId"`
8484
Home string `json:"home"`
8585
}
8686

8787
type UpdateHomeResponse {}
8888

8989
type GetHomeRequest {
90-
RoleId uint64 `form:"roleId"`
90+
RoleId int64 `form:"roleId"`
9191
}
9292

9393
@server (
@@ -117,7 +117,7 @@ service server {
117117
post /manage/setRoleMenus (SetMenusRequest) returns (SetMenusResponse)
118118

119119
@handler GetMenus
120-
get /manage/getRoleMenus (GetMenusRequest) returns ([]uint64)
120+
get /manage/getRoleMenus (GetMenusRequest) returns ([]int64)
121121

122122
@handler UpdateHome
123123
post /manage/updateRoleHome (UpdateHomeRequest) returns (UpdateHomeResponse)

server/desc/api/v1/manage/user.api

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
type ManageUser {
13-
Id uint64 `json:"id"`
13+
Id int64 `json:"id"`
1414
Username string `json:"username"`
1515
UserGender string `json:"userGender"`
1616
NickName string `json:"nickName"`
@@ -51,7 +51,7 @@ type AddRequest {
5151
type AddResponse {}
5252

5353
type EditRequest {
54-
Id uint64 `json:"id"`
54+
Id int64 `json:"id"`
5555
Username string `json:"username"`
5656
UserGender string `json:"userGender"`
5757
NickName string `json:"nickName"`
@@ -64,7 +64,7 @@ type EditRequest {
6464
type EditResponse {}
6565

6666
type DeleteRequest {
67-
Ids []uint64 `json:"ids"`
67+
Ids []int64 `json:"ids"`
6868
}
6969

7070
type DeleteResponse {}

server/desc/sql/manage_email.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE `manage_email` (
2-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
2+
`id` bigint NOT NULL AUTO_INCREMENT,
33
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
`create_by` bigint DEFAULT NULL,

server/desc/sql/manage_menu.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE `manage_menu` (
2-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
2+
`id` bigint NOT NULL AUTO_INCREMENT,
33
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
`create_by` bigint DEFAULT NULL,

server/desc/sql/manage_role.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE `manage_role` (
2-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
2+
`id` bigint NOT NULL AUTO_INCREMENT,
33
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
`create_by` bigint DEFAULT NULL,

server/desc/sql/manage_role_menu.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE `manage_role_menu` (
2-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
2+
`id` bigint NOT NULL AUTO_INCREMENT,
33
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
`create_by` bigint DEFAULT NULL,

server/desc/sql/manage_user.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE `manage_user` (
2-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
2+
`id` bigint NOT NULL AUTO_INCREMENT,
33
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
`create_by` bigint DEFAULT NULL,

server/desc/sql/manage_user_role.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE `manage_user_role` (
2-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
2+
`id` bigint NOT NULL AUTO_INCREMENT,
33
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
55
`create_by` bigint DEFAULT NULL,

server/desc/sql_migration/1_init.up.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ VALUES
4141
DROP TABLE IF EXISTS `manage_email`;
4242

4343
CREATE TABLE `manage_email` (
44-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
44+
`id` bigint NOT NULL AUTO_INCREMENT,
4545
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
4646
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
4747
`create_by` bigint DEFAULT NULL,
@@ -64,7 +64,7 @@ CREATE TABLE `manage_email` (
6464
DROP TABLE IF EXISTS `manage_menu`;
6565

6666
CREATE TABLE `manage_menu` (
67-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
67+
`id` bigint NOT NULL AUTO_INCREMENT,
6868
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
6969
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
7070
`create_by` bigint DEFAULT NULL,
@@ -125,7 +125,7 @@ VALUES
125125
DROP TABLE IF EXISTS `manage_role`;
126126

127127
CREATE TABLE `manage_role` (
128-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
128+
`id` bigint NOT NULL AUTO_INCREMENT,
129129
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
130130
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
131131
`create_by` bigint DEFAULT NULL,
@@ -148,7 +148,7 @@ VALUES
148148
DROP TABLE IF EXISTS `manage_role_menu`;
149149

150150
CREATE TABLE `manage_role_menu` (
151-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
151+
`id` bigint NOT NULL AUTO_INCREMENT,
152152
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
153153
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
154154
`create_by` bigint DEFAULT NULL,
@@ -200,7 +200,7 @@ VALUES
200200
DROP TABLE IF EXISTS `manage_user`;
201201

202202
CREATE TABLE `manage_user` (
203-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
203+
`id` bigint NOT NULL AUTO_INCREMENT,
204204
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
205205
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
206206
`create_by` bigint DEFAULT NULL,
@@ -226,7 +226,7 @@ VALUES
226226
DROP TABLE IF EXISTS `manage_user_role`;
227227

228228
CREATE TABLE `manage_user_role` (
229-
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
229+
`id` bigint NOT NULL AUTO_INCREMENT,
230230
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
231231
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
232232
`create_by` bigint DEFAULT NULL,

0 commit comments

Comments
 (0)