| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-admin-credit-adjustments.yaml
- post:
- summary: 手工加减积分
- tags:
- - admin
- operationId: post_api_v3_admin_credit_adjustments
- description: |-
- 加到登录用户的积分余额(不过期)。负数为扣减,扣减后余额不能为负。
- 同一 `ref` 只入账一次:重复提交返回原来那条(200),新入账是 201。
- 实现:`V3\AdminCreditAdjustmentController@store`
- security:
- -
- bearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- delta:
- type: integer
- description: '加减多少积分,非零,绝对值最大 1000000'
- user:
- type: string
- description: '用户 uuid、用户名或邮箱'
- note:
- type: string
- description: 原因(记进流水备注)
- ref:
- type: string
- description: 调整单号(uuid),防重复提交;不给由服务端生成
- required:
- - user
- - delta
- - note
- responses:
- 200:
- description: 成功
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- account_type:
- type: string
- enum:
- - user
- - guest
- account_id:
- type: string
- user:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- delta:
- type: integer
- kind:
- type: string
- enum:
- - earn
- - spend
- - refund
- - adjust
- bucket:
- type: string
- enum:
- - free
- - earned
- source:
- type: string
- enum:
- - reading
- - editing
- - agent_run
- - admin
- ref:
- type: string
- day:
- type: string
- policy_version:
- type: integer
- client_ip:
- type: string
- nullable: true
- note:
- type: string
- nullable: true
- operator:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- created_at:
- type: string
- updated_at:
- type: string
- meta:
- type: object
- properties:
- created:
- type: boolean
- description: 这次是否新入账
- earned_balance:
- type: integer
- description: 该用户调整后的积分余额
- 201:
- description: '新入账。响应体与 200 同形(200 是同一 ref 已经入账过,返回原来那条)'
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- account_type:
- type: string
- enum:
- - user
- - guest
- account_id:
- type: string
- user:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- delta:
- type: integer
- kind:
- type: string
- enum:
- - earn
- - spend
- - refund
- - adjust
- bucket:
- type: string
- enum:
- - free
- - earned
- source:
- type: string
- enum:
- - reading
- - editing
- - agent_run
- - admin
- ref:
- type: string
- day:
- type: string
- policy_version:
- type: integer
- client_ip:
- type: string
- nullable: true
- note:
- type: string
- nullable: true
- operator:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- created_at:
- type: string
- updated_at:
- type: string
- meta:
- type: object
- properties:
- created:
- type: boolean
- description: 这次是否新入账
- earned_balance:
- type: integer
- description: 该用户调整后的积分余额
- 401:
- $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
|