CategoryTree:
  get:
    operationId: getCategoryTree
    summary: 查询方案分类树
    security:
      - BearerAuth: []
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
      - name: keyword
        in: query
        schema:
          type: string
      - name: status
        in: query
        schema:
          $ref: '../components/schemas.yaml#/EnabledStatus'
    responses:
      '200':
        description: 分类树
        content:
          application/json:
            schema:
              $ref: '../components/schemas.yaml#/CategoryTreeResponse'
      '400':
        $ref: '../components/responses.yaml#/InvalidArgument'
      '401':
        $ref: '../components/responses.yaml#/AuthenticationError'
      '403':
        $ref: '../components/responses.yaml#/Forbidden'
      '404':
        $ref: '../components/responses.yaml#/NotFound'
      '409':
        $ref: '../components/responses.yaml#/Conflict'
      '500':
        $ref: '../components/responses.yaml#/InternalError'

Categories:
  post:
    operationId: createCategory
    summary: 新增方案分类
    security:
      - BearerAuth: []
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas.yaml#/CreateCategoryRequest'
    responses:
      '201':
        description: 分类创建成功
        content:
          application/json:
            schema:
              $ref: '../components/schemas.yaml#/CategoryResponse'
      '400':
        $ref: '../components/responses.yaml#/InvalidArgument'
      '401':
        $ref: '../components/responses.yaml#/AuthenticationError'
      '403':
        $ref: '../components/responses.yaml#/Forbidden'
      '404':
        $ref: '../components/responses.yaml#/NotFound'
      '409':
        $ref: '../components/responses.yaml#/Conflict'
      '500':
        $ref: '../components/responses.yaml#/InternalError'

Category:
  parameters:
    - name: id
      in: path
      required: true
      schema:
        $ref: '../components/schemas.yaml#/StringId'
  put:
    operationId: updateCategory
    summary: 编辑或移动方案分类
    security:
      - BearerAuth: []
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '../components/schemas.yaml#/UpdateCategoryRequest'
    responses:
      '200':
        description: 分类更新成功
        content:
          application/json:
            schema:
              $ref: '../components/schemas.yaml#/CategoryResponse'
      '400':
        $ref: '../components/responses.yaml#/InvalidArgument'
      '401':
        $ref: '../components/responses.yaml#/AuthenticationError'
      '403':
        $ref: '../components/responses.yaml#/Forbidden'
      '404':
        $ref: '../components/responses.yaml#/NotFound'
      '409':
        $ref: '../components/responses.yaml#/Conflict'
      '500':
        $ref: '../components/responses.yaml#/InternalError'
  delete:
    operationId: deleteCategory
    summary: 逻辑删除方案分类
    security:
      - BearerAuth: []
    parameters:
      - $ref: '../components/parameters.yaml#/XRequestId'
      - name: rowVersion
        in: query
        required: true
        schema:
          type: integer
          minimum: 0
    responses:
      '200':
        description: 分类逻辑删除成功
        content:
          application/json:
            schema:
              $ref: '../components/schemas.yaml#/DeleteCategoryResponse'
      '400':
        $ref: '../components/responses.yaml#/InvalidArgument'
      '401':
        $ref: '../components/responses.yaml#/AuthenticationError'
      '403':
        $ref: '../components/responses.yaml#/Forbidden'
      '404':
        $ref: '../components/responses.yaml#/NotFound'
      '409':
        $ref: '../components/responses.yaml#/Conflict'
      '500':
        $ref: '../components/responses.yaml#/InternalError'
