Skip to content

Commit

Permalink
feat: allow users to manage their attachments in uc (#6731)
Browse files Browse the repository at this point in the history
#### What type of PR is this?
/kind feature
/milestone 2.20.x
/area core

#### What this PR does / why we need it:
支持用户在个人中心管理自己的附件(需要具有对应权限)

Fixes #5278

#### Does this PR introduce a user-facing change?
```release-note
支持用户在个人中心管理自己的附件(需要具有对应权限)
```
  • Loading branch information
guqing authored Oct 8, 2024
1 parent edb3f1c commit 2585636
Show file tree
Hide file tree
Showing 36 changed files with 2,514 additions and 583 deletions.
349 changes: 247 additions & 102 deletions api-docs/openapi/v3_0/aggregated.json
Original file line number Diff line number Diff line change
Expand Up @@ -14722,87 +14722,6 @@
]
}
},
"/apis/uc.api.content.halo.run/v1alpha1/attachments": {
"post": {
"description": "Create attachment for the given post.",
"operationId": "CreateAttachmentForPost",
"parameters": [
{
"description": "Wait for permalink.",
"in": "query",
"name": "waitForPermalink",
"schema": {
"type": "boolean"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PostAttachmentRequest"
}
}
}
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Uc"
]
}
},
"/apis/uc.api.content.halo.run/v1alpha1/attachments/-/upload-from-url": {
"post": {
"description": "Upload attachment from the given URL.",
"operationId": "ExternalTransferAttachment_1",
"parameters": [
{
"description": "Wait for permalink.",
"in": "query",
"name": "waitForPermalink",
"schema": {
"type": "boolean"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadFromUrlRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Uc"
]
}
},
"/apis/uc.api.content.halo.run/v1alpha1/posts": {
"get": {
"description": "List posts owned by the current user.",
Expand Down Expand Up @@ -15570,6 +15489,217 @@
"PersonalAccessTokenV1alpha1Uc"
]
}
},
"/apis/uc.api.storage.halo.run/v1alpha1/attachments": {
"get": {
"description": "List attachments of the current user uploaded.",
"operationId": "ListMyAttachments",
"parameters": [
{
"description": "Page number. Default is 0.",
"in": "query",
"name": "page",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"description": "Size number. Default is 0.",
"in": "query",
"name": "size",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"description": "Label selector. e.g.: hidden!\u003dtrue",
"in": "query",
"name": "labelSelector",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"description": "Field selector. e.g.: metadata.name\u003d\u003dhalo",
"in": "query",
"name": "fieldSelector",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.",
"in": "query",
"name": "sort",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"description": "Filter attachments without group. This parameter will ignore group parameter.",
"in": "query",
"name": "ungrouped",
"schema": {
"type": "boolean"
}
},
{
"description": "Keyword for searching.",
"in": "query",
"name": "keyword",
"schema": {
"type": "string"
}
},
{
"description": "Acceptable media types.",
"in": "query",
"name": "accepts",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
],
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/AttachmentList"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Uc"
]
},
"post": {
"description": "Create attachment for the given post.",
"operationId": "CreateAttachmentForPost",
"parameters": [
{
"description": "Wait for permalink.",
"in": "query",
"name": "waitForPermalink",
"schema": {
"type": "boolean"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PostAttachmentRequest"
}
}
}
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Uc"
]
}
},
"/apis/uc.api.storage.halo.run/v1alpha1/attachments/-/upload": {
"post": {
"description": "Upload attachment to user center storage.",
"operationId": "UploadUcAttachment",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/UcUploadRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Uc"
]
}
},
"/apis/uc.api.storage.halo.run/v1alpha1/attachments/-/upload-from-url": {
"post": {
"description": "Upload attachment from the given URL.",
"operationId": "ExternalTransferAttachment_1",
"parameters": [
{
"description": "Wait for permalink.",
"in": "query",
"name": "waitForPermalink",
"schema": {
"type": "boolean"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadFromUrlRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Uc"
]
}
}
},
"components": {
Expand Down Expand Up @@ -19740,6 +19870,9 @@
}
}
},
"Part": {
"type": "object"
},
"PasswordRequest": {
"required": [
"password"
Expand Down Expand Up @@ -23476,6 +23609,39 @@
}
}
},
"UcUploadRequest": {
"required": [
"file"
],
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
},
"formData": {
"type": "object",
"properties": {
"all": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/Part"
},
"writeOnly": true
},
"empty": {
"type": "boolean"
}
},
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Part"
}
}
}
}
},
"UpgradeFromUriRequest": {
"required": [
"uri"
Expand Down Expand Up @@ -23625,36 +23791,15 @@
},
"UserConnectionSpec": {
"required": [
"accessToken",
"displayName",
"providerUserId",
"registrationId",
"username"
],
"type": "object",
"properties": {
"accessToken": {
"type": "string"
},
"avatarUrl": {
"type": "string"
},
"displayName": {
"type": "string"
},
"expiresAt": {
"type": "string",
"format": "date-time"
},
"profileUrl": {
"type": "string"
},
"providerUserId": {
"type": "string"
},
"refreshToken": {
"type": "string"
},
"registrationId": {
"type": "string"
},
Expand Down
Loading

0 comments on commit 2585636

Please sign in to comment.