Versions in this module Expand all Collapse all v0 v0.1.1 Mar 13, 2020 Changes in this version + func BasicInit() error + func GetUserID(username string) string + func GetUserIDByName(userName string) (userID string) + type Claims struct + AuthID int + ID int + Type string + Value string + func GetUserClaims(userName string) (claims []Claims) + type TAuth struct + ID bson.ObjectId + Password string + Role string + Username string + func (t *TAuth) AddAuth() error + func (t *TAuth) CheckAuth() bool + func (t *TAuth) DeleteAuthByName() error + func (t *TAuth) GetAuth() string + func (t *TAuth) GetRoles() string + type TBasic struct + ID bson.ObjectId + ItemNum int + RecordNum int + ShopNum int + UserNum int + var Basic TBasic + func (t *TBasic) AddItem() error + func (t *TBasic) AddShop() error + func (t *TBasic) AddUser() error + func (t *TBasic) DeleteItem() error + func (t *TBasic) DeleteShop() error + func (t *TBasic) DeleteUser() error + type TProduct struct + Brand string + ID bson.ObjectId + Name string + Price float64 + SaleCount int + Score float64 + StoreID bson.ObjectId + Timestamp int64 + func GetAllProducts() (Products []TProduct, err error) + func GetAllProductsByPage(pageNum int, pageSize int) (stores []TProduct, err error) + func GetProductsByPage(pageNum int, pageSize int, StoreID bson.ObjectId) (stores []TProduct, err error) + func (t *TProduct) AddProduct() error + func (t *TProduct) DeleteProduct() error + func (t *TProduct) GetProductByID() (Product TProduct, err error) + func (t *TProduct) GetProductsByStoreID() (Products []TProduct, err error) + func (t *TProduct) UpdateProduct() error + type TRecommend struct + PageNum int + PageSize int + Query string + UserID string + func (t *TRecommend) AddRecommend() error + func (t *TRecommend) AddRecommendByOrder() error + func (t *TRecommend) GetRecommend() ([]TProduct, error) + type TRecord struct + ItemID bson.ObjectId + Query string + RecordID bson.ObjectId + Status int + Timestamp int64 + UserID bson.ObjectId + func GetAllRecords() ([]TRecord, error) + func (t *TRecord) AddRecord() error + func (t *TRecord) GetRecordsByItemID() ([]TRecord, error) + func (t *TRecord) GetRecordsByUserID() ([]TRecord, error) + type TStores struct + City string + ID bson.ObjectId + Level float64 + Name string + NickName string + Timestamp int64 + func GetAllStores() (stores []TStores, err error) + func GetStoresByPage(pageNum int, pageSize int) (stores []TStores, err error) + func (t *TStores) AddStore() error + func (t *TStores) DeleteStore() error + func (t *TStores) GetStoreByStoreID() error + func (t *TStores) UpdateStore() error + type TUser struct + Age int + City string + Gender int + Historysum float64 + ID bson.ObjectId + Name string + NickName string + Timestamp int64 + func GetAllUsers() (users []TUser, err error) + func GetUsersByPage(pageNum int, pageSize int) (users []TUser, err error) + func (t *TUser) AddUser() error + func (t *TUser) DeleteUser() error + func (t *TUser) UpdateUser() error + type User struct + UserClaims []Claims + UserName string + type UserMsg struct + Avatar string + ID string + Introduction string + Name string + Roles []string v0.0.1 Dec 6, 2019