35 lines
825 B
Go
35 lines
825 B
Go
package tenant
|
|
|
|
import (
|
|
"quyun/v2/app/http/tenant/dto"
|
|
"quyun/v2/database/models"
|
|
|
|
"github.com/gofiber/fiber/v3"
|
|
)
|
|
|
|
// me provides tenant context introspection endpoints (current tenant/user/tenant_user).
|
|
//
|
|
// @provider
|
|
type me struct{}
|
|
|
|
// get
|
|
//
|
|
// @Summary 当前租户上下文信息
|
|
// @Tags Tenant
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param tenantCode path string true "Tenant Code"
|
|
// @Success 200 {object} dto.MeResponse
|
|
//
|
|
// @Router /t/:tenantCode/v1/me [get]
|
|
// @Bind tenant local key(tenant)
|
|
// @Bind user local key(user)
|
|
// @Bind tenantUser local key(tenant_user)
|
|
func (*me) get(ctx fiber.Ctx, tenant *models.Tenant, user *models.User, tenantUser *models.TenantUser) (*dto.MeResponse, error) {
|
|
return &dto.MeResponse{
|
|
Tenant: tenant,
|
|
User: user,
|
|
TenantUser: tenantUser,
|
|
}, nil
|
|
}
|