refactor: 移除不必要的上下文调用,简化服务方法参数
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user