|
3 | 3 | import static org.lowcoder.sdk.exception.BizError.INVALID_USER_STATUS;
|
4 | 4 | import static org.lowcoder.sdk.util.ExceptionUtils.ofError;
|
5 | 5 |
|
| 6 | +import lombok.RequiredArgsConstructor; |
6 | 7 | import org.apache.commons.lang3.StringUtils;
|
7 | 8 | import org.lowcoder.api.authentication.dto.OrganizationDomainCheckResult;
|
8 | 9 | import org.lowcoder.api.framework.view.ResponseView;
|
|
29 | 30 |
|
30 | 31 | import reactor.core.publisher.Mono;
|
31 | 32 |
|
| 33 | +@RequiredArgsConstructor |
32 | 34 | @RestController
|
33 | 35 | public class UserController implements UserEndpoints
|
34 | 36 | {
|
35 |
| - |
36 |
| - @Autowired |
37 |
| - private SessionUserService sessionUserService; |
38 |
| - |
39 |
| - @Autowired |
40 |
| - private UserService userService; |
41 |
| - |
42 |
| - @Autowired |
43 |
| - private UserHomeApiService userHomeApiService; |
44 |
| - |
45 |
| - @Autowired |
46 |
| - private OrgApiService orgApiService; |
47 |
| - |
48 |
| - @Autowired |
49 |
| - private UserStatusService userStatusService; |
50 |
| - |
51 |
| - @Autowired |
52 |
| - private UserApiService userApiService; |
53 |
| - |
54 |
| - @Autowired |
55 |
| - private CommonConfig commonConfig; |
| 37 | + private final SessionUserService sessionUserService; |
| 38 | + private final UserService userService; |
| 39 | + private final UserHomeApiService userHomeApiService; |
| 40 | + private final OrgApiService orgApiService; |
| 41 | + private final UserStatusService userStatusService; |
| 42 | + private final UserApiService userApiService; |
| 43 | + private final CommonConfig commonConfig; |
56 | 44 |
|
57 | 45 | @Override
|
58 | 46 | public Mono<ResponseView<?>> getUserProfile(ServerWebExchange exchange) {
|
@@ -91,6 +79,9 @@ public Mono<ResponseView<UserProfileView>> update(@RequestBody UpdateUserRequest
|
91 | 79 | updateUser.setName(updateUserRequest.getName());
|
92 | 80 | updateUser.setHasSetNickname(true);
|
93 | 81 | }
|
| 82 | + if (StringUtils.isNotBlank(updateUserRequest.getUiLanguage())) { |
| 83 | + updateUser.setUiLanguage(updateUserRequest.getUiLanguage()); |
| 84 | + } |
94 | 85 | return userService.update(uid, updateUser);
|
95 | 86 | })
|
96 | 87 | .flatMap(user -> userHomeApiService.buildUserProfileView(user, exchange))
|
|
0 commit comments