add: 提交部分表设计
update: 1.所有model嵌入gorm公用model 2.所有model嵌入BaseModel
This commit is contained in:
@@ -78,8 +78,6 @@ func (s *Service) Create(ctx context.Context, req *model.CreateAccountRequest) (
|
||||
ShopID: req.ShopID,
|
||||
ParentID: req.ParentID,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: currentUserID,
|
||||
Updater: currentUserID,
|
||||
}
|
||||
|
||||
if err := s.accountStore.Create(ctx, account); err != nil {
|
||||
|
||||
@@ -65,8 +65,6 @@ func (s *Service) Create(ctx context.Context, req *model.CreatePermissionRequest
|
||||
ParentID: req.ParentID,
|
||||
Sort: req.Sort,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: currentUserID,
|
||||
Updater: currentUserID,
|
||||
}
|
||||
|
||||
if err := s.permissionStore.Create(ctx, permission); err != nil {
|
||||
|
||||
@@ -43,8 +43,6 @@ func (s *Service) Create(ctx context.Context, req *model.CreateRoleRequest) (*mo
|
||||
RoleDesc: req.RoleDesc,
|
||||
RoleType: req.RoleType,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: currentUserID,
|
||||
Updater: currentUserID,
|
||||
}
|
||||
|
||||
if err := s.roleStore.Create(ctx, role); err != nil {
|
||||
@@ -187,11 +185,9 @@ func (s *Service) AssignPermissions(ctx context.Context, roleID uint, permIDs []
|
||||
}
|
||||
|
||||
rp := &model.RolePermission{
|
||||
RoleID: roleID,
|
||||
PermID: permID,
|
||||
Status: constants.StatusEnabled,
|
||||
Creator: currentUserID,
|
||||
Updater: currentUserID,
|
||||
RoleID: roleID,
|
||||
PermID: permID,
|
||||
Status: constants.StatusEnabled,
|
||||
}
|
||||
if err := s.rolePermissionStore.Create(ctx, rp); err != nil {
|
||||
return nil, fmt.Errorf("创建角色-权限关联失败: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user