refactor: 移除不必要的上下文调用,简化服务方法参数

This commit is contained in:
2025-12-30 22:14:22 +08:00
parent c8f6cb0b34
commit e5064db577
12 changed files with 67 additions and 67 deletions

View File

@@ -22,7 +22,7 @@ type Tenant struct{}
// @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)
return services.Tenant.GetPublicProfile(ctx, id)
}
// Follow a tenant
@@ -37,7 +37,7 @@ func (t *Tenant) Get(ctx fiber.Ctx, id string) (*dto.TenantProfile, error) {
// @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)
return services.Tenant.Follow(ctx, id)
}
// Unfollow a tenant
@@ -52,5 +52,5 @@ func (t *Tenant) Follow(ctx fiber.Ctx, id string) error {
// @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)
return services.Tenant.Unfollow(ctx, id)
}