mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-13 04:40:24 +08:00
refactor: 新增base.Repo与base.App,重构repo与app层代码
This commit is contained in:
@@ -2,24 +2,15 @@ package repository
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/mongo/domain/entity"
|
||||
"mayfly-go/pkg/base"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type Mongo interface {
|
||||
base.Repo[*entity.Mongo]
|
||||
|
||||
// 分页获取列表
|
||||
GetList(condition *entity.MongoQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any]
|
||||
GetList(condition *entity.MongoQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error)
|
||||
|
||||
Count(condition *entity.MongoQuery) int64
|
||||
|
||||
// 根据条件获取
|
||||
Get(condition *entity.Mongo, cols ...string) error
|
||||
|
||||
// 根据id获取
|
||||
GetById(id uint64, cols ...string) *entity.Mongo
|
||||
|
||||
Insert(db *entity.Mongo)
|
||||
|
||||
Update(db *entity.Mongo)
|
||||
|
||||
Delete(id uint64)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user