feat: update ui

This commit is contained in:
yanghao05
2025-04-16 21:54:27 +08:00
parent 85ece3e899
commit 682a2397d2
17 changed files with 525 additions and 223 deletions

View File

@@ -27,7 +27,7 @@ type posts struct {
}
// List posts
// @Router / [get]
// @Router /api/posts [get]
// @Bind pagination query
// @Bind query query
// @Bind user local
@@ -37,14 +37,14 @@ func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
}
// Show
// @Router /show/:id [get]
// @Router /api/posts/show/:id [get]
// @Bind id path
func (ctl *posts) Show(ctx fiber.Ctx, id int64) (*model.Posts, error) {
return models.Posts.GetByID(ctx.Context(), id)
}
// Mine posts
// @Router /mine [get]
// @Router /api/posts/mine [get]
// @Bind pagination query
// @Bind query query
func (ctl *posts) Mine(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
@@ -56,7 +56,7 @@ func (ctl *posts) Mine(ctx fiber.Ctx, pagination *requests.Pagination, query *Li
var buyTpl string
// Buy
// @Router /buy/:id [get]
// @Router /api/posts/buy/:id [get]
// @Bind id path
func (ctl *posts) Buy(ctx fiber.Ctx, id int64) error {
var userId int64 = 1