feat: implement new structure

This commit is contained in:
2025-12-29 09:30:49 +08:00
parent 503b15aab7
commit ad52371028
116 changed files with 17579 additions and 1213 deletions

View File

@@ -0,0 +1,56 @@
package v1
import (
"quyun/v2/app/http/v1/dto"
"quyun/v2/app/services"
"github.com/gofiber/fiber/v3"
)
// @provider
type Tenant struct{}
// Get tenant public profile
//
// @Router /v1/tenants/:id [get]
// @Summary Get tenant profile
// @Description Get tenant public profile
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Success 200 {object} dto.TenantProfile
// @Bind id path
func (t *Tenant) Get(ctx fiber.Ctx, id string) (*dto.TenantProfile, error) {
return services.Tenant.GetPublicProfile(ctx.Context(), id)
}
// Follow a tenant
//
// @Router /v1/tenants/:id/follow [post]
// @Summary Follow tenant
// @Description Follow a tenant
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Success 200 {string} string "Followed"
// @Bind id path
func (t *Tenant) Follow(ctx fiber.Ctx, id string) error {
return services.Tenant.Follow(ctx.Context(), id)
}
// Unfollow a tenant
//
// @Router /v1/tenants/:id/follow [delete]
// @Summary Unfollow tenant
// @Description Unfollow a tenant
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Success 200 {string} string "Unfollowed"
// @Bind id path
func (t *Tenant) Unfollow(ctx fiber.Ctx, id string) error {
return services.Tenant.Unfollow(ctx.Context(), id)
}