🐛 Fix request body validation
This commit is contained in:
parent
78604db54e
commit
659fc8375c
@ -4,11 +4,7 @@
|
|||||||
<option name="autoReloadType" value="ALL" />
|
<option name="autoReloadType" value="ALL" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix disturbable condition">
|
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Admin notify all API" />
|
||||||
<change afterPath="$PROJECT_DIR$/pkg/internal/server/admin/notify_api.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/pkg/internal/server/admin/index.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/admin/index.go" afterDir="false" />
|
|
||||||
</list>
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
@ -153,7 +149,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value=":bug: Fix magic token's foreign key" />
|
|
||||||
<MESSAGE value=":sparkles: Better avatar and banner APIs" />
|
<MESSAGE value=":sparkles: Better avatar and banner APIs" />
|
||||||
<MESSAGE value=":bug: Fix avatar and banner APIs" />
|
<MESSAGE value=":bug: Fix avatar and banner APIs" />
|
||||||
<MESSAGE value=":bug: Fix frontend" />
|
<MESSAGE value=":bug: Fix frontend" />
|
||||||
@ -178,7 +173,8 @@
|
|||||||
<MESSAGE value=":bug: Fix bugs in status" />
|
<MESSAGE value=":bug: Fix bugs in status" />
|
||||||
<MESSAGE value=":bug: Fix status query condition" />
|
<MESSAGE value=":bug: Fix status query condition" />
|
||||||
<MESSAGE value=":bug: Fix disturbable condition" />
|
<MESSAGE value=":bug: Fix disturbable condition" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix disturbable condition" />
|
<MESSAGE value=":sparkles: Admin notify all API" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Admin notify all API" />
|
||||||
</component>
|
</component>
|
||||||
<component name="VgoProject">
|
<component name="VgoProject">
|
||||||
<settings-migrated>true</settings-migrated>
|
<settings-migrated>true</settings-migrated>
|
||||||
|
@ -11,8 +11,6 @@ import (
|
|||||||
|
|
||||||
func notifyAllUser(c *fiber.Ctx) error {
|
func notifyAllUser(c *fiber.Ctx) error {
|
||||||
var data struct {
|
var data struct {
|
||||||
ClientID string `json:"client_id" validate:"required"`
|
|
||||||
ClientSecret string `json:"client_secret" validate:"required"`
|
|
||||||
Type string `json:"type" validate:"required"`
|
Type string `json:"type" validate:"required"`
|
||||||
Subject string `json:"subject" validate:"required,max=1024"`
|
Subject string `json:"subject" validate:"required,max=1024"`
|
||||||
Content string `json:"content" validate:"required,max=4096"`
|
Content string `json:"content" validate:"required,max=4096"`
|
||||||
@ -20,7 +18,6 @@ func notifyAllUser(c *fiber.Ctx) error {
|
|||||||
Links []models.NotificationLink `json:"links"`
|
Links []models.NotificationLink `json:"links"`
|
||||||
IsForcePush bool `json:"is_force_push"`
|
IsForcePush bool `json:"is_force_push"`
|
||||||
IsRealtime bool `json:"is_realtime"`
|
IsRealtime bool `json:"is_realtime"`
|
||||||
UserID uint `json:"user_id" validate:"required"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := exts.BindAndValidate(c, &data); err != nil {
|
if err := exts.BindAndValidate(c, &data); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user