chore: rename workspace setting service

This commit is contained in:
Steven
2024-01-29 22:43:40 +08:00
parent dd9ee44a1f
commit de8db63811
28 changed files with 1537 additions and 189 deletions

View File

@@ -62,7 +62,7 @@ func (s *APIV1Service) SignIn(c echo.Context) error {
ctx := c.Request().Context()
signin := &SignIn{}
disablePasswordLoginSystemSetting, err := s.Store.GetSystemSetting(ctx, &store.FindSystemSetting{
disablePasswordLoginSystemSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Name: SystemSettingDisablePasswordLoginName.String(),
})
if err != nil {
@@ -186,7 +186,7 @@ func (s *APIV1Service) SignInSSO(c echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError, "Incorrect login credentials, please try again")
}
if user == nil {
allowSignUpSetting, err := s.Store.GetSystemSetting(ctx, &store.FindSystemSetting{
allowSignUpSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Name: SystemSettingAllowSignUpName.String(),
})
if err != nil {
@@ -303,7 +303,7 @@ func (s *APIV1Service) SignUp(c echo.Context) error {
// Change the default role to host if there is no host user.
userCreate.Role = store.RoleHost
} else {
allowSignUpSetting, err := s.Store.GetSystemSetting(ctx, &store.FindSystemSetting{
allowSignUpSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Name: SystemSettingAllowSignUpName.String(),
})
if err != nil {
@@ -321,7 +321,7 @@ func (s *APIV1Service) SignUp(c echo.Context) error {
return echo.NewHTTPError(http.StatusUnauthorized, "signup is disabled").SetInternal(err)
}
disablePasswordLoginSystemSetting, err := s.Store.GetSystemSetting(ctx, &store.FindSystemSetting{
disablePasswordLoginSystemSetting, err := s.Store.GetWorkspaceSetting(ctx, &store.FindWorkspaceSetting{
Name: SystemSettingDisablePasswordLoginName.String(),
})
if err != nil {