优化mongo,封装count逻辑,处理objectId
This commit is contained in:
@@ -10,11 +10,22 @@ type ResponseEmpty struct {
|
||||
}
|
||||
|
||||
type Page struct {
|
||||
PageNum int `p:"pageNum"` //当前页码
|
||||
PageSize int `p:"pageSize"` //每页数
|
||||
Total int //总页数
|
||||
PageNum int64 `p:"pageNum"` //当前页码
|
||||
PageSize int64 `p:"pageSize"` //每页数
|
||||
Total int64 //总页数
|
||||
}
|
||||
|
||||
type OrderEnum string
|
||||
|
||||
const (
|
||||
Asc OrderEnum = "asc" // 正序
|
||||
Desc OrderEnum = "desc" // 倒序
|
||||
)
|
||||
|
||||
type OrderBy struct {
|
||||
Field string `p:"field"` //排序字段
|
||||
Order OrderEnum `p:"order"` //排序方式
|
||||
}
|
||||
type MongoBaseDO struct {
|
||||
Id bson.ObjectID `bson:"_id,omitempty" json:"id"` // MongoDB 默认 ID
|
||||
Creator interface{} `bson:"creator,omitempty" json:"creator"`
|
||||
|
||||
Reference in New Issue
Block a user