add: 提交部分表设计
update: 1.所有model嵌入gorm公用model 2.所有model嵌入BaseModel
This commit is contained in:
@@ -178,8 +178,6 @@ func TestAccountAPI_Create(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypeRoot,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, rootAccount)
|
||||
|
||||
@@ -220,8 +218,6 @@ func TestAccountAPI_Create(t *testing.T) {
|
||||
UserType: constants.UserTypePlatform,
|
||||
ParentID: &rootAccount.ID,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, existingAccount)
|
||||
|
||||
@@ -290,8 +286,6 @@ func TestAccountAPI_Get(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, testAccount)
|
||||
|
||||
@@ -350,8 +344,6 @@ func TestAccountAPI_Update(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, testAccount)
|
||||
|
||||
@@ -397,8 +389,6 @@ func TestAccountAPI_Delete(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, testAccount)
|
||||
|
||||
@@ -436,8 +426,6 @@ func TestAccountAPI_List(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, account)
|
||||
}
|
||||
@@ -482,8 +470,6 @@ func TestAccountAPI_AssignRoles(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, testAccount)
|
||||
|
||||
@@ -492,8 +478,6 @@ func TestAccountAPI_AssignRoles(t *testing.T) {
|
||||
RoleName: "测试角色",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -537,8 +521,6 @@ func TestAccountAPI_GetRoles(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, testAccount)
|
||||
|
||||
@@ -547,8 +529,6 @@ func TestAccountAPI_GetRoles(t *testing.T) {
|
||||
RoleName: "获取角色测试",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
@@ -594,8 +574,6 @@ func TestAccountAPI_RemoveRole(t *testing.T) {
|
||||
Password: "hashedpassword",
|
||||
UserType: constants.UserTypePlatform,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
createTestAccount(t, env.db, testAccount)
|
||||
|
||||
@@ -604,8 +582,6 @@ func TestAccountAPI_RemoveRole(t *testing.T) {
|
||||
RoleName: "移除角色测试",
|
||||
RoleType: constants.RoleTypeSuper,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: 1,
|
||||
Updater: 1,
|
||||
}
|
||||
env.db.Create(testRole)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user