mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: 后端包结构重构、去除无用的文件
This commit is contained in:
17
server/internal/sys/domain/repository/account.go
Normal file
17
server/internal/sys/domain/repository/account.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type Account interface {
|
||||
// 根据条件获取账号信息
|
||||
GetAccount(condition *entity.Account, cols ...string) error
|
||||
|
||||
GetPageList(condition *entity.Account, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult
|
||||
|
||||
Insert(account *entity.Account)
|
||||
|
||||
Update(account *entity.Account)
|
||||
}
|
||||
12
server/internal/sys/domain/repository/msg.go
Normal file
12
server/internal/sys/domain/repository/msg.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type Msg interface {
|
||||
GetPageList(condition *entity.Msg, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult
|
||||
|
||||
Insert(msg *entity.Msg)
|
||||
}
|
||||
21
server/internal/sys/domain/repository/resource.go
Normal file
21
server/internal/sys/domain/repository/resource.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
)
|
||||
|
||||
type Resource interface {
|
||||
// 获取资源列表
|
||||
GetResourceList(condition *entity.Resource, toEntity interface{}, orderBy ...string)
|
||||
|
||||
GetById(id uint64, cols ...string) *entity.Resource
|
||||
|
||||
GetByIdIn(ids []uint64, toEntity interface{}, orderBy ...string)
|
||||
|
||||
Delete(id uint64)
|
||||
|
||||
GetByCondition(condition *entity.Resource, cols ...string) error
|
||||
|
||||
// 获取账号资源列表
|
||||
GetAccountResources(accountId uint64, toEntity interface{})
|
||||
}
|
||||
31
server/internal/sys/domain/repository/role.go
Normal file
31
server/internal/sys/domain/repository/role.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type Role interface {
|
||||
GetPageList(condition *entity.Role, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult
|
||||
|
||||
Delete(id uint64)
|
||||
|
||||
// 获取角色拥有的资源id数组,从role_resource表获取
|
||||
GetRoleResourceIds(roleId uint64) []uint64
|
||||
|
||||
GetRoleResources(roleId uint64, toEntity interface{})
|
||||
|
||||
SaveRoleResource(rr *entity.RoleResource)
|
||||
|
||||
DeleteRoleResource(roleId uint64, resourceId uint64)
|
||||
|
||||
// 获取账号拥有的角色id数组,从account_role表获取
|
||||
GetAccountRoleIds(accountId uint64) []uint64
|
||||
|
||||
SaveAccountRole(ar *entity.AccountRole)
|
||||
|
||||
DeleteAccountRole(accountId, roleId uint64)
|
||||
|
||||
// 获取账号角色信息列表
|
||||
GetAccountRoles(accountId uint64, toEntity interface{})
|
||||
}
|
||||
Reference in New Issue
Block a user