Skip to content

Commit 37cc1fa

Browse files
committed
config and message
1 parent 8b62f87 commit 37cc1fa

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

src/main/java/io/hoangtien2k3/commons/config/DatabaseConversion.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.time.*;
2121
import java.util.*;
2222
import lombok.extern.slf4j.Slf4j;
23+
import org.jetbrains.annotations.NotNull;
2324
import org.springframework.core.convert.converter.Converter;
2425
import org.springframework.data.convert.ReadingConverter;
2526
import org.springframework.data.convert.WritingConverter;
@@ -115,7 +116,7 @@ public enum BinaryToUUIDConverter implements Converter<byte[], UUID> {
115116
INSTANCE;
116117

117118
@Override
118-
public UUID convert(byte[] source) {
119+
public UUID convert(@NotNull byte[] source) {
119120
ByteBuffer byteBuffer = ByteBuffer.wrap(source);
120121
long high = byteBuffer.getLong();
121122
long low = byteBuffer.getLong();
@@ -148,7 +149,7 @@ public enum ZonedDateTimeReadConverter implements Converter<LocalDateTime, Zoned
148149
INSTANCE;
149150

150151
@Override
151-
public ZonedDateTime convert(LocalDateTime localDateTime) {
152+
public ZonedDateTime convert(@NotNull LocalDateTime localDateTime) {
152153
// Be aware - we are using the UTC timezone
153154
return ZonedDateTime.of(localDateTime, ZoneOffset.UTC);
154155
}
@@ -170,7 +171,7 @@ public enum DurationWriteConverter implements Converter<Duration, Long> {
170171

171172
@Override
172173
public Long convert(Duration source) {
173-
return source != null ? source.toMillis() : null;
174+
return source.toMillis();
174175
}
175176
}
176177

@@ -182,8 +183,7 @@ public enum LocalDateTimeToDateReadConverter implements Converter<LocalDateTime,
182183
public Date convert(LocalDateTime localDateTime) {
183184
// Be aware - we are using the UTC timezone
184185
Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
185-
Date date = Date.from(instant);
186-
return date;
186+
return Date.from(instant);
187187
}
188188
}
189189

@@ -192,8 +192,8 @@ public enum DurationReadConverter implements Converter<Long, Duration> {
192192
INSTANCE;
193193

194194
@Override
195-
public Duration convert(Long source) {
196-
return source != null ? Duration.ofMillis(source) : null;
195+
public Duration convert(@NotNull Long source) {
196+
return Duration.ofMillis(source);
197197
}
198198
}
199199
}

src/main/java/io/hoangtien2k3/commons/constants/MessageConstant.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,4 @@ public class MessageConstant {
1818
public static final String SUCCESS = "success";
1919
public static final String FAIL = "fail";
2020
public static final String ERROR_CODE_SUCCESS = "0";
21-
22-
// public static final String PARAMS_INVALID = "params.invalid";
23-
// public static final String QUERY_CART_ITEM_NOT_FOUND = "query.cartItem.not.found";
24-
// public static final String ORGANIZATION_INVALID = "organization.invalid";
25-
// public static final String ORGANIZATION_NOT_FOUND = "organization.notFound";
26-
// public static final String USER_NOT_IN_ORGANIZATION = "user.notFound.in.organization";
27-
// public static final String ORGANIZATION_LEVEL1_NOT_FOUND = "organization.level1.notFound";
28-
// public static final String POSITION_NOT_EXISTS = "postion.not.exists";
29-
// public static final String USER_NAME_NOT_EXISTS = "user.name.not.exists";
30-
// public static final String CODE_NOT_EXISTS = "employee.code.not.exists";
31-
// public static final String ORGANIZATION_NOT_EXISTS = "organization.not.exists";
32-
// public static final String MANAGER_NOT_EXISTS = "manager.not.exists";
33-
// public static final String EMPLOYEE_ORGANIZATION_IS_EXISTS = "employee.organization.is.exists";
34-
// public static final String EMPLOYEE_ORGANIZATION_NOT_EXISTS = "organization.employee.is.exists";
3521
}

src/main/resources/application.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ logging:
88
org.springframework.r2dbc: DEBUG
99
io.r2dbc.postgresql.QUERY: DEBUG
1010
io.r2dbc.postgresql.PARAM: DEBUG
11+
dotenv:
12+
enabled: true
13+
active: true
1114

1215
# spring config
1316
spring:
@@ -84,12 +87,12 @@ client:
8487
name: keycloak
8588
auth:
8689
client-id: ezbuy-client
87-
client-secret: #clientSecret
90+
client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
8891

8992
#keycloak client config
9093
keycloak:
9194
clientId: ezbuy-client
92-
clientSecret: #clientSecret
95+
clientSecret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
9396
realm: ezbuy-server
9497
serverUrl: http://localhost:8080
9598
grantType: password
@@ -101,15 +104,15 @@ minio:
101104
enabled: true
102105
baseUrl: http://localhost:9000
103106
publicUrl: http://localhost:9000/ezbuy-bucket
104-
accessKey: #accessKey
105-
secretKey: #secretKey
107+
accessKey: 4DoaZ0KdzpXdDlVK104t
108+
secretKey: nuRiQUIJNVygMOHhmtR4LT1etAa7F8PQOsRGP5oj
106109
private:
107110
bucket: ezbuy-private
108111

109112
#generate public key
110113
hashing-password:
111-
public-key: #public-key
114+
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw5e+CZbXbC8SRbrp+X9O4QRrKQWRu2zJpYGmGtP3bdS6NtsVBaJz2hHwF1KeEzZTnlW/jy7NOYYR5Rp5nD1RfAJooxZxgO7BcZZKbsnBNe+KLUQrxNOgkx2ZpMs60UdzToz0IvIN5L5NFaiKq5/WwRpG4aIM8iV/ME1L/QQw0FDD7m/2PUxDlANXJl5hZgXfZ1hpo/31HXkBofJTWJ/MdTAnxR4u5y+mXYUsf9GmCmA5exPpPZZv1qT1D7AWv0CXi5Ftd2ylbD6jAtF5MC1ngO4FEGZh9uTwXQh2x8FJmc2U7KKTQMWuhbXtkANVVLMg+GPx7lTxDTwQpKmldf5UDuuzcBQIDAQAB
112115
#config proxy
113116
proxy-client:
114-
host: 10.207.157.50
115-
port: 3129
117+
host: 10.207.156.52
118+
port: 3128

0 commit comments

Comments
 (0)