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

@@ -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
}