Files
junhong_cmp_fiber/internal/routes/h5_popup_configuration.go
break 5ed6b39deb
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
feat(收口): 补齐 8 月迭代缺口并同步 Spec 与证据链
- 新增六对成对迁移 000232–000237:H5 弹窗类型、退款结算标识与申请人备注、优先轮询事实字段与两个新终态、通道阈值命中留痕、手机号最近解绑人、提现资格校验留痕
- 退款:原因必填与申请人备注、来源支付与渠道流水冻结、线下处理流水号补录审计、按订单查询可选退款方式、企微审批材料补齐且新增字段缺失映射即明确失败
- 优先轮询:人工关闭、有效期到期独立周期任务、失败与过期人工重触发、事实字段与异常重试查询、资产解析端点只读投影
- 通道阈值:命中事实同事务留痕与命中记录查询;员工账单:列表筛选与详情投影;商户池:列表投影与统计周期语义;H5:弹窗类型与类别排序
- 手机号:有效关联数量与最近解绑人、短信验证码失败次数限制;导出:佣金明细十五列与报表序号列
- 时间筛选:三处新增筛选纳入统一严格解析契约,员工账单产生时间参数改名
- 同步 12 份主 Spec 需求、两端点与异步任务证据链,门禁 context-health 与 OpenSpec 校验通过
2026-09-18 15:34:29 +08:00

77 lines
4.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package routes
import (
"github.com/gofiber/fiber/v2"
"github.com/break/junhong_cmp_fiber/internal/handler/admin"
"github.com/break/junhong_cmp_fiber/internal/model/dto"
"github.com/break/junhong_cmp_fiber/pkg/openapi"
)
// registerH5PopupConfigurationRoutes 注册 H5 运营弹窗配置的维护路由。
// 全部接口仅超级管理员与平台账号可用,代理与企业统一返回 403。
func registerH5PopupConfigurationRoutes(router fiber.Router, handler *admin.H5PopupConfigurationHandler, doc *openapi.Generator, basePath string) {
configurations := router.Group("/h5-popup-configurations")
groupPath := basePath + "/h5-popup-configurations"
Register(configurations, doc, groupPath, "GET", "", handler.ListH5PopupConfigurations, RouteSpec{
Summary: "查询运营弹窗配置列表",
Description: "按最近更新时间倒序分页返回运营弹窗配置,可按启停筛选。",
Tags: []string{"H5 运营弹窗配置"},
Auth: true,
Input: new(dto.H5PopupConfigurationListRequest),
Output: new(dto.H5PopupConfigurationListResponse),
})
Register(configurations, doc, groupPath, "POST", "", handler.CreateH5PopupConfiguration, RouteSpec{
Summary: "创建运营弹窗配置",
Description: "创建全局运营弹窗配置,初始版本为 1。弹窗类型 `popup_type` 必填" +
"promotion:套餐政策推广, announcement:通用公告),取值域外或缺失一律以参数非法拒绝;" +
"未传优先级时按类型的缺省优先级取值。候选排序先按类型类别(风险换卡提醒 > 套餐政策推广 > 通用公告)," +
"再按显式优先级降序、同优先级取最近更新时间最新。范围同一维度多选取任一命中,未配置范围即全量;" +
"页面必选;受控动作只允许套餐购买或资产钱包充值,不接受 URL、前端路由或任意动作结束时间不得早于开始时间。",
Tags: []string{"H5 运营弹窗配置"},
Auth: true,
Input: new(dto.CreateH5PopupConfigurationRequest),
Output: new(dto.H5PopupConfigurationResponse),
})
Register(configurations, doc, groupPath, "GET", "/:id", handler.GetH5PopupConfiguration, RouteSpec{
Summary: "查询运营弹窗配置详情",
Tags: []string{"H5 运营弹窗配置"},
Auth: true,
Input: new(dto.H5PopupConfigurationIDParams),
Output: new(dto.H5PopupConfigurationResponse),
})
Register(configurations, doc, groupPath, "PUT", "/:id", handler.UpdateH5PopupConfiguration, RouteSpec{
Summary: "更新运营弹窗配置",
Description: "更新运营弹窗配置并递增版本;旧版本已投放通知的内容与快照不被改写," +
"新版本可向原命中客户按频率重新投放一次。`popup_type` 传入时必须落在" +
"promotion:套餐政策推广, announcement:通用公告)取值域内,否则以参数非法拒绝;不传保持原值。",
Tags: []string{"H5 运营弹窗配置"},
Auth: true,
Input: new(dto.UpdateH5PopupConfigurationParams),
Output: new(dto.H5PopupConfigurationResponse),
})
// 静态后缀必须先于 /:id 动态路径注册,避免被动态参数吞掉。
Register(configurations, doc, groupPath, "POST", "/:id/enable", handler.EnableH5PopupConfiguration, RouteSpec{
Summary: "启用运营弹窗配置",
Description: "启用后参与候选匹配,并刷新最近更新时间,影响同优先级排序。",
Tags: []string{"H5 运营弹窗配置"},
Auth: true,
Input: new(dto.H5PopupConfigurationIDParams),
Output: new(dto.H5PopupConfigurationResponse),
})
Register(configurations, doc, groupPath, "POST", "/:id/disable", handler.DisableH5PopupConfiguration, RouteSpec{
Summary: "停用运营弹窗配置",
Description: "停用后停止新投放,并刷新最近更新时间;历史通知在展示期内仍可见。",
Tags: []string{"H5 运营弹窗配置"},
Auth: true,
Input: new(dto.H5PopupConfigurationIDParams),
Output: new(dto.H5PopupConfigurationResponse),
})
}