basePath: /t/{tenant_code}/v1 definitions: consts.Role: enum: - user - super_admin type: string x-enum-varnames: - RoleUser - RoleSuperAdmin consts.TenantStatus: enum: - pending_verify - verified - banned type: string x-enum-varnames: - TenantStatusPendingVerify - TenantStatusVerified - TenantStatusBanned consts.UserStatus: enum: - pending_verify - verified - banned type: string x-enum-varnames: - UserStatusPendingVerify - UserStatusVerified - UserStatusBanned dto.LoginForm: properties: password: type: string username: type: string type: object dto.LoginResponse: properties: token: type: string type: object dto.TenantExpireUpdateForm: properties: duration: enum: - 7 - 30 - 90 - 180 - 365 type: integer required: - duration type: object dto.TenantItem: properties: code: type: string config: items: type: integer type: array created_at: type: string expired_at: type: string id: type: integer name: type: string status: $ref: '#/definitions/consts.TenantStatus' status_description: type: string updated_at: type: string user_balance: type: integer user_count: type: integer user_id: type: integer users: items: $ref: '#/definitions/models.User' type: array uuid: type: string type: object dto.TenantStatusUpdateForm: properties: status: allOf: - $ref: '#/definitions/consts.TenantStatus' enum: - normal - disabled required: - status type: object dto.UserItem: properties: created_at: type: string deleted_at: $ref: '#/definitions/gorm.DeletedAt' id: type: integer metas: items: type: integer type: array owned: $ref: '#/definitions/models.Tenant' password: type: string roles: items: $ref: '#/definitions/consts.Role' type: array status: $ref: '#/definitions/consts.UserStatus' status_description: type: string tenants: items: $ref: '#/definitions/models.Tenant' type: array updated_at: type: string username: type: string verified_at: type: string type: object dto.UserStatistics: properties: count: type: integer status: $ref: '#/definitions/consts.UserStatus' status_description: type: string type: object dto.UserStatusUpdateForm: properties: status: allOf: - $ref: '#/definitions/consts.UserStatus' enum: - normal - disabled required: - status type: object gorm.DeletedAt: properties: time: type: string valid: description: Valid is true if Time is not NULL type: boolean type: object models.Tenant: properties: code: type: string config: items: type: integer type: array created_at: type: string expired_at: type: string id: type: integer name: type: string status: $ref: '#/definitions/consts.TenantStatus' updated_at: type: string user_id: type: integer users: items: $ref: '#/definitions/models.User' type: array uuid: type: string type: object models.User: properties: created_at: type: string deleted_at: $ref: '#/definitions/gorm.DeletedAt' id: type: integer metas: items: type: integer type: array owned: $ref: '#/definitions/models.Tenant' password: type: string roles: items: $ref: '#/definitions/consts.Role' type: array status: $ref: '#/definitions/consts.UserStatus' tenants: items: $ref: '#/definitions/models.Tenant' type: array updated_at: type: string username: type: string verified_at: type: string type: object requests.KV: properties: key: type: string value: {} type: object requests.Pager: properties: items: {} limit: type: integer page: type: integer total: type: integer type: object externalDocs: description: OpenAPI url: https://swagger.io/resources/open-api/ host: localhost:8080 info: contact: email: support@swagger.io name: UserName url: http://www.swagger.io/support description: This is a sample server celler server. license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html termsOfService: http://swagger.io/terms/ title: ApiDoc version: "1.0" paths: /super/v1/auth/login: post: consumes: - application/json parameters: - description: form in: body name: form required: true schema: $ref: '#/definitions/dto.LoginForm' produces: - application/json responses: "200": description: 成功 schema: $ref: '#/definitions/dto.LoginResponse' tags: - Super /super/v1/tenants: get: consumes: - application/json parameters: - in: query name: asc type: string - in: query name: desc type: string - in: query name: limit type: integer - in: query name: name type: string - in: query name: page type: integer - in: query name: status type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/requests.Pager' - properties: items: $ref: '#/definitions/dto.TenantItem' type: object summary: 租户列表 tags: - Super /super/v1/tenants/{tenantID}: patch: consumes: - application/json parameters: - description: TenantID format: int64 in: path name: tenantID required: true type: integer - description: Form in: body name: form required: true schema: $ref: '#/definitions/dto.TenantExpireUpdateForm' produces: - application/json responses: {} summary: 更新过期时间 tags: - Super /super/v1/tenants/{tenantID}/status: patch: consumes: - application/json parameters: - description: TenantID format: int64 in: path name: tenantID required: true type: integer - description: Form in: body name: form required: true schema: $ref: '#/definitions/dto.TenantStatusUpdateForm' produces: - application/json responses: {} summary: 更新租户状态 tags: - Super /super/v1/tenants/statuses: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/requests.KV' type: array summary: 租户状态列表 tags: - Super /super/v1/users: get: consumes: - application/json parameters: - in: query name: asc type: string - in: query name: desc type: string - in: query name: limit type: integer - in: query name: page type: integer - in: query name: status type: string - in: query name: tenantID type: integer - in: query name: username type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/requests.Pager' - properties: items: $ref: '#/definitions/dto.UserItem' type: object summary: 租户列表 tags: - Super /super/v1/users/{userID}/status: patch: consumes: - application/json parameters: - description: UserID format: int64 in: path name: userID required: true type: integer - description: Form in: body name: form required: true schema: $ref: '#/definitions/dto.UserStatusUpdateForm' produces: - application/json responses: {} summary: 更新用户状态 tags: - Super /super/v1/users/statistics: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/dto.UserStatistics' type: array summary: 用户统计信息 tags: - Super /super/v1/users/statuses: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/requests.KV' type: array summary: 用户状态列表 tags: - Super securityDefinitions: BasicAuth: type: basic swagger: "2.0"