-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upload sticker backend api (#2)
#### What type of PR is this? /kind feature #### What this PR does / why we need it: - Added new endpoints for sticker management including uploading, deleting, and fetching stickers and groups. - Registered `Sticker` and `StickerGroup` models within the plugin, including their corresponding API endpoints. - Updated `build.gradle` to modify Gradle and plugin settings, including docker configuration. #### Which issue(s) this PR fixes: N/A #### Special notes for your reviewer: NONE #### Does this PR introduce a user-facing change? ```release-note NONE ```
- Loading branch information
Showing
22 changed files
with
949 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# plugin-sticker | ||
|
||
TODO | ||
## 开发记录 | ||
|
||
### 模型设计 | ||
|
||
#### Sticker | ||
|
||
|
||
|
||
### 接口设计 | ||
|
||
#### GET `/sticker/{stickerid}` | ||
获取具体表情包 (所有人) | ||
|
||
#### POST `/sticker/{username}/upload` | ||
用户表情包上传 (本人) | ||
#### DELETE `/sticker/{stickerid}` | ||
删除用户表情包 (本人 | 管理员) | ||
|
||
#### GET `/stickers/{username}/` | ||
获取用户表情包列表 (本人 | 管理员) | ||
|
||
#### GET `/stickergroup` | ||
获取分组表情包列表(管理员) | ||
#### POST `/stickergroup` | ||
创建分组(管理员) | ||
#### DELETE `/stickergroup/{groupname}` | ||
删除分组(管理员) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#Wed May 10 13:57:01 CST 2023 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
package run.halo.sticker; | ||
|
||
import org.springframework.stereotype.Component; | ||
import run.halo.app.extension.Scheme; | ||
import run.halo.app.extension.SchemeManager; | ||
import run.halo.app.plugin.BasePlugin; | ||
import run.halo.app.plugin.PluginContext; | ||
import run.halo.sticker.model.Sticker; | ||
import run.halo.sticker.model.StickerGroup; | ||
|
||
@Component | ||
public class StickerPlugin extends BasePlugin { | ||
private final SchemeManager schemeManager; | ||
|
||
public StickerPlugin(PluginContext pluginContext) { | ||
public StickerPlugin(PluginContext pluginContext, SchemeManager schemeManager) { | ||
super(pluginContext); | ||
this.schemeManager = schemeManager; | ||
} | ||
|
||
@Override | ||
public void start() { | ||
schemeManager.register(Sticker.class); | ||
schemeManager.register(StickerGroup.class); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
schemeManager.unregister(Scheme.buildFromType(Sticker.class)); | ||
schemeManager.unregister(Scheme.buildFromType(StickerGroup.class)); | ||
} | ||
} |
Oops, something went wrong.