mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: code clean
This commit is contained in:
parent
f0334d5755
commit
ee9e092129
@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func (*APIV1Service) registerURLUtilRoutes(g *echo.Group) {
|
||||
// GET /url/favicon?url=...
|
||||
g.GET("/url/favicon", func(c echo.Context) error {
|
||||
url := c.QueryParam("url")
|
||||
icons, err := favicon.Find(url)
|
||||
|
@ -80,10 +80,6 @@ type PatchUserRequest struct {
|
||||
Password *string `json:"password"`
|
||||
}
|
||||
|
||||
type UserDelete struct {
|
||||
ID int
|
||||
}
|
||||
|
||||
func (s *APIV1Service) registerUserRoutes(g *echo.Group) {
|
||||
g.GET("/user", func(c echo.Context) error {
|
||||
ctx := c.Request().Context()
|
||||
@ -160,7 +156,6 @@ func (s *APIV1Service) registerUserRoutes(g *echo.Group) {
|
||||
if !validateEmail(*userPatch.Email) {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("invalid email format: %s", *userPatch.Email))
|
||||
}
|
||||
|
||||
updateUser.Email = userPatch.Email
|
||||
}
|
||||
if userPatch.Nickname != nil {
|
||||
|
@ -13,11 +13,8 @@ const (
|
||||
)
|
||||
|
||||
// String returns the string format of UserSettingKey type.
|
||||
func (key UserSettingKey) String() string {
|
||||
if key == UserSettingLocaleKey {
|
||||
return "locale"
|
||||
}
|
||||
return ""
|
||||
func (k UserSettingKey) String() string {
|
||||
return string(k)
|
||||
}
|
||||
|
||||
var (
|
||||
@ -27,7 +24,7 @@ var (
|
||||
type UserSetting struct {
|
||||
UserID int
|
||||
Key UserSettingKey `json:"key"`
|
||||
// Value is a JSON string with basic value
|
||||
// Value is a JSON string with basic value.
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user