Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type User ¶
type User struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"` //bson是用来创建后返回,omitempty是创建时自动创建 Mobile string `json:"mobile" bson:"mobile,omitempty"` Username string `json:"username" bson:"username,omitempty"` Password string `json:"password" bson:"password,omitempty"` Gender string `json:"gender" bson:"gender,omitempty"` Avatar string `json:"avatar" bson:"avatar,omitempty"` Addr string `json:"addr" bson:"addr,omitempty"` Email string `json:"email" bson:"email,omitempty"` Description string `json:"description" bson:"description,omitempty"` Status int `json:"status" bson:"status,omitempty"` CreatedAt time.Time `json:"created_at" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at,omitempty"` }
type UserService ¶
type UserService interface { GetUserInfoByName(username string) (user User, err error) GetUserList(offset, limit int64, search User) (user []User, count int64, err error) CreateUser(user *User) (err error) UpdateUser(user *User) (err error) DeleteUser(userID int) (err error) }
func NewService ¶
func NewService(mongo *mongo.Database) UserService
Click to show internal directories.
Click to hide internal directories.