openapi: 3.0.3
info:
  title: 用户奖励内容查询 API
  description: 查询用户奖励内容及关联合作伙伴信息的API接口
  version: 1.0.0
  contact:
    name: API Support
servers:
  - url: https://your-domain.com
    description: 生产环境
  - url: https://staging.your-domain.com
    description: 测试环境

paths:
  /v1/user/rewardContent/{rewardContentCode}:
    get:
      tags:
        - 用户奖励
      summary: 查询用户奖励内容
      description: 根据奖励内容代码查询奖励内容详情及关联的合作伙伴信息
      operationId: getUserRewardContent
      security:
        - BearerAuth: []
      parameters:
        - name: rewardContentCode
          in: path
          required: true
          description: 奖励内容代码
          schema:
            type: string
            example: "HILTON_POINTS"
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RewardContentResponse'
              example:
                retCode: 0
                message: "success"
                data:
                  code: "HILTON_POINTS"
                  name: "希尔顿积分"
                  description: "希尔顿酒店积分奖励"
                  type: "points"
                  value: 1000
                  unit: "积分"
                  logo_url: "https://example.com/hilton-logo.png"
                  image_url: "https://example.com/hilton-image.png"
                  partner_code: "HILTON"
                  partner:
                    code: "HILTON"
                    name: "希尔顿"
                    full_name: "希尔顿酒店集团"
                    member_name: "希尔顿荣誉客会"
                    description: "全球知名酒店集团"
                    type: "merchant"
                    status: "active"
                    card_color_1: "#FF6B6B"
                    card_color_2: "#4ECDC4"
                    theme_color: "#FF6B6B"
                    small_logo_url: "https://example.com/hilton-small-logo.png"
                    large_logo_url: "https://example.com/hilton-large-logo.png"
                    member_card_logo_url: "https://example.com/hilton-member-card-logo.png"
                    banner_url: "https://example.com/hilton-banner.png"
                    detail_image_url: "https://example.com/hilton-detail.png"
                    tags: ["酒店", "旅游", "住宿"]
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                retCode: 1
                message: "Unauthenticated"
        '404':
          description: 奖励内容不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                retCode: 1
                message: "Reward content not found"
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                retCode: 1
                message: "Internal server error"

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: "使用格式: Bearer {token}"
  
  schemas:
    RewardContentResponse:
      type: object
      required:
        - retCode
        - message
        - data
      properties:
        retCode:
          type: integer
          description: 返回码，0表示成功，非0表示失败
          example: 0
        message:
          type: string
          description: 返回消息
          example: "success"
        data:
          $ref: '#/components/schemas/RewardContentData'
    
    RewardContentData:
      type: object
      required:
        - code
        - name
        - partner_code
      properties:
        code:
          type: string
          description: 奖励内容代码
          example: "HILTON_POINTS"
        name:
          type: string
          description: 奖励内容名称
          example: "希尔顿积分"
        description:
          type: string
          nullable: true
          description: 奖励内容描述
          example: "希尔顿酒店积分奖励"
        type:
          type: string
          nullable: true
          description: 奖励类型
          example: "points"
        value:
          type: number
          nullable: true
          description: 奖励价值/数量
          example: 1000
        unit:
          type: string
          nullable: true
          description: 奖励单位
          example: "积分"
        logo_url:
          type: string
          nullable: true
          description: Logo图片地址
          example: "https://example.com/hilton-logo.png"
        image_url:
          type: string
          nullable: true
          description: 展示图片地址
          example: "https://example.com/hilton-image.png"
        partner_code:
          type: string
          description: 合作伙伴代码
          example: "HILTON"
        partner:
          allOf:
            - $ref: '#/components/schemas/Partner'
          nullable: true
          description: 合作伙伴信息对象，如果没有关联合作伙伴则为null
    
    Partner:
      type: object
      required:
        - code
        - name
      properties:
        code:
          type: string
          description: 合作伙伴代码
          example: "HILTON"
        name:
          type: string
          description: 合作伙伴名称
          example: "希尔顿"
        full_name:
          type: string
          nullable: true
          description: 合作伙伴全称
          example: "希尔顿酒店集团"
        member_name:
          type: string
          nullable: true
          description: 会员计划名称
          example: "希尔顿荣誉客会"
        description:
          type: string
          nullable: true
          description: 合作伙伴描述
          example: "全球知名酒店集团"
        type:
          type: string
          nullable: true
          description: 合作伙伴类型
          enum:
            - issuer
            - acquirer
            - merchant
            - vendor
            - serviceprovider
          example: "merchant"
        status:
          type: string
          nullable: true
          description: 状态
          enum:
            - active
            - inactive
          example: "active"
        card_color_1:
          type: string
          nullable: true
          description: 卡片主色调
          example: "#FF6B6B"
        card_color_2:
          type: string
          nullable: true
          description: 卡片副色调
          example: "#4ECDC4"
        theme_color:
          type: string
          nullable: true
          description: 主题色
          example: "#FF6B6B"
        small_logo_url:
          type: string
          nullable: true
          description: 小尺寸Logo地址
          example: "https://example.com/hilton-small-logo.png"
        large_logo_url:
          type: string
          nullable: true
          description: 大尺寸Logo地址
          example: "https://example.com/hilton-large-logo.png"
        member_card_logo_url:
          type: string
          nullable: true
          description: 会员卡Logo地址
          example: "https://example.com/hilton-member-card-logo.png"
        banner_url:
          type: string
          nullable: true
          description: 横幅图片地址
          example: "https://example.com/hilton-banner.png"
        detail_image_url:
          type: string
          nullable: true
          description: 详情页图片地址
          example: "https://example.com/hilton-detail.png"
        tags:
          type: array
          nullable: true
          description: 标签列表
          items:
            type: string
          example: ["酒店", "旅游", "住宿"]
    
    ErrorResponse:
      type: object
      required:
        - retCode
        - message
      properties:
        retCode:
          type: integer
          description: 返回码，非0表示失败
          example: 1
        message:
          type: string
          description: 错误消息
          example: "Reward content not found"

tags:
  - name: 用户奖励
    description: 用户奖励相关接口