自定义 Right Template 的所有权由 Artist 调整为 User。Service 和 Open Call(后端模型名为 Project)现在共用当前登录用户维护的同一套自定义模板:
service.artist.user_id 使用所属用户的模板。project.user_id 使用创建用户的模板。/api/user/right_templates/custom/*;不再提供 /api/artist_center/right_templates/custom/* 路由。模板仍使用 type 区分来源:
type | 来源 |
|---|---|
platform | 平台 Right Template |
custom | 当前 User 自定义模板 |
平台模板与自定义模板的数值 id 可能相同,前端必须使用 (type, id) 作为唯一标识。
POST /api/content/projects/list
right_template 支持平台/用户自定义模板,并返回 type 和完整 right_treeGET /api/content/projects/info
right_template 支持平台/用户自定义模板,并返回 type 和完整 right_treeGET /api/user/right_templates/custom/meta
GET /api/user/right_templates/custom/list
GET /api/user/right_templates/custom/info
POST /api/user/right_templates/custom/create
POST /api/user/right_templates/custom/update
POST /api/user/right_templates/custom/delete
81002POST /api/projects/create
right_template_type,支持当前用户自己的自定义模板POST /api/projects/update
POST /api/projects/list
type 和完整 right_tree 的模板GET /api/projects/info
type 和完整 right_tree 的模板POST /api/project_requests/choose
GET /api/artist_center/services/info
POST /api/artist_center/services/create
type = custom 时校验模板属于当前 UserPOST /api/artist_center/services/update
type = custom 时校验模板属于当前 UserPOST /api/content/projects/listdata[].right_template 支持两类模板,结构与公开详情一致。无新增,沿用原接口。
GET /api/content/projects/info未关联模板时,right_template_type、right_template_id、right_template 均为 null。
GET /api/user/right_templates/custom/meta无。
GET /api/user/right_templates/custom/list| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
page | number | 否 | 页码,默认 1 |
size | number | 否 | 每页数量,最大 50 |
列表项包含:type: "custom"、right_tree、services_count、projects_count。
GET /api/user/right_templates/custom/info| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | number | 是 | 自定义模板 id |
404:模板不存在、已删除或不属于当前用户。
POST /api/user/right_templates/custom/create| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | object | 是 | 多语言模板名称 |
right_states | object[] | 是 | 完整或部分权益状态 |
right_states[].right_id | number | 是 | 权益 id |
right_states[].state | number | 是 | 权益状态 |
summary、description 继续由系统固定提供,Artist/User 均不可编辑。
POST /api/user/right_templates/custom/update| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | number | 是 | 自定义模板 id |
name | object | 否 | 新的多语言名称 |
right_states | object[] | 否 | 新的权益状态集合 |
404:模板不存在、已删除或不属于当前用户。
POST /api/user/right_templates/custom/delete| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | number | 是 | 自定义模板 id |
force | boolean | 否 | 是否解除 Service/Open Call 关联并强制删除 |
400:模板被 Service 使用,返回既有业务错误码 81001(ArtistRightTemplateUsedByService)。
400:模板未被 Service 使用、但被 Open Call 使用,返回新增业务错误码 81002(UserRightTemplateUsedByOpenCall)。前端必须按 code 处理,不依赖 message。
如果模板同时被 Service 和 Open Call 使用,非强制删除会优先返回 81001。传入 force: true 后会解除两类实时关联并软删除模板,历史快照不变。
POST /api/projects/create| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
right_template_type | "platform" | "custom" | 否 | 模板类型;省略时兼容为 platform |
right_template_id | number | null | 否 | 对应类型下的模板 id;null 表示不关联模板 |
type = custom 时,模板必须属于当前登录用户,否则返回 422,错误字段为 right_template_id。
POST /api/projects/updateright_template_id: null 会同时清空类型和 id。POST /api/projects/listdata[].right_template 结构与公开 Open Call 详情一致。GET /api/projects/infodata.right_template 结构与公开 Open Call 详情一致。POST /api/project_requests/chooseproject_snaps.data.right_template 和 work_tasks.busable_snap.right_template 保存模板的 type、名称、固定说明和完整权益树。模板后续改名、修改权益或强制删除,不影响已生成的快照。
GET /api/artist_center/services/inforight_templates[] 中的自定义模板来自当前 Artist 对应 User 的模板库。POST /api/artist_center/services/createright_templates[].type = custom 时,id 必须属于当前登录 User。POST /api/artist_center/services/updateartist_right_templates.artist_id 通过 artists.user_id 正式转换为 User ownership,并保留模板、权益 pivot、Service pivot 的原 id 和数据。right_template_id 会回填为 right_template_type = platform。right_template_id,仍按平台模板处理。right_template 存在但缺少 type,后端按 platform 返回;前端也应保留同样兼容逻辑。