add: 提交部分表设计
update: 1.所有model嵌入gorm公用model 2.所有model嵌入BaseModel
This commit is contained in:
@@ -226,8 +226,6 @@ func TestRoleAPI_Get(t *testing.T) {
|
||||
RoleName: "获取测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -273,8 +271,6 @@ func TestRoleAPI_Update(t *testing.T) {
|
||||
RoleName: "更新测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -318,8 +314,6 @@ func TestRoleAPI_Delete(t *testing.T) {
|
||||
RoleName: "删除测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -355,8 +349,6 @@ func TestRoleAPI_List(t *testing.T) {
|
||||
RoleName: fmt.Sprintf("列表测试角色_%d", i),
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(role)
|
||||
}
|
||||
@@ -392,8 +384,6 @@ func TestRoleAPI_AssignPermissions(t *testing.T) {
|
||||
RoleName: "权限分配测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -403,8 +393,6 @@ func TestRoleAPI_AssignPermissions(t *testing.T) {
|
||||
PermCode: "test:permission",
|
||||
PermType: constants.PermissionTypeMenu,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testPerm)
|
||||
|
||||
@@ -446,8 +434,6 @@ func TestRoleAPI_GetPermissions(t *testing.T) {
|
||||
RoleName: "获取权限测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -457,17 +443,13 @@ func TestRoleAPI_GetPermissions(t *testing.T) {
|
||||
PermCode: "get:permission:test",
|
||||
PermType: constants.PermissionTypeMenu,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testPerm)
|
||||
|
||||
rolePerm := &model.RolePermission{
|
||||
RoleID: testRole.ID,
|
||||
PermID: testPerm.ID,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
RoleID: testRole.ID,
|
||||
PermID: testPerm.ID,
|
||||
Status: constants.StatusEnabled,
|
||||
}
|
||||
env.db.Create(rolePerm)
|
||||
|
||||
@@ -502,8 +484,6 @@ func TestRoleAPI_RemovePermission(t *testing.T) {
|
||||
RoleName: "移除权限测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -513,17 +493,13 @@ func TestRoleAPI_RemovePermission(t *testing.T) {
|
||||
PermCode: "remove:permission:test",
|
||||
PermType: constants.PermissionTypeMenu,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testPerm)
|
||||
|
||||
rolePerm := &model.RolePermission{
|
||||
RoleID: testRole.ID,
|
||||
PermID: testPerm.ID,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
RoleID: testRole.ID,
|
||||
PermID: testPerm.ID,
|
||||
Status: constants.StatusEnabled,
|
||||
}
|
||||
env.db.Create(rolePerm)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user