chore: update id type to int32 (#2076)

This commit is contained in:
boojack
2023-08-04 21:55:07 +08:00
committed by GitHub
parent cbe27923b3
commit 7c5296cf35
36 changed files with 208 additions and 198 deletions

View File

@@ -35,7 +35,7 @@ type SystemStatus struct {
// Customized server profile, including server name and external url.
CustomizedProfile CustomizedProfile `json:"customizedProfile"`
// Storage service ID.
StorageServiceID int `json:"storageServiceId"`
StorageServiceID int32 `json:"storageServiceId"`
// Local storage path.
LocalStoragePath string `json:"localStoragePath"`
// Memo display with updated timestamp.
@@ -126,7 +126,7 @@ func (s *APIV1Service) registerSystemRoutes(g *echo.Group) {
}
systemStatus.CustomizedProfile = customizedProfile
case SystemSettingStorageServiceIDName.String():
systemStatus.StorageServiceID = int(baseValue.(float64))
systemStatus.StorageServiceID = int32(baseValue.(float64))
case SystemSettingLocalStoragePathName.String():
systemStatus.LocalStoragePath = baseValue.(string)
case SystemSettingMemoDisplayWithUpdatedTsName.String():
@@ -141,7 +141,7 @@ func (s *APIV1Service) registerSystemRoutes(g *echo.Group) {
g.POST("/system/vacuum", func(c echo.Context) error {
ctx := c.Request().Context()
userID, ok := c.Get(auth.UserIDContextKey).(int)
userID, ok := c.Get(auth.UserIDContextKey).(int32)
if !ok {
return echo.NewHTTPError(http.StatusUnauthorized, "Missing user in session")
}