mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-06 14:45:48 +08:00
refactor: code review
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
"mayfly-go/internal/sys/domain/repository"
|
||||
"mayfly-go/pkg/biz"
|
||||
"mayfly-go/pkg/gormx"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type msgRepoImpl struct{}
|
||||
|
||||
func newMsgRepo() repository.Msg {
|
||||
return new(msgRepoImpl)
|
||||
}
|
||||
|
||||
func (m *msgRepoImpl) GetPageList(condition *entity.Msg, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any] {
|
||||
qd := gormx.NewQuery(condition).WithCondModel(condition).WithOrderBy(orderBy...)
|
||||
return gormx.PageQuery(qd, pageParam, toEntity)
|
||||
}
|
||||
|
||||
func (m *msgRepoImpl) Insert(account *entity.Msg) {
|
||||
biz.ErrIsNil(gormx.Insert(account), "新增消息记录失败")
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import "mayfly-go/internal/sys/domain/repository"
|
||||
var (
|
||||
accountRepo = newAccountRepo()
|
||||
configRepo = newConfigRepo()
|
||||
msgRepo = newMsgRepo()
|
||||
resourceRepo = newResourceRepo()
|
||||
roleRepo = newRoleRepo()
|
||||
syslogRepo = newSyslogRepo()
|
||||
@@ -19,10 +18,6 @@ func GetConfigRepo() repository.Config {
|
||||
return configRepo
|
||||
}
|
||||
|
||||
func GetMsgRepo() repository.Msg {
|
||||
return msgRepo
|
||||
}
|
||||
|
||||
func GetResourceRepo() repository.Resource {
|
||||
return resourceRepo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user