|
|
@@ -8,6 +8,7 @@ get:
|
|
|
只列话题(不含回复),删除了但还有回复的话题以墓碑出现(deleted_at 有值、内容为空)。
|
|
|
未登录看不到协作类话题(discussion / issue);basic 角色在自己无权管理的对象上只看得到
|
|
|
自己发起的协作类话题。各状态的数量与「能发起哪些类型」见 `GET /v3/discussions/summary`。
|
|
|
+ 不传 type 时只列评论线程(discussion / qa / help / issue),批注要显式 type=note / commentary。
|
|
|
|
|
|
实现:`V3\DiscussionController@index`
|
|
|
security:
|
|
|
@@ -52,7 +53,9 @@ get:
|
|
|
- qa
|
|
|
- help
|
|
|
- issue
|
|
|
- description: 话题类型
|
|
|
+ - note
|
|
|
+ - commentary
|
|
|
+ description: 类型,不传则只列评论线程
|
|
|
-
|
|
|
name: status
|
|
|
in: query
|
|
|
@@ -134,6 +137,21 @@ get:
|
|
|
tpl_id:
|
|
|
type: string
|
|
|
nullable: true
|
|
|
+ pos_start:
|
|
|
+ type: integer
|
|
|
+ nullable: true
|
|
|
+ pos_end:
|
|
|
+ type: integer
|
|
|
+ nullable: true
|
|
|
+ quote_exact:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
+ quote_prefix:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
+ quote_suffix:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
reply_count:
|
|
|
type: integer
|
|
|
description: 仅在部分查询口径下返回。
|
|
|
@@ -141,6 +159,10 @@ get:
|
|
|
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
|
|
|
+ co_editor:
|
|
|
+ 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
|
|
|
abilities:
|
|
|
type: object
|
|
|
properties: { update: { type: boolean }, delete: { type: boolean }, close: { type: boolean }, reply: { type: boolean } }
|
|
|
@@ -156,7 +178,7 @@ get:
|
|
|
422:
|
|
|
$ref: '../../main.yaml#/components/responses/ProblemValidation'
|
|
|
post:
|
|
|
- summary: 发起话题
|
|
|
+ summary: 发起话题或新建批注
|
|
|
tags:
|
|
|
- discussions
|
|
|
operationId: post_api_v3_discussions
|
|
|
@@ -164,6 +186,9 @@ post:
|
|
|
discussion / issue 登录即可发;qa / help 只能发在文章上,且只有文章的编辑者能发。
|
|
|
severity 的取值随 type:issue 为 error / warning / info,help 为 urgent / normal,
|
|
|
其它类型不收。默认会通知对象的作者(站内信 + webhook),`notify=false` 关闭。
|
|
|
+ 批注(note / commentary)只能加在句子上,且只有该句所在 channel 的编辑者能加;
|
|
|
+ 标题可省、正文必填,commentary 的正文必须是义注句子模板 `{{book-para-start-end}}`
|
|
|
+ (可多句并列);可带锚点 pos_* / quote_*(评论线程传了 422);不发通知。
|
|
|
|
|
|
实现:`V3\DiscussionController@store`
|
|
|
security:
|
|
|
@@ -190,19 +215,21 @@ post:
|
|
|
description: '挂靠对象的 uuid'
|
|
|
type:
|
|
|
type: string
|
|
|
- description: 话题类型
|
|
|
+ description: 类型
|
|
|
enum:
|
|
|
- discussion
|
|
|
- qa
|
|
|
- help
|
|
|
- issue
|
|
|
+ - note
|
|
|
+ - commentary
|
|
|
default: discussion
|
|
|
title:
|
|
|
type: string
|
|
|
- description: '标题,最长 256 字符'
|
|
|
+ description: '标题,最长 256 字符;评论线程必填,批注可省'
|
|
|
content:
|
|
|
type: string
|
|
|
- description: 正文(markdown)
|
|
|
+ description: 正文(markdown);批注必填
|
|
|
severity:
|
|
|
type: string
|
|
|
description: 严重程度
|
|
|
@@ -212,17 +239,31 @@ post:
|
|
|
- info
|
|
|
- urgent
|
|
|
- normal
|
|
|
+ pos_start:
|
|
|
+ type: integer
|
|
|
+ description: 批注锚点在句子文本中的起始偏移(只限批注)
|
|
|
+ pos_end:
|
|
|
+ type: integer
|
|
|
+ description: 批注锚点的结束偏移,批注插在这里(只限批注)
|
|
|
+ quote_exact:
|
|
|
+ type: string
|
|
|
+ description: 锚定的原文片段(只限批注)
|
|
|
+ quote_prefix:
|
|
|
+ type: string
|
|
|
+ description: 锚定片段前的上下文,用于重新定位(只限批注)
|
|
|
+ quote_suffix:
|
|
|
+ type: string
|
|
|
+ description: 锚定片段后的上下文,用于重新定位(只限批注)
|
|
|
tpl_id:
|
|
|
type: string
|
|
|
description: '话题模板(文章)的 uuid'
|
|
|
notify:
|
|
|
type: boolean
|
|
|
- description: 是否发通知
|
|
|
+ description: 是否发通知(批注不发)
|
|
|
default: true
|
|
|
required:
|
|
|
- target_type
|
|
|
- target_id
|
|
|
- - title
|
|
|
responses:
|
|
|
200:
|
|
|
description: 成功
|
|
|
@@ -267,6 +308,21 @@ post:
|
|
|
tpl_id:
|
|
|
type: string
|
|
|
nullable: true
|
|
|
+ pos_start:
|
|
|
+ type: integer
|
|
|
+ nullable: true
|
|
|
+ pos_end:
|
|
|
+ type: integer
|
|
|
+ nullable: true
|
|
|
+ quote_exact:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
+ quote_prefix:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
+ quote_suffix:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
reply_count:
|
|
|
type: integer
|
|
|
description: 仅在部分查询口径下返回。
|
|
|
@@ -281,6 +337,17 @@ post:
|
|
|
avatar: { type: string }
|
|
|
roles: { type: array, items: { type: string } }
|
|
|
nullable: true
|
|
|
+ co_editor:
|
|
|
+ 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
|
|
|
abilities:
|
|
|
type: object
|
|
|
properties:
|
|
|
@@ -338,6 +405,21 @@ post:
|
|
|
tpl_id:
|
|
|
type: string
|
|
|
nullable: true
|
|
|
+ pos_start:
|
|
|
+ type: integer
|
|
|
+ nullable: true
|
|
|
+ pos_end:
|
|
|
+ type: integer
|
|
|
+ nullable: true
|
|
|
+ quote_exact:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
+ quote_prefix:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
+ quote_suffix:
|
|
|
+ type: string
|
|
|
+ nullable: true
|
|
|
reply_count:
|
|
|
type: integer
|
|
|
description: 仅在部分查询口径下返回。
|
|
|
@@ -352,6 +434,17 @@ post:
|
|
|
avatar: { type: string }
|
|
|
roles: { type: array, items: { type: string } }
|
|
|
nullable: true
|
|
|
+ co_editor:
|
|
|
+ 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
|
|
|
abilities:
|
|
|
type: object
|
|
|
properties:
|