Skip to content

Commit a7ae487

Browse files
committed
new: add ui language to the current user update request
1 parent 96e8509 commit a7ae487

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/UserController.java

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static org.lowcoder.sdk.exception.BizError.INVALID_USER_STATUS;
44
import static org.lowcoder.sdk.util.ExceptionUtils.ofError;
55

6+
import lombok.RequiredArgsConstructor;
67
import org.apache.commons.lang3.StringUtils;
78
import org.lowcoder.api.authentication.dto.OrganizationDomainCheckResult;
89
import org.lowcoder.api.framework.view.ResponseView;
@@ -29,30 +30,17 @@
2930

3031
import reactor.core.publisher.Mono;
3132

33+
@RequiredArgsConstructor
3234
@RestController
3335
public class UserController implements UserEndpoints
3436
{
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;
5644

5745
@Override
5846
public Mono<ResponseView<?>> getUserProfile(ServerWebExchange exchange) {
@@ -91,6 +79,9 @@ public Mono<ResponseView<UserProfileView>> update(@RequestBody UpdateUserRequest
9179
updateUser.setName(updateUserRequest.getName());
9280
updateUser.setHasSetNickname(true);
9381
}
82+
if (StringUtils.isNotBlank(updateUserRequest.getUiLanguage())) {
83+
updateUser.setUiLanguage(updateUserRequest.getUiLanguage());
84+
}
9485
return userService.update(uid, updateUser);
9586
})
9687
.flatMap(user -> userHomeApiService.buildUserProfileView(user, exchange))
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
package org.lowcoder.api.usermanagement.view;
22

3-
public class UpdateUserRequest {
3+
import lombok.Data;
4+
import org.lowcoder.sdk.constants.UiConstants;
45

6+
@Data
7+
public class UpdateUserRequest {
58
private String name;
6-
7-
public String getName() {
8-
return name;
9-
}
10-
11-
public void setName(String name) {
12-
this.name = name;
13-
}
9+
private String uiLanguage = UiConstants.DEFAULT_UI_LANGUAGE;
1410
}

0 commit comments

Comments
 (0)