feat: update
This commit is contained in:
@@ -20,8 +20,8 @@ type users struct{}
|
||||
// @Bind pagination query
|
||||
// @Bind query query
|
||||
func (ctl *users) List(ctx fiber.Ctx, pagination *requests.Pagination, query *UserListQuery) (*requests.Pager, error) {
|
||||
cond := model.UsersModel.BuildConditionWithKey(query.Keyword)
|
||||
return model.UsersModel.List(ctx.Context(), pagination, cond)
|
||||
cond := model.UsersModel().BuildConditionWithKey(query.Keyword)
|
||||
return model.UsersModel().List(ctx.Context(), pagination, cond)
|
||||
}
|
||||
|
||||
// Show user
|
||||
@@ -29,7 +29,7 @@ func (ctl *users) List(ctx fiber.Ctx, pagination *requests.Pagination, query *Us
|
||||
// @Router /admin/users/:id [get]
|
||||
// @Bind id path
|
||||
func (ctl *users) Show(ctx fiber.Ctx, id int64) (*model.Users, error) {
|
||||
return model.UsersModel.GetByID(ctx.Context(), id)
|
||||
return model.UsersModel().GetByID(ctx.Context(), id)
|
||||
}
|
||||
|
||||
// Articles show user bought articles
|
||||
@@ -38,7 +38,7 @@ func (ctl *users) Show(ctx fiber.Ctx, id int64) (*model.Users, error) {
|
||||
// @Bind id path
|
||||
// @Bind pagination query
|
||||
func (ctl *users) Articles(ctx fiber.Ctx, id int64, pagination *requests.Pagination) (*requests.Pager, error) {
|
||||
return model.PostsModel.Bought(ctx.Context(), id, pagination)
|
||||
return model.PostsModel().Bought(ctx.Context(), id, pagination)
|
||||
}
|
||||
|
||||
type UserBalance struct {
|
||||
@@ -51,7 +51,7 @@ type UserBalance struct {
|
||||
// @Bind id path
|
||||
// @Bind balance body
|
||||
func (ctl *users) Balance(ctx fiber.Ctx, id int64, balance *UserBalance) error {
|
||||
user, err := model.UsersModel.GetByID(ctx.Context(), id)
|
||||
user, err := model.UsersModel().GetByID(ctx.Context(), id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user