feat: automate business upgrades and sync reviewed frontend

This commit is contained in:
Yvan
2026-11-06 15:48:35 +08:00
parent 7df74bc8e8
commit 9fccd804a3
58 changed files with 5689 additions and 259 deletions
+11
View File
@@ -2,6 +2,7 @@ package system
import (
"context"
"github.com/go-kratos/kratos/v3/errors"
"time"
)
@@ -32,6 +33,7 @@ type Authority struct {
DeletedAt *time.Time
AuthorityID uint
AuthorityName string
BusinessLevel *int
ParentID *uint
DataScope int
DefaultRouter string
@@ -39,6 +41,15 @@ type Authority struct {
Menus []*Menu
}
var ErrBusinessAuthorityProtected = errors.BadRequest("BUSINESS_AUTHORITY_PROTECTED", "商务内置角色不能删除")
func ValidateAuthorityDeletion(authority *Authority) error {
if authority != nil && authority.BusinessLevel != nil {
return ErrBusinessAuthorityProtected
}
return nil
}
type AuthorityUsecase struct{ AuthorityAccessRepo }
func NewAuthorityUsecase(repo AuthorityAccessRepo) *AuthorityUsecase {