优化结构
This commit is contained in:
@@ -2,18 +2,18 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kra/internal/biz/system"
|
||||
|
||||
"kra/internal/biz"
|
||||
"kra/internal/service/dto"
|
||||
)
|
||||
|
||||
type AuthorityService struct{ uc *biz.AuthorityUsecase }
|
||||
type AuthorityService struct{ uc *system.AuthorityUsecase }
|
||||
|
||||
func NewAuthorityService(uc *biz.AuthorityUsecase) *AuthorityService {
|
||||
func NewAuthorityService(uc *system.AuthorityUsecase) *AuthorityService {
|
||||
return &AuthorityService{uc: uc}
|
||||
}
|
||||
|
||||
func authorityDTO(value *biz.Authority) *dto.AuthorityResponse {
|
||||
func authorityDTO(value *system.Authority) *dto.AuthorityResponse {
|
||||
out := convertAuthority(*value)
|
||||
children := make([]*dto.AuthorityResponse, 0, len(value.Children))
|
||||
for _, child := range value.Children {
|
||||
@@ -23,11 +23,11 @@ func authorityDTO(value *biz.Authority) *dto.AuthorityResponse {
|
||||
return out
|
||||
}
|
||||
|
||||
func authorityDomain(req *dto.AuthorityRequest) *biz.Authority {
|
||||
return &biz.Authority{AuthorityID: req.AuthorityID, AuthorityName: req.AuthorityName, ParentID: req.ParentID, DataScope: req.DataScope, DefaultRouter: req.DefaultRouter}
|
||||
func authorityDomain(req *dto.AuthorityRequest) *system.Authority {
|
||||
return &system.Authority{AuthorityID: req.AuthorityID, AuthorityName: req.AuthorityName, ParentID: req.ParentID, DataScope: req.DataScope, DefaultRouter: req.DefaultRouter}
|
||||
}
|
||||
|
||||
func authorityResponse(value *biz.Authority) *dto.AuthorityResponse {
|
||||
func authorityResponse(value *system.Authority) *dto.AuthorityResponse {
|
||||
var menus []*dto.MenuResponse
|
||||
if value.Menus != nil {
|
||||
menus = menuResponses(value.Menus)
|
||||
|
||||
Reference in New Issue
Block a user