Documentation
¶
Index ¶
- func FindAllSelected(filter bson.M, dbName string, tableName string) []bson.M
- func FindByPipe(pipe []bson.M, dbName string, tableName string) []bson.M
- func FindOneSelected(filter bson.M, dbName string, tableName string) bson.M
- func Setup()
- func UpdateAll(filter bson.M, update bson.M, dbName string, tableName string) int64
- type AccessToken
- type DishLib
- type DishesMongo
- type MongoUtils
- func (o *MongoUtils) FindMore(col string, filter bson.M) ([]bson.M, error)
- func (o *MongoUtils) FindMoreByPipe(col string, pipe []bson.M) ([]bson.M, error)
- func (o *MongoUtils) FindOne(col string, filter bson.M) (bson.M, error)
- func (o *MongoUtils) OpenConn() (con *mongo.Client)
- func (o *MongoUtils) SetDb(db string)
- func (o *MongoUtils) UpdateAll(col string, filter bson.M, update bson.M) (int64, error)
- type Switches
- type UserDishesMongo
- func (d UserDishesMongo) CreateRow() interface{}
- func (d UserDishesMongo) FindAll(filter bson.M) []bson.M
- func (d UserDishesMongo) FindOne(filter bson.M) bson.M
- func (d UserDishesMongo) GetTotalByOrdered() []bson.M
- func (d UserDishesMongo) GetUserDishesByOrdered(uid string) []bson.M
- func (d UserDishesMongo) UpdateAll(filter, update bson.M) int64
- type UserMongo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAllSelected ¶
Types ¶
type AccessToken ¶
type AccessToken struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `json:"name" bson:"name"` Token string `json:"token" bson:"token"` CreateTime time.Time `json:"createTime" bson:"createTime"` //创建时间 UpdateTime time.Time `json:"updateTime" bson:"updateTime"` //更新时间 }
func (AccessToken) CreateRow ¶
func (d AccessToken) CreateRow() interface{}
type DishLib ¶
type DishesMongo ¶
type DishesMongo struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `json:"name" bson:"name"` //菜品名称 Dsc string `json:"dsc" bson:"dsc"` Supplier string `json:"supplier" bson:"supplier"` //供应商 TypeA int32 `json:"typeA" bson:"typeA"` //1-lunch 2-dinner TypeB int32 `json:"typeB" bson:"typeB"` //1-自助餐 2-简餐 MealDay string `json:"mealDay" bson:"mealDay"` //用餐日 MealNum int `json:"mealNum" bson:"mealNum"` //菜品编号 CreateTime time.Time `json:"createTime" bson:"createTime"` //创建时间 UpdateTime time.Time `json:"updateTime" bson:"updateTime"` //创建时间 Status int32 `json:"status" bson:"status"` //0-开启 1-关闭 }
func (DishesMongo) CreateRow ¶
func (d DishesMongo) CreateRow() interface{}
type MongoUtils ¶
func (*MongoUtils) FindMoreByPipe ¶
func (*MongoUtils) OpenConn ¶
func (o *MongoUtils) OpenConn() (con *mongo.Client)
func (*MongoUtils) SetDb ¶
func (o *MongoUtils) SetDb(db string)
type Switches ¶
type Switches struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `json:"name" bson:"name"` Enable int `json:"enable" bson:"enable"` StartMealDay string `json:"startMealDay" bson:"startMealDay"` EndMealDay string `json:"endMealDay" bson:"endMealDay"` CreateTime time.Time `json:"createTime" bson:"createTime"` //创建时间 UpdateTime time.Time `json:"updateTime" bson:"updateTime"` //更新时间 }
type UserDishesMongo ¶
type UserDishesMongo struct { ID primitive.ObjectID `bson:"_id,omitempty"` Uid string `json:"uid" bson:"uid"` //用户id DishId string `json:"dishId" bson:"dishId"` //菜单id Name string `json:"name" bson:"name"` //菜品名称 Dsc string `json:"dsc" bson:"dsc"` //菜品明细 Supplier string `json:"supplier" bson:"supplier"` //供应商 TypeA int32 `json:"typeA" bson:"typeA"` //1-lunch 2-dinner 3-breakfast MealDay string `json:"mealDay" bson:"mealDay"` //用餐日 MealNum int32 `json:"mealNum" bson:"mealNum"` //菜品编号 OrderTime time.Time `json:"updateTime" bson:"updateTime"` //订餐时间 Status int32 `json:"status" bson:"status"` //0-订餐 1-取餐 BadEval bool `json:"badEval" bson:"badEval"` //差评 }
func (UserDishesMongo) CreateRow ¶
func (d UserDishesMongo) CreateRow() interface{}
func (UserDishesMongo) GetTotalByOrdered ¶
func (d UserDishesMongo) GetTotalByOrdered() []bson.M
func (UserDishesMongo) GetUserDishesByOrdered ¶
func (d UserDishesMongo) GetUserDishesByOrdered(uid string) []bson.M
可选的午餐和晚餐
type UserMongo ¶
type UserMongo struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `json:"name" bson:"name"` Email string `json:"email" bson:"email"` PassWord string `json:"password" bson:"password"` //登录密码 Type int `json:"type" bson:"type"` //1-管理员 2-外部用户 3-微信用户 Depart string `json:"depart" bson:"depart"` CreateTime time.Time `json:"createTime" bson:"createTime"` //创建时间 Unique string `json:"unique" bson:"unique"` //导入用户填邮箱,微信用户填userid }
func (UserMongo) ResetPassWord ¶
Click to show internal directories.
Click to hide internal directories.