feat: align ids to int64

This commit is contained in:
2026-01-08 09:57:04 +08:00
parent a1de16bc01
commit d98f41f1ac
39 changed files with 298 additions and 339 deletions

View File

@@ -14,19 +14,19 @@ type Tenant struct{}
// List creator contents
//
// @Router /v1/creators/:id/contents [get]
// @Router /v1/creators/:id<int>/contents [get]
// @Summary List creator contents
// @Description List contents of a specific creator
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Param id path int64 true "Tenant ID"
// @Param page query int false "Page"
// @Param limit query int false "Limit"
// @Success 200 {object} requests.Pager
// @Bind id path
// @Bind filter query
func (t *Tenant) ListContents(ctx fiber.Ctx, id string, filter *dto.ContentListFilter) (*requests.Pager, error) {
func (t *Tenant) ListContents(ctx fiber.Ctx, id int64, filter *dto.ContentListFilter) (*requests.Pager, error) {
if filter == nil {
filter = &dto.ContentListFilter{}
}
@@ -53,17 +53,17 @@ func (t *Tenant) List(ctx fiber.Ctx, filter *dto.TenantListFilter) (*requests.Pa
// Get tenant public profile
//
// @Router /v1/tenants/:id [get]
// @Router /v1/tenants/:id<int> [get]
// @Summary Get tenant profile
// @Description Get tenant public profile
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Param id path int64 true "Tenant ID"
// @Success 200 {object} dto.TenantProfile
// @Bind user local key(__ctx_user)
// @Bind id path
func (t *Tenant) Get(ctx fiber.Ctx, user *models.User, id string) (*dto.TenantProfile, error) {
func (t *Tenant) Get(ctx fiber.Ctx, user *models.User, id int64) (*dto.TenantProfile, error) {
uid := int64(0)
if user != nil {
uid = user.ID
@@ -73,32 +73,32 @@ func (t *Tenant) Get(ctx fiber.Ctx, user *models.User, id string) (*dto.TenantPr
// Follow a tenant
//
// @Router /v1/tenants/:id/follow [post]
// @Router /v1/tenants/:id<int>/follow [post]
// @Summary Follow tenant
// @Description Follow a tenant
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Param id path int64 true "Tenant ID"
// @Success 200 {string} string "Followed"
// @Bind user local key(__ctx_user)
// @Bind id path
func (t *Tenant) Follow(ctx fiber.Ctx, user *models.User, id string) error {
func (t *Tenant) Follow(ctx fiber.Ctx, user *models.User, id int64) error {
return services.Tenant.Follow(ctx, user.ID, id)
}
// Unfollow a tenant
//
// @Router /v1/tenants/:id/follow [delete]
// @Router /v1/tenants/:id<int>/follow [delete]
// @Summary Unfollow tenant
// @Description Unfollow a tenant
// @Tags TenantPublic
// @Accept json
// @Produce json
// @Param id path string true "Tenant ID"
// @Param id path int64 true "Tenant ID"
// @Success 200 {string} string "Unfollowed"
// @Bind user local key(__ctx_user)
// @Bind id path
func (t *Tenant) Unfollow(ctx fiber.Ctx, user *models.User, id string) error {
func (t *Tenant) Unfollow(ctx fiber.Ctx, user *models.User, id int64) error {
return services.Tenant.Unfollow(ctx, user.ID, id)
}