Documentation ¶
Overview ¶
Code generated by goctl. DO NOT EDIT.
Index ¶
Constants ¶
View Source
const UserCollectionName = "user"
Variables ¶
View Source
var ( ErrNotFound = mon.ErrNotFound ErrInvalidObjectId = errors.New("invalid objectId") )
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Mid int64 `bson:"mid,omitempty" json:"mid,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` Sex string `bson:"sex,omitempty" json:"sex,omitempty"` Face string `bson:"face,omitempty" json:"face,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type UserModel ¶
type UserModel interface { FindOneByUid(ctx context.Context, uid int64) (*User, error) DeleteByUid(ctx context.Context, uid int64) (int64, error) UpdateByUid(ctx context.Context, data *User) (*mongo.UpdateResult, error) AllocUserId(ctx context.Context, inc int64) (int64, error) // contains filtered or unexported methods }
UserModel is an interface to be customized, add more methods here, and implement the added methods in customUserModel.
Click to show internal directories.
Click to hide internal directories.