chore: replace all cn comments to en version by volc api (#313)

This commit is contained in:
tecvan
2025-07-31 15:18:11 +08:00
committed by GitHub
parent 91d6cdb430
commit 5abc63fba6
254 changed files with 5899 additions and 5844 deletions

View File

@@ -4,15 +4,15 @@ include "../base.thrift"
include "resource_common.thrift"
struct LibraryResourceListRequest {
1 : optional i32 user_filter , // 是否由当前用户创建0-不筛选1-当前用户
2 : optional list<resource_common.ResType> res_type_filter , // [4,1] 0代表不筛选
3 : optional string name , // 名称
4 : optional resource_common.PublishStatus publish_status_filter, // 发布状态0-不筛选1-未发布2-已发布
5 : required i64 space_id (agw.js_conv="str", api.js_conv="true"), // 用户所在空间ID
7 : optional i32 size , // 一次读取的数据条数默认10最大100.
9 : optional string cursor , // 游标用于分页默认0第一次请求可以不传后续请求需要带上上次返回的cursor
10 : optional list<string> search_keys , // 用来指定自定义搜索的字段 不填默认只name匹配eg []string{name,自定} 匹配name和自定义字段full_text
11 : optional bool is_get_imageflow , // res_type_filter[2 workflow]时,是否需要返回图片流
1 : optional i32 user_filter , // Whether created by the current user, 0 - unfiltered, 1 - current user
2 : optional list<resource_common.ResType> res_type_filter , // [4,1] 0 means do not filter
3 : optional string name , // name
4 : optional resource_common.PublishStatus publish_status_filter, // Published status, 0 - unfiltered, 1 - unpublished, 2 - published
5 : required i64 space_id (agw.js_conv="str", api.js_conv="true"), // User's space ID
7 : optional i32 size , // The number of data bars read at one time, the default is 10, and the maximum is 100.
9 : optional string cursor , // Cursor, used for paging, default 0, the first request can not be passed, subsequent requests need to bring the last returned cursor
10 : optional list<string> search_keys , // The field used to specify the custom search, do not fill in the default only name matches, eg [] string {name, custom} matches the name and custom fields full_text
11 : optional bool is_get_imageflow , // Do you need to return image review when the res_type_filter is [2 workflow]
255: base.Base Base ,
}
@@ -20,15 +20,15 @@ struct LibraryResourceListResponse {
1 : i64 code ,
2 : string msg ,
3 : list<resource_common.ResourceInfo> resource_list,
5 : optional string cursor , // 游标用于下次请求的cursor
6 : bool has_more , // 是否还有数据待拉取
5 : optional string cursor , // Cursor, the cursor for the next request
6 : bool has_more , // Is there still data to be pulled?
255: required base.BaseResp BaseResp ,
}
struct ProjectResourceListRequest {
1 : required i64 project_id (agw.js_conv="str", api.js_conv="true"), // 项目ID
2 : i64 space_id (agw.js_conv="str", api.js_conv="true"), // 用户所在space id
3 : optional string project_version, // 指定获取某个版本的project的资源
1 : required i64 project_id (agw.js_conv="str", api.js_conv="true"), // Project ID
2 : i64 space_id (agw.js_conv="str", api.js_conv="true"), // User space id
3 : optional string project_version, // Specify the resources to obtain a version of the project
255: base.Base Base ,
}
@@ -40,30 +40,30 @@ struct ProjectResourceListResponse {
}
struct ResourceCopyDispatchRequest {
// 场景,只支持单资源的操作
// Scenario, only supports the operation of a single resource
1 : resource_common.ResourceCopyScene scene,
// 被用户选择复制/移动的资源ID
// The resource ID selected by the user to copy/move
2 : i64 res_id (api.js_conv="true", api.body="res_id")
3 : resource_common.ResType res_type
// 所在项目ID
// Project ID
4 : optional i64 project_id (api.js_conv="true", api.body="project_id")
5 : optional string res_name
6 : optional i64 target_space_id (api.js_conv="true", api.body="target_space_id") // 跨空间复制的目标space id
6 : optional i64 target_space_id (api.js_conv="true", api.body="target_space_id") // Target space id for cross-space copy
255: base.Base Base,
}
struct ResourceCopyDispatchResponse {
1 : i64 code,
2 : string msg,
3 : optional string task_id, // 复制任务id, 用于查询任务状态或取消、重试任务
// 不可以进行操作的原因,返回多语言文本
3 : optional string task_id, // Copy task ID, used to query task status or cancel or retry tasks
// The reason why the operation cannot be performed is to return multilingual text
4 : optional list<resource_common.ResourceCopyFailedReason> failed_reasons,
255: required base.BaseResp BaseResp,
}
struct ResourceCopyDetailRequest {
1 : string task_id, // 复制任务id, 用于查询任务状态或取消、重试任务
1 : string task_id, // Copy task ID, used to query task status or cancel or retry tasks
255: base.Base Base,
}
@@ -76,20 +76,20 @@ struct ResourceCopyDetailResponse {
struct ResourceCopyRetryRequest {
1 : string task_id, // 复制任务id, 用于查询任务状态或取消、重试任务
1 : string task_id, // Copy task ID, used to query task status or cancel or retry tasks
255: base.Base Base,
}
struct ResourceCopyRetryResponse {
1 : i64 code,
2 : string msg,
// 不可以进行操作的原因,返回多语言文本
// The reason why the operation cannot be performed is to return multilingual text
4 : optional list<resource_common.ResourceCopyFailedReason> failed_reasons,
255: required base.BaseResp BaseResp,
}
struct ResourceCopyCancelRequest {
1 : string task_id, // 复制任务id, 用于查询任务状态或取消、重试任务
1 : string task_id, // Copy task ID, used to query task status or cancel or retry tasks
255: base.Base Base,
}
@@ -102,7 +102,7 @@ struct ResourceCopyCancelResponse {
service ResourceService {
LibraryResourceListResponse LibraryResourceList(1: LibraryResourceListRequest request)(api.post='/api/plugin_api/library_resource_list', api.category="resource", api.gen_path="resource", agw.preserve_base="true")
ProjectResourceListResponse ProjectResourceList(1: ProjectResourceListRequest request)(api.post='/api/plugin_api/project_resource_list', api.category="resource", api.gen_path="resource", agw.preserve_base="true")
// 复制Library资源到项目、复制项目资源到Library、移动项目资源到Library、项目内单复制资源
// Copy Library resources to projects, copy project resources to libraries, move project resources to libraries, and copy resources within projects
ResourceCopyDispatchResponse ResourceCopyDispatch (1: ResourceCopyDispatchRequest req) (api.post='/api/plugin_api/resource_copy_dispatch', api.category="resource", api.gen_path="resource", agw.preserve_base="true")
ResourceCopyDetailResponse ResourceCopyDetail (1: ResourceCopyDetailRequest req) (api.post='/api/plugin_api/resource_copy_detail', api.category="resource", api.gen_path="resource", agw.preserve_base="true")
ResourceCopyRetryResponse ResourceCopyRetry (1: ResourceCopyRetryRequest req) (api.post='/api/plugin_api/resource_copy_retry', api.category="resource", api.gen_path="resource", agw.preserve_base="true")

View File

@@ -13,31 +13,31 @@ enum ResType{
}
enum PublishStatus {
UnPublished = 1, // 未发布
Published = 2, // 已发布
UnPublished = 1, // unpublished
Published = 2, // Published
}
enum ActionKey{
Copy = 1, // 复制
Delete = 2, // 删除
EnableSwitch = 3, // 启用/禁用
Edit = 4, // 编辑
SwitchToFuncflow = 8, // 切换成funcflow
SwitchToChatflow = 9, // 切换成chatflow
CrossSpaceCopy = 10, // 跨空间复制
Copy = 1, // copy
Delete = 2, // delete
EnableSwitch = 3, // enable/disable
Edit = 4, // edit
SwitchToFuncflow = 8, // Switch to funcflow
SwitchToChatflow = 9, // Switch to chatflow
CrossSpaceCopy = 10, // Cross-space copy
}
enum ProjectResourceActionKey{
Rename = 1, //重命名
Copy = 2, //创建副本/复制到当前项目
CopyToLibrary = 3, //复制到资源库
MoveToLibrary = 4, //移动到资源库
Delete = 5, //删除
Enable = 6, //启用
Disable = 7, //禁用
SwitchToFuncflow = 8, // 切换成funcflow
SwitchToChatflow = 9, // 切换成chatflow
UpdateDesc = 10, // 修改描述
Rename = 1, //rename
Copy = 2, //Create a copy/copy to the current project
CopyToLibrary = 3, //Copy to Library
MoveToLibrary = 4, //Move to Library
Delete = 5, //delete
Enable = 6, //enable
Disable = 7, //disable
SwitchToFuncflow = 8, // Switch to funcflow
SwitchToChatflow = 9, // Switch to chatflow
UpdateDesc = 10, // Modify description
}
enum ProjectResourceGroupType{
@@ -47,87 +47,87 @@ enum ProjectResourceGroupType{
}
enum ResourceCopyScene {
CopyProjectResource = 1, //复制项目内的资源,浅拷贝
CopyResourceToLibrary = 2, //复制项目资源到Library复制后要发布
MoveResourceToLibrary = 3, //移动项目资源到Library复制后要发布后置要删除项目资源
CopyResourceFromLibrary = 4, //复制Library资源到项目
CopyProject = 5, //复制项目,连带资源要复制。复制当前草稿。
PublishProject = 6, //项目发布到渠道,连带资源需要发布(含商店)。以当前草稿发布。
CopyProjectTemplate = 7, // 复制项目模板。
PublishProjectTemplate = 8, // 项目发布到模板,以项目的指定版本发布成临时模板。
LaunchTemplate = 9, // 模板审核通过,上架,根据临时模板复制正式模板。
ArchiveProject = 10, // 草稿版本存档
RollbackProject = 11, // 线上版本加载到草稿,草稿版本加载到草稿
CrossSpaceCopy = 12, // 单个资源跨空间复制
CrossSpaceCopyProject = 13, // 项目跨空间复制
CopyProjectResource = 1, //Copy resources within the project, shallow copy
CopyResourceToLibrary = 2, //Copy the project resources to the Library, and publish after copying
MoveResourceToLibrary = 3, //Move project resources to Library, copy to publish, and delete project resources later
CopyResourceFromLibrary = 4, //Copy Library Resources to Project
CopyProject = 5, //Copy the project, along with the resources. Copy the current draft.
PublishProject = 6, //The project is published to the channel, and the associated resources need to be published (including the store). Publish with the current draft.
CopyProjectTemplate = 7, // Copy the project template.
PublishProjectTemplate = 8, // The project is published to a template, and the specified version of the project is published as a temporary template.
LaunchTemplate = 9, // The template is approved, put on the shelves, and the official template is copied according to the temporary template.
ArchiveProject = 10, // Draft version archive
RollbackProject = 11, // Online version loaded into draft, draft version loaded into draft
CrossSpaceCopy = 12, // Cross-space copy of a single resource
CrossSpaceCopyProject = 13, // item cross-space copy
}
// Library资源操作
// Library Resource Operations
struct ResourceAction{
// 一个操作对应一个唯一的keykey由资源侧约束
// An operation corresponds to a unique key, and the key is constrained by the resource side
1: required ActionKey Key (go.tag = "json:\"key\"", agw.key = "key") ,
//ture=可以操作该Actionfalse=置灰
//ture = can operate this Action, false = grey out
2: required bool Enable (go.tag = "json:\"enable\"", agw.key = "enable"),
}
// 前端用
// front end
struct ResourceInfo{
1 : optional i64 ResID (agw.js_conv="str", agw.key = "res_id", api.js_conv="true", api.body="res_id") , // 资源id
2 : optional ResType ResType (go.tag = "json:\"res_type\"", agw.key = "res_type") , // 资源类型
// 资源子类型,由资源实现方定义。
1 : optional i64 ResID (agw.js_conv="str", agw.key = "res_id", api.js_conv="true", api.body="res_id") , // Resource ID
2 : optional ResType ResType (go.tag = "json:\"res_type\"", agw.key = "res_type") , // resource type
// Resource subtype, defined by the resource implementer.
// Plugin1-Http; 2-App; 6-LocalKnowledge0-text; 1-table; 2-imageUI1-Card
3 : optional i32 ResSubType (go.tag = "json:\"res_sub_type\"", agw.key = "res_sub_type") ,
4 : optional string Name (go.tag = "json:\"name\"", agw.key = "name") , // 资源名称
5 : optional string Desc (go.tag = "json:\"desc\"", agw.key = "desc") , // 资源描述
6 : optional string Icon (go.tag = "json:\"icon\"", agw.key = "icon") , // 资源Icon完整url
7 : optional i64 CreatorID (agw.js_conv="str", agw.key = "creator_id", api.js_conv="true", api.body="creator_id") , // 资源创建者
8 : optional string CreatorAvatar (go.tag = "json:\"creator_avatar\"", agw.key = "creator_avatar") , // 资源创建者
9 : optional string CreatorName (go.tag = "json:\"creator_name\"", agw.key = "creator_name") , // 资源创建者
10: optional string UserName (go.tag = "json:\"user_name\"", agw.key = "user_name") , // 资源创建者
11: optional PublishStatus PublishStatus (go.tag = "json:\"publish_status\"", agw.key = "publish_status") , // 资源发布状态1-未发布2-已发布
12: optional i32 BizResStatus (go.tag = "json:\"biz_res_status\"", agw.key = "biz_res_status") , // 资源状态,各类型资源自身定义
13: optional bool CollaborationEnable (go.tag = "json:\"collaboration_enable\"", agw.key = "collaboration_enable"), // 是否开启多人编辑
14: optional i64 EditTime (agw.key = "edit_time", api.js_conv="true", api.body="edit_time") , // 最近编辑时间, unix秒级时间戳
15: optional i64 SpaceID (agw.js_conv="str", agw.key = "space_id", api.js_conv="true", api.body="space_id") , // 资源所属空间ID
16: optional map<string,string> BizExtend (go.tag = "json:\"biz_extend\"", agw.key = "biz_extend") , // 业务携带的扩展信息以res_type区分每个res_type定义的schema和含义不一样使用前需要判断res_type
17: optional list<ResourceAction> Actions (go.tag = "json:\"actions\"", agw.key = "actions") , // 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回;
18: optional bool DetailDisable (go.tag = "json:\"detail_disable\"", agw.key = "detail_disable") , // 是否禁止进详情页
19: optional bool DelFlag (go.tag = "json:\"del_flag\"", agw.key = "del_flag") , // [数据延迟优化]删除标识符true-已删除-前端隐藏该itemfalse-正常
4 : optional string Name (go.tag = "json:\"name\"", agw.key = "name") , // resource name
5 : optional string Desc (go.tag = "json:\"desc\"", agw.key = "desc") , // resource description
6 : optional string Icon (go.tag = "json:\"icon\"", agw.key = "icon") , // Resource Icon, full url
7 : optional i64 CreatorID (agw.js_conv="str", agw.key = "creator_id", api.js_conv="true", api.body="creator_id") , // Resource creator
8 : optional string CreatorAvatar (go.tag = "json:\"creator_avatar\"", agw.key = "creator_avatar") , // Resource creator
9 : optional string CreatorName (go.tag = "json:\"creator_name\"", agw.key = "creator_name") , // Resource creator
10: optional string UserName (go.tag = "json:\"user_name\"", agw.key = "user_name") , // Resource creator
11: optional PublishStatus PublishStatus (go.tag = "json:\"publish_status\"", agw.key = "publish_status") , // Resource release status, 1 - unpublished, 2 - published
12: optional i32 BizResStatus (go.tag = "json:\"biz_res_status\"", agw.key = "biz_res_status") , // Resource status, each type of resource defines itself
13: optional bool CollaborationEnable (go.tag = "json:\"collaboration_enable\"", agw.key = "collaboration_enable"), // Whether to enable multi-person editing
14: optional i64 EditTime (agw.key = "edit_time", api.js_conv="true", api.body="edit_time") , // Last edited, unix timestamp
15: optional i64 SpaceID (agw.js_conv="str", agw.key = "space_id", api.js_conv="true", api.body="space_id") , // Resource Ownership Space ID
16: optional map<string,string> BizExtend (go.tag = "json:\"biz_extend\"", agw.key = "biz_extend") , // Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type
17: optional list<ResourceAction> Actions (go.tag = "json:\"actions\"", agw.key = "actions") , // Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return;
18: optional bool DetailDisable (go.tag = "json:\"detail_disable\"", agw.key = "detail_disable") , // Whether to ban entering the details page
19: optional bool DelFlag (go.tag = "json:\"del_flag\"", agw.key = "del_flag") , // [Data delay optimization] Delete identifier, true-deleted-frontend hides the item, false-normal
}
struct ProjectResourceAction{
// 一个操作对应一个唯一的keykey由资源侧约束
// An operation corresponds to a unique key, and the key is constrained by the resource side
1 : required ProjectResourceActionKey Key (go.tag = "json:\"key\"", agw.key = "key"),
//ture=可以操作该Actionfalse=置灰
//ture = can operate this Action, false = grey out
2 : required bool Enable (go.tag = "json:\"enable\"", agw.key = "enable"),
// enable=false提示文案。后端返回Starling Key注意放在同一个space下。
// When enable = false, prompt the copywriter. The backend returns the Starling Key, be careful to put it under the same space.
3: optional string Hint (go.tag = "json:\"hint\"", agw.key = "hint"),
}
// 实现方提供展示信息
// The implementer provides display information
struct ProjectResourceInfo{
// 资源id
// Resource ID
1 : i64 ResID (api.js_conv="true", api.body="res_id", agw.js_conv="str", agw.key = "res_id")
// 资源名称
// resource name
2 : string Name (go.tag = "json:\"name\"", agw.key = "name")
// 不同类型的不同操作按钮,由资源实现方和前端约定。返回则展示,要隐藏某个按钮,则不要返回;
// Different types of different operation buttons are agreed upon by the resource implementer and the front end. Return is displayed, if you want to hide a button, do not return;
3 : list<ProjectResourceAction> Actions (go.tag = "json:\"actions\"", agw.key = "actions"),
// 该用户是否对资源只读
// Is the user read-only to the resource?
// 4: bool ReadOnly (go.tag = "json:\"read_only\"", agw.key = "read_only")
// 资源类型
// resource type
5 : ResType ResType (go.tag = "json:\"res_type\"", agw.key = "res_type") ,
// 资源子类型,由资源实现方定义。Plugin1-Http; 2-App; 6-LocalKnowledge0-text; 1-table; 2-imageUI1-Card
// Resource subtype, defined by the resource implementer. Plugin: 1-Http; 2-App; 6-Local; Knowledge: 0-text; 1-table; 2-image; UI: 1-Card
6 : optional i32 ResSubType (go.tag = "json:\"res_sub_type\"", agw.key = "res_sub_type") ,
// 业务携带的扩展信息以res_type区分每个res_type定义的schema和含义不一样使用前需要判断res_type
// Business carry extended information to res_type distinguish, each res_type defined schema and meaning is not the same, need to judge before use res_type
7 : optional map<string, string> BizExtend (go.tag = "json:\"biz_extend\"", agw.key = "biz_extend"),
// 资源状态,各类型资源自身定义。前端与各资源方约定。
// Resource status, each type of resource defines itself. The front end agrees with each resource party.
8 : optional i32 BizResStatus (go.tag = "json:\"biz_res_status\"", agw.key = "biz_res_status") ,
// 当前资源的编辑态版本
// The edited version of the current resource
9 : optional string VersionStr(go.tag = "json:\"version_str\"", agw.key = "version_str")
}
struct ProjectResourceGroup{
1 : ProjectResourceGroupType GroupType (go.tag = "json:\"group_type\"", agw.key = "group_type") , // 资源分组
1 : ProjectResourceGroupType GroupType (go.tag = "json:\"group_type\"", agw.key = "group_type") , // resource grouping
2 : optional list<ProjectResourceInfo> ResourceList (go.tag = "json:\"resource_list\"", agw.key = "resource_list"),
}
@@ -136,9 +136,9 @@ struct ResourceCopyFailedReason {
2 : ResType ResType (go.tag = "json:\"res_type\"", agw.key = "res_type")
3 : string ResName (go.tag = "json:\"res_name\"", agw.key = "res_name")
4 : string Reason (go.tag = "json:\"reason\"", agw.key = "reason")
// 废弃
// abandoned
5 : optional i64 PublishVersion(go.tag = "json:\"publish_version\"", agw.key = "publish_version")
// 资源的当前版本为nil或空字符串都看作是最新版本。项目发布版本或Library发布版本。
// The current version of the resource, either nil or empty string, is considered the latest version. Project release or Library release.
6 : optional string PublishVersionStr(go.tag = "json:\"publish_version_str\"", agw.key = "publish_version_str")
}
@@ -151,9 +151,9 @@ enum TaskStatus{
struct ResourceCopyTaskDetail{
1: string task_id
2: TaskStatus status // 任务状态
3 : i64 res_id (agw.js_conv="str", api.js_conv="true") // 复制后的资源id
2: TaskStatus status // task status
3 : i64 res_id (agw.js_conv="str", api.js_conv="true") // Replicated resource id
4 : ResType res_type
5 : ResourceCopyScene scene,
6: optional string res_name, // 复制前的资源名称
6: optional string res_name, // Resource name before copy
}