# Generated with protoc-gen-openapi # https://github.com/guoming0000/protoc-gen-go-gin/cmd/protoc-gen-openapi openapi: 3.0.3 info: title: "" version: 0.0.1 paths: /space/addPageLink: post: tags: - 页面 summary: 生成新页面链接 description: |4- 1.当前页面若是你的,则你可以创建 readonly edit admin链接 2.如果你有该页面的adminId,则可以创建 readonly edit链接 3. 其他情况会被拒绝 4. 如果同样的链接已存在,则需要让用户RemoveLink后,再创建新的链接。避免用户以为,同一个页面可以存在多个链接。 operationId: SpaceService_AddPageLink requestBody: content: application/json: schema: $ref: '#/components/schemas/.AddPageLinkReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TAddPageLinkResp' /space/addSharedPage: post: tags: - 空间 summary: 将当前分享入口关联到登录用户的空间,不复制页面或升级权限 operationId: SpaceService_AddSharedPage requestBody: content: application/json: schema: $ref: '#/components/schemas/.AddSharedPageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TAddSharedPageResp' /space/createPage: post: tags: - 空间 summary: 创建页面 description: |4- 当getMySpace不存在自己的页面时,调用该接口创建自己的页面 普通用户只能创建一个自己的页面 未来氪金用户可以创建多个 operationId: SpaceService_CreatePage requestBody: content: application/json: schema: $ref: '#/components/schemas/.CreatePageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TCreatePageResp' /space/createTmpPage: post: tags: - 页面 summary: (暂时废弃)创建临时页面 description: |4- 新:临时页面,能否只存在于浏览器本地? 非登录状态可以创建临时页面,默认一个浏览器只能创建一个自己的临时页面 创建完成后得到一个随机页面id(比如 240626-abcd),不使用lo等字符串,只使用其他字母 生成算法:当前时间转换的4个字母(时分秒) operationId: SpaceService_CreateTmpPage requestBody: content: application/json: schema: $ref: '#/components/schemas/.CreateTmpPageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TCreateTmpPageResp' /space/deletePage: post: tags: - 页面 summary: 真删除页面 description: |4- 删除后,所有该页面数据都会消失,所有人都无法打开该页面 页面创建者可以删除该页面 admin和管理员暂时不支持删除该页面 operationId: SpaceService_DeletePage requestBody: content: application/json: schema: $ref: '#/components/schemas/.DeletePageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TDeletePageResp' /space/getMySpace: post: tags: - 空间 summary: 拉取我的空间 description: |4- 登录状态才能拉到自己的空间 失效的分享返回 is_not_found 占位,由用户移除 operationId: SpaceService_GetMySpace requestBody: content: application/json: schema: $ref: '#/components/schemas/.GetMySpaceReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TGetMySpaceResp' /space/getPage: post: tags: - 页面 summary: 拉取某个页面数据 operationId: SpaceService_GetPage requestBody: content: application/json: schema: $ref: '#/components/schemas/.GetPageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TGetPageResp' /space/getUserInfo: post: tags: - SpaceService operationId: SpaceService_GetUserInfo requestBody: content: application/json: schema: $ref: '#/components/schemas/.GetUserInfoReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TGetUserInfoResp' /space/removePageLink: post: tags: - 页面 summary: 去除页面的某个链接 description: ' 把页面的只读链接、编辑链接删除' operationId: SpaceService_RemovePageLink requestBody: content: application/json: schema: $ref: '#/components/schemas/.RemovePageLinkReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TRemovePageLinkResp' /space/removeSharedPage: post: tags: - 空间 summary: 只移除登录用户的分享入口关联,允许分享已失效及空间变空 operationId: SpaceService_RemoveSharedPage requestBody: content: application/json: schema: $ref: '#/components/schemas/.RemoveSharedPageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TRemoveSharedPageResp' /space/savePageIds: post: tags: - 空间 summary: 调整我的空间下面的页面顺序 description: |4- 保留未提交的已有入口,删除共享入口请使用 RemoveSharedPage 保存结果会放到返回的page_ids中,也可以使用耗时多一些的getMySpace方法 operationId: SpaceService_SavePageIds requestBody: content: application/json: schema: $ref: '#/components/schemas/.SavePageIdsReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TSavePageIdsResp' /space/transferCollection: post: tags: - 页面 summary: 复制或移动整个文件夹到另一个可编辑页面 description: ' 该操作在同一个数据库事务内更新目标页面,以及移动时的源页面。' operationId: SpaceService_TransferCollection requestBody: content: application/json: schema: $ref: '#/components/schemas/.TransferCollectionReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TTransferCollectionResp' /space/updatePage: post: tags: - 页面 summary: 更新页面 operationId: SpaceService_UpdatePage requestBody: content: application/json: schema: $ref: '#/components/schemas/.UpdatePageReq' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/.TUpdatePageResp' components: schemas: .AddPageLinkReq: required: - page_id - page_type type: object properties: page_id: type: string description: 原始页面id page_type: type: string description: |- 生成只读、编辑、超级权限的链接 只读、编辑、超级权限的链接,只能生成一个, 如果已经存在,则需要提醒用户,会覆盖之前的链接 .AddPageLinkResp: type: object properties: new_page_id: type: string description: |- 只读:http://forgeturl.com/share_readonly/R加密字符串1 可编辑页面:http://forgeturl.com/share_editable/E加密字符串2 超级权限页面:http://forgeturl.com/share_admin/A加密字符串3 page_type: type: string description: 页面类型 .AddSharedPageReq: required: - page_id type: object properties: page_id: type: string .AddSharedPageResp: type: object properties: page_brief: $ref: '#/components/schemas/.PageBrief' page_ids: type: array items: type: string already_added: type: boolean .Collections: type: object properties: links: type: array items: $ref: '#/components/schemas/.Link' description: 每个文件夹里,有多个链接 title: type: string description: 文件夹标题 .CreatePageReq: required: - title type: object properties: title: type: string description: 页面标题 brief: type: string description: 页面描述 collections: type: array items: $ref: '#/components/schemas/.Collections' description: 页面中的文件夹 .CreatePageResp: type: object properties: page_id: type: string version: type: integer format: int64 page_ids: type: array items: type: string .CreateTmpPageReq: required: - user_uuid type: object properties: user_uuid: type: string description: 客户侧唯一识别码 .CreateTmpPageResp: type: object properties: page_id: type: string create_time: type: integer format: int64 update_time: type: integer format: int64 .DeletePageReq: type: object properties: page_id: type: string .DeletePageResp: type: object properties: {} .GetMySpaceReq: type: object properties: {} .GetMySpaceResp: type: object properties: space_name: type: string description: 空间名字 page_briefs: type: array items: $ref: '#/components/schemas/.PageBrief' description: |- 我的空间下面的页面 逻辑:如果没有自己的主页面,则调用接口创建自己的页面 .GetPageReq: type: object properties: page_id: type: string .GetPageResp: type: object properties: page: $ref: '#/components/schemas/.Page' .GetUserInfoReq: type: object properties: uid: type: integer description: 用户id format: int64 .GetUserInfoResp: type: object properties: uid: type: integer description: |- 以下是任何人,都能通过接口调用得到 用户id format: int64 display_name: type: string description: 展示名称 avatar: type: string description: 用户头像 email: type: string description: 用户邮箱 username: type: string description: |- 以下是登录态,且账号是自己才能获取到 用户名 status: type: integer description: 用户状态 normal 0,suspended 2,deleted 4 format: int32 last_login_time: type: integer description: 上一次登录时间 format: int64 is_admin: type: integer description: 是否是管理员 0:普通用户 1:管理员 format: int32 provider: type: string description: 账号注册来源 create_time: type: integer description: 用户创建时间 format: int64 update_time: type: integer description: 用户更新时间 format: int64 .Link: required: - title type: object properties: title: type: string description: 链接的展示的标题 url: type: string description: 链接的地址 tags: type: array items: type: string description: 链接的标签 photo_url: type: string description: 链接的图标地址(暂不支持) sub_links: type: array items: $ref: '#/components/schemas/.SubLink' description: 子链接 .Page: required: - title - brief type: object properties: page_id: type: string title: type: string brief: type: string description: 页面描述,放在页面最上方展示 collections: type: array items: $ref: '#/components/schemas/.Collections' description: 有一堆文件夹 version: type: integer description: 版本号,从0递增,当修改时需要传入该值 format: int64 create_time: type: integer description: 其他属性 format: int64 update_time: type: integer format: int64 is_self: type: boolean description: 是否是自己的页面 page_conf: allOf: - $ref: '#/components/schemas/.PageConf' description: 页面属性 readonly_page_id: type: string description: 如果是自己的页面,则会展示一下信息 edit_page_id: type: string admin_page_id: type: string owner_page_id: type: string description: 仅页面本人可见,用于从自己的分享返回个人空间 .PageBrief: required: - title - brief type: object properties: page_id: type: string title: type: string brief: type: string create_time: type: integer description: 创建时间 format: int64 update_time: type: integer description: 更新时间 format: int64 is_self: type: boolean description: 是否是自己的页面 page_conf: allOf: - $ref: '#/components/schemas/.PageConf' description: 页面配置 is_not_found: type: boolean description: 该链接是否找不到了 description: 页面简介 .PageConf: type: object properties: read_only: type: boolean description: |- 页面类型:只读、可编辑可删除、可编辑不可删除 只读 can_edit: type: boolean description: 可编辑 can_delete: type: boolean description: 可删除 .RemovePageLinkReq: required: - page_id - page_type type: object properties: page_id: type: string description: 原始页面id page_type: type: string description: |- 生成只读、编辑、超级权限的链接 只读、编辑、超级权限的链接,一次只能删除一个, 如果不存在则直接返回成功 .RemovePageLinkResp: type: object properties: {} .RemoveSharedPageReq: required: - page_id type: object properties: page_id: type: string .RemoveSharedPageResp: type: object properties: page_ids: type: array items: type: string .SavePageIdsReq: type: object properties: page_ids: type: array items: type: string description: 调整后页面id的顺序 base_page_ids: type: array items: type: string description: 排序前客户端持有的完整列表,check_base 为 true 时原子校验 check_base: type: boolean .SavePageIdsResp: type: object properties: page_ids: type: array items: type: string description: 调整后页面id的顺序 .SubLink: type: object properties: sub_title: type: string description: 展示的文字 sub_url: type: string description: 链接 .TAddPageLinkResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.AddPageLinkResp' .TAddSharedPageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.AddSharedPageResp' .TCreatePageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.CreatePageResp' .TCreateTmpPageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.CreateTmpPageResp' .TDeletePageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.DeletePageResp' .TGetMySpaceResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.GetMySpaceResp' .TGetPageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.GetPageResp' .TGetUserInfoResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.GetUserInfoResp' .TRemovePageLinkResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.RemovePageLinkResp' .TRemoveSharedPageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.RemoveSharedPageResp' .TSavePageIdsResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.SavePageIdsResp' .TTransferCollectionResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.TransferCollectionResp' .TUpdatePageResp: required: - code - msg - data type: object properties: code: type: integer format: int32 msg: type: string data: $ref: '#/components/schemas/.UpdatePageResp' .TransferCollectionReq: required: - source_page_id - target_page_id - operation type: object properties: source_page_id: type: string target_page_id: type: string source_collection_index: type: integer format: int32 operation: type: string source_version: type: integer format: int64 target_version: type: integer format: int64 .TransferCollectionResp: type: object properties: source_version: type: integer format: int64 target_version: type: integer format: int64 update_time: type: integer format: int64 .UpdatePageReq: required: - page_id - mask type: object properties: page_id: type: string title: type: string brief: type: string collections: type: array items: $ref: '#/components/schemas/.Collections' version: type: integer description: 版本号,从0递增,修改时需要传入该值,当超过最大值后会回退到0 format: int64 mask: type: integer description: |- 配置参数 0x01 title 0x02 brief 0x04 collections format: int64 .UpdatePageResp: type: object properties: update_time: type: integer format: int64 version: type: integer format: int64 tags: - name: 空间 - name: 页面