feat: update
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"quyun/app/models"
|
||||
"quyun/app/model"
|
||||
"quyun/app/requests"
|
||||
"quyun/database/schemas/public/model"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
@@ -21,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 := models.Users.BuildConditionWithKey(query.Keyword)
|
||||
return models.Users.List(ctx.Context(), pagination, cond)
|
||||
cond := model.UsersModel.BuildConditionWithKey(query.Keyword)
|
||||
return model.UsersModel.List(ctx.Context(), pagination, cond)
|
||||
}
|
||||
|
||||
// Show user
|
||||
@@ -30,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 models.Users.GetByID(ctx.Context(), id)
|
||||
return model.UsersModel.GetByID(ctx.Context(), id)
|
||||
}
|
||||
|
||||
// Articles show user bought articles
|
||||
@@ -39,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 models.Posts.Bought(ctx.Context(), id, pagination)
|
||||
return model.PostsModel.Bought(ctx.Context(), id, pagination)
|
||||
}
|
||||
|
||||
type UserBalance struct {
|
||||
@@ -52,5 +51,5 @@ type UserBalance struct {
|
||||
// @Bind id path
|
||||
// @Bind balance body
|
||||
func (ctl *users) Balance(ctx fiber.Ctx, id int64, balance *UserBalance) error {
|
||||
return models.Users.AddBalance(ctx.Context(), id, balance.Balance)
|
||||
return model.UsersModel.AddBalance(ctx.Context(), id, balance.Balance)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user