🐛 Fix API mapping issue

This commit is contained in:
LittleSheep 2024-06-30 11:52:36 +08:00
parent 659fc8375c
commit 133bbcc6bc
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Admin notify all API" />
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix request body validation" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -149,7 +149,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value=":sparkles: Better avatar and banner APIs" />
<MESSAGE value=":bug: Fix avatar and banner APIs" />
<MESSAGE value=":bug: Fix frontend" />
<MESSAGE value=":card_file_box: Add the status model" />
@ -174,7 +173,8 @@
<MESSAGE value=":bug: Fix status query condition" />
<MESSAGE value=":bug: Fix disturbable condition" />
<MESSAGE value=":sparkles: Admin notify all API" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Admin notify all API" />
<MESSAGE value=":bug: Fix request body validation" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix request body validation" />
</component>
<component name="VgoProject">
<settings-migrated>true</settings-migrated>

View File

@ -4,7 +4,7 @@ import (
"github.com/gofiber/fiber/v2"
)
func MapAdminEndpoints(app *fiber.App) {
func MapAdminAPIs(app *fiber.App) {
admin := app.Group("/api/admin")
{
admin.Post("/badges", grantBadge)

View File

@ -61,8 +61,8 @@ func NewServer() *HTTPApp {
app.Use(exts.AuthMiddleware)
app.Use(i18n.I18nMiddleware)
admin.MapAdminAPIs(app)
api.MapAPIs(app)
admin.MapAdminEndpoints(app)
app.Use(filesystem.New(filesystem.Config{
Root: http.Dir(viper.GetString("frontend_app")),