chore: update auth and portal

This commit is contained in:
2026-01-14 11:29:17 +08:00
parent fb0a1c2f84
commit 3bcee7efc2
42 changed files with 5969 additions and 3014 deletions

View File

@@ -472,6 +472,122 @@ definitions:
description: Title 内容标题(为空表示不修改)。
type: string
type: object
dto.CouponCreateForm:
properties:
description:
description: Description 优惠券描述。
type: string
end_at:
description: EndAt 过期时间RFC3339可为空
type: string
max_discount:
description: MaxDiscount 折扣券最高抵扣金额(分)。
type: integer
min_order_amount:
description: MinOrderAmount 使用门槛金额(分)。
type: integer
start_at:
description: StartAt 生效时间RFC3339可为空
type: string
title:
description: Title 优惠券标题。
type: string
total_quantity:
description: TotalQuantity 发行总量0 表示不限量)。
type: integer
type:
description: Type 优惠券类型fix_amount/discount
type: string
value:
description: Value 优惠券面值(分/折扣百分比)。
type: integer
type: object
dto.CouponGrantForm:
properties:
user_ids:
description: UserIDs 领取用户ID集合。
items:
type: integer
type: array
type: object
dto.CouponItem:
properties:
created_at:
description: CreatedAt 创建时间RFC3339
type: string
description:
description: Description 优惠券描述。
type: string
end_at:
description: EndAt 过期时间RFC3339
type: string
id:
description: ID 券模板ID。
type: integer
max_discount:
description: MaxDiscount 折扣券最高抵扣金额(分)。
type: integer
min_order_amount:
description: MinOrderAmount 使用门槛金额(分)。
type: integer
start_at:
description: StartAt 生效时间RFC3339
type: string
title:
description: Title 优惠券标题。
type: string
total_quantity:
description: TotalQuantity 发行总量。
type: integer
type:
description: Type 优惠券类型fix_amount/discount
type: string
updated_at:
description: UpdatedAt 更新时间RFC3339
type: string
used_quantity:
description: UsedQuantity 已使用数量。
type: integer
value:
description: Value 优惠券面值(分/折扣百分比)。
type: integer
type: object
dto.CouponReceiveForm:
properties:
coupon_id:
description: CouponID 券模板ID。
type: integer
type: object
dto.CouponUpdateForm:
properties:
description:
description: Description 优惠券描述(为空表示不修改)。
type: string
end_at:
description: EndAt 过期时间RFC3339可为空
type: string
max_discount:
description: MaxDiscount 折扣券最高抵扣金额(分)。
type: integer
min_order_amount:
description: MinOrderAmount 使用门槛金额(分)。
type: integer
start_at:
description: StartAt 生效时间RFC3339可为空
type: string
title:
description: Title 优惠券标题(为空表示不修改)。
type: string
total_quantity:
description: TotalQuantity 发行总量0 表示不限量)。
type: integer
type:
description: Type 优惠券类型fix_amount/discount
type: string
value:
description: Value 优惠券面值(分/折扣百分比)。
type: integer
type: object
dto.DashboardStats:
properties:
new_messages:
@@ -2916,6 +3032,140 @@ paths:
summary: Update content
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/coupons:
get:
consumes:
- application/json
description: List coupon templates
parameters:
- description: Page
in: query
name: page
type: integer
- description: Limit
in: query
name: limit
type: integer
- description: Type (fix_amount/discount)
in: query
name: type
type: string
- description: Status (active/expired)
in: query
name: status
type: string
- description: Keyword
in: query
name: keyword
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/requests.Pager'
summary: List coupons
tags:
- CreatorCenter
post:
consumes:
- application/json
description: Create coupon template
parameters:
- description: Coupon form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.CouponItem'
summary: Create coupon
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/coupons/{id}:
get:
consumes:
- application/json
description: Get coupon template detail
parameters:
- description: Coupon ID
format: int64
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.CouponItem'
summary: Get coupon
tags:
- CreatorCenter
put:
consumes:
- application/json
description: Update coupon template
parameters:
- description: Coupon ID
format: int64
in: path
name: id
required: true
type: integer
- description: Coupon form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponUpdateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.CouponItem'
summary: Update coupon
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/coupons/{id}/grant:
post:
consumes:
- application/json
description: Grant coupon to users
parameters:
- description: Coupon ID
format: int64
in: path
name: id
required: true
type: integer
- description: Grant form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponGrantForm'
produces:
- application/json
responses:
"200":
description: Granted
schema:
type: string
summary: Grant coupon
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/dashboard:
get:
consumes:
@@ -3290,6 +3540,52 @@ paths:
summary: List coupons
tags:
- UserCenter
/t/{tenantCode}/v1/me/coupons/available:
get:
consumes:
- application/json
description: List coupons available for the given order amount
parameters:
- description: Order amount (cents)
format: int64
in: query
name: amount
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/dto.UserCouponItem'
type: array
summary: List available coupons
tags:
- UserCenter
/t/{tenantCode}/v1/me/coupons/receive:
post:
consumes:
- application/json
description: Receive a coupon by coupon_id
parameters:
- description: Receive form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponReceiveForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.UserCouponItem'
summary: Receive coupon
tags:
- UserCenter
/t/{tenantCode}/v1/me/favorites:
get:
consumes: