Skip to content

Commit

Permalink
config and message
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangtien2k3 committed Aug 21, 2024
1 parent 8b62f87 commit 37cc1fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.time.*;
import java.util.*;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.data.convert.WritingConverter;
Expand Down Expand Up @@ -115,7 +116,7 @@ public enum BinaryToUUIDConverter implements Converter<byte[], UUID> {
INSTANCE;

@Override
public UUID convert(byte[] source) {
public UUID convert(@NotNull byte[] source) {
ByteBuffer byteBuffer = ByteBuffer.wrap(source);
long high = byteBuffer.getLong();
long low = byteBuffer.getLong();
Expand Down Expand Up @@ -148,7 +149,7 @@ public enum ZonedDateTimeReadConverter implements Converter<LocalDateTime, Zoned
INSTANCE;

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

@Override
public Long convert(Duration source) {
return source != null ? source.toMillis() : null;
return source.toMillis();
}
}

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

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

@Override
public Duration convert(Long source) {
return source != null ? Duration.ofMillis(source) : null;
public Duration convert(@NotNull Long source) {
return Duration.ofMillis(source);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,4 @@ public class MessageConstant {
public static final String SUCCESS = "success";
public static final String FAIL = "fail";
public static final String ERROR_CODE_SUCCESS = "0";

// public static final String PARAMS_INVALID = "params.invalid";
// public static final String QUERY_CART_ITEM_NOT_FOUND = "query.cartItem.not.found";
// public static final String ORGANIZATION_INVALID = "organization.invalid";
// public static final String ORGANIZATION_NOT_FOUND = "organization.notFound";
// public static final String USER_NOT_IN_ORGANIZATION = "user.notFound.in.organization";
// public static final String ORGANIZATION_LEVEL1_NOT_FOUND = "organization.level1.notFound";
// public static final String POSITION_NOT_EXISTS = "postion.not.exists";
// public static final String USER_NAME_NOT_EXISTS = "user.name.not.exists";
// public static final String CODE_NOT_EXISTS = "employee.code.not.exists";
// public static final String ORGANIZATION_NOT_EXISTS = "organization.not.exists";
// public static final String MANAGER_NOT_EXISTS = "manager.not.exists";
// public static final String EMPLOYEE_ORGANIZATION_IS_EXISTS = "employee.organization.is.exists";
// public static final String EMPLOYEE_ORGANIZATION_NOT_EXISTS = "organization.employee.is.exists";
}
17 changes: 10 additions & 7 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ logging:
org.springframework.r2dbc: DEBUG
io.r2dbc.postgresql.QUERY: DEBUG
io.r2dbc.postgresql.PARAM: DEBUG
dotenv:
enabled: true
active: true

# spring config
spring:
Expand Down Expand Up @@ -84,12 +87,12 @@ client:
name: keycloak
auth:
client-id: ezbuy-client
client-secret: #clientSecret
client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw

#keycloak client config
keycloak:
clientId: ezbuy-client
clientSecret: #clientSecret
clientSecret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
realm: ezbuy-server
serverUrl: http://localhost:8080
grantType: password
Expand All @@ -101,15 +104,15 @@ minio:
enabled: true
baseUrl: http://localhost:9000
publicUrl: http://localhost:9000/ezbuy-bucket
accessKey: #accessKey
secretKey: #secretKey
accessKey: 4DoaZ0KdzpXdDlVK104t
secretKey: nuRiQUIJNVygMOHhmtR4LT1etAa7F8PQOsRGP5oj
private:
bucket: ezbuy-private

#generate public key
hashing-password:
public-key: #public-key
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw5e+CZbXbC8SRbrp+X9O4QRrKQWRu2zJpYGmGtP3bdS6NtsVBaJz2hHwF1KeEzZTnlW/jy7NOYYR5Rp5nD1RfAJooxZxgO7BcZZKbsnBNe+KLUQrxNOgkx2ZpMs60UdzToz0IvIN5L5NFaiKq5/WwRpG4aIM8iV/ME1L/QQw0FDD7m/2PUxDlANXJl5hZgXfZ1hpo/31HXkBofJTWJ/MdTAnxR4u5y+mXYUsf9GmCmA5exPpPZZv1qT1D7AWv0CXi5Ftd2ylbD6jAtF5MC1ngO4FEGZh9uTwXQh2x8FJmc2U7KKTQMWuhbXtkANVVLMg+GPx7lTxDTwQpKmldf5UDuuzcBQIDAQAB
#config proxy
proxy-client:
host: 10.207.157.50
port: 3129
host: 10.207.156.52
port: 3128

0 comments on commit 37cc1fa

Please sign in to comment.