2022-05-17 20:23:08 +08:00
|
|
|
package repository
|
|
|
|
|
|
|
|
|
|
import (
|
2022-09-09 18:26:08 +08:00
|
|
|
"mayfly-go/internal/mongo/domain/entity"
|
2022-06-02 17:41:11 +08:00
|
|
|
"mayfly-go/pkg/model"
|
2022-05-17 20:23:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Mongo interface {
|
|
|
|
|
// 分页获取列表
|
2023-07-01 14:34:42 +08:00
|
|
|
GetList(condition *entity.MongoQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any]
|
2022-05-17 20:23:08 +08:00
|
|
|
|
2022-10-26 20:49:29 +08:00
|
|
|
Count(condition *entity.MongoQuery) int64
|
2022-05-17 20:23:08 +08:00
|
|
|
|
|
|
|
|
// 根据条件获取
|
|
|
|
|
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)
|
|
|
|
|
}
|