1
1
package org .lowcoder .domain .user .model ;
2
2
3
- import static com .google .common .base .Suppliers .memoize ;
4
- import static org .lowcoder .infra .util .AssetUtils .toAssetPath ;
5
-
6
- import java .time .Instant ;
7
- import java .util .*;
8
- import java .util .function .Supplier ;
9
-
3
+ import com .fasterxml .jackson .annotation .JsonIgnore ;
4
+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
5
+ import com .fasterxml .jackson .annotation .JsonProperty ;
10
6
import com .fasterxml .jackson .core .type .TypeReference ;
11
7
import lombok .*;
12
8
import lombok .experimental .SuperBuilder ;
13
9
import lombok .extern .jackson .Jacksonized ;
14
10
import org .apache .commons .collections4 .CollectionUtils ;
15
- import org .apache .commons .collections4 .ListUtils ;
16
11
import org .apache .commons .collections4 .SetUtils ;
17
12
import org .apache .commons .lang3 .StringUtils ;
18
13
import org .lowcoder .domain .mongodb .AfterMongodbRead ;
25
20
import org .springframework .data .annotation .Transient ;
26
21
import org .springframework .data .mongodb .core .mapping .Document ;
27
22
28
- import com .fasterxml .jackson .annotation .JsonIgnore ;
29
- import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
30
- import com .fasterxml .jackson .annotation .JsonProperty ;
23
+ import java .time .Instant ;
24
+ import java .util .*;
25
+ import java .util .function .Supplier ;
26
+
27
+ import static com .google .common .base .Suppliers .memoize ;
28
+ import static org .lowcoder .infra .util .AssetUtils .toAssetPath ;
31
29
32
30
33
31
@ Getter
@@ -44,8 +42,7 @@ public class User extends HasIdAndAuditing implements BeforeMongodbWrite, AfterM
44
42
45
43
private String name ;
46
44
47
- @ Builder .Default
48
- private String uiLanguage = UiConstants .DEFAULT_UI_LANGUAGE ;
45
+ private String uiLanguage ;
49
46
50
47
private String avatar ;
51
48
@@ -159,5 +156,10 @@ public void afterMongodbRead(MongodbInterceptorContext context) {
159
156
}, new ArrayList <>());
160
157
this .apiKeysList .forEach (authConfig -> authConfig .doDecrypt (s -> context .encryptionService ().decryptString (s )));
161
158
}
159
+
160
+ /** set UI language to default one if it's null **/
161
+ if (StringUtils .isBlank (this .uiLanguage )) {
162
+ this .uiLanguage = UiConstants .DEFAULT_UI_LANGUAGE ;
163
+ }
162
164
}
163
165
}
0 commit comments