openapi: 3.0.0
info:
  title: app-service API
  version: 1.0.0
  description: 业务API网关服务接口文档

paths:
  /app/user/auth:
    post:
      summary: 验证用户token
      description: 验证用户token的有效性
      security:
        - bearerAuth: []
      responses:
        '200':
          description: token有效
        '401':
          description: token无效或已过期

  /app/user/config:
    get:
      summary: 获取用户配置信息
      description: 获取指定类型或所有类型的用户配置信息
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: type
          schema:
            type: string
            enum: [database, log, all]
          description: 配置信息类型
      responses:
        '200':
          description: 成功获取配置信息
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigResponse'
        '400':
          description: 请求参数错误
        '401':
          description: 未授权或token无效

components:
  schemas:
    ConfigResponse:
      type: object
      properties:
        database:
          $ref: '#/components/schemas/DatabaseConfig'
        log:
          $ref: '#/components/schemas/LogConfig'

    DatabaseConfig:
      type: object
      properties:
        host:
          type: string
        port:
          type: integer
        username:
          type: string
        password:
          type: string
        database:
          type: string

    LogConfig:
      type: object
      properties:
        level:
          type: string
          enum: [debug, info, warn, error]
        path:
          type: string
        max_size:
          type: integer
        max_backups:
          type: integer
        max_age:
          type: integer

  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer