feat: switch to global auth and tenant route prefix

This commit is contained in:
2026-01-26 18:04:05 +08:00
parent 8addf6f900
commit cde4fb8594
25 changed files with 479 additions and 7196 deletions

View File

@@ -14,7 +14,7 @@ type Content struct{}
// List contents (Explore / Search)
//
// @Router /t/:tenantCode/v1/contents [get]
// @Router /v1/t/:tenantCode/contents [get]
// @Summary List contents
// @Description List contents with filtering and pagination
// @Tags Content
@@ -44,7 +44,7 @@ func (c *Content) List(
// Get content detail
//
// @Router /t/:tenantCode/v1/contents/:id<int> [get]
// @Router /v1/t/:tenantCode/contents/:id<int> [get]
// @Summary Get content detail
// @Description Get content detail by ID
// @Tags Content
@@ -61,7 +61,7 @@ func (c *Content) Get(ctx fiber.Ctx, id int64) (*dto.ContentDetail, error) {
// Get comments for a content
//
// @Router /t/:tenantCode/v1/contents/:id<int>/comments [get]
// @Router /v1/t/:tenantCode/contents/:id<int>/comments [get]
// @Summary Get comments
// @Description Get comments for a content
// @Tags Content
@@ -80,7 +80,7 @@ func (c *Content) ListComments(ctx fiber.Ctx, id int64, page int) (*requests.Pag
// Post a comment
//
// @Router /t/:tenantCode/v1/contents/:id<int>/comments [post]
// @Router /v1/t/:tenantCode/contents/:id<int>/comments [post]
// @Summary Post comment
// @Description Post a comment to a content
// @Tags Content
@@ -99,7 +99,7 @@ func (c *Content) CreateComment(ctx fiber.Ctx, id int64, form *dto.CommentCreate
// Like a comment
//
// @Router /t/:tenantCode/v1/comments/:id<int>/like [post]
// @Router /v1/t/:tenantCode/comments/:id<int>/like [post]
// @Summary Like comment
// @Description Like a comment
// @Tags Content
@@ -116,7 +116,7 @@ func (c *Content) LikeComment(ctx fiber.Ctx, id int64) error {
// Add like
//
// @Router /t/:tenantCode/v1/contents/:id<int>/like [post]
// @Router /v1/t/:tenantCode/contents/:id<int>/like [post]
// @Summary Add like
// @Tags Content
// @Param id path int64 true "Content ID"
@@ -130,7 +130,7 @@ func (c *Content) AddLike(ctx fiber.Ctx, id int64) error {
// Remove like
//
// @Router /t/:tenantCode/v1/contents/:id<int>/like [delete]
// @Router /v1/t/:tenantCode/contents/:id<int>/like [delete]
// @Summary Remove like
// @Tags Content
// @Param id path int64 true "Content ID"
@@ -144,7 +144,7 @@ func (c *Content) RemoveLike(ctx fiber.Ctx, id int64) error {
// Add favorite
//
// @Router /t/:tenantCode/v1/contents/:id<int>/favorite [post]
// @Router /v1/t/:tenantCode/contents/:id<int>/favorite [post]
// @Summary Add favorite
// @Tags Content
// @Param id path int64 true "Content ID"
@@ -158,7 +158,7 @@ func (c *Content) AddFavorite(ctx fiber.Ctx, id int64) error {
// Remove favorite
//
// @Router /t/:tenantCode/v1/contents/:id<int>/favorite [delete]
// @Router /v1/t/:tenantCode/contents/:id<int>/favorite [delete]
// @Summary Remove favorite
// @Tags Content
// @Param id path int64 true "Content ID"
@@ -172,7 +172,7 @@ func (c *Content) RemoveFavorite(ctx fiber.Ctx, id int64) error {
// List curated topics
//
// @Router /t/:tenantCode/v1/topics [get]
// @Router /v1/t/:tenantCode/topics [get]
// @Summary List topics
// @Description List curated topics
// @Tags Content