config: config set

dev
minuk926 2 years ago
parent 5ed807b717
commit faa273f382

@ -28,7 +28,7 @@ plugins {
group = 'com.xit'
version = '0.0.1-SNAPSHOT'
description = 'xit-opst-be'
sourceCompatibility = '11'
sourceCompatibility = '1.8'
// WAS : bootWar.enabled = false
bootWar.enabled = false
@ -70,8 +70,8 @@ dependencies {
//implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
//implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//implementation 'org.springframework.boot:spring-boot-starter-jdbc'
// config
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.3'

@ -9,8 +9,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.springframework.security.crypto.password.PasswordEncoder;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
//import javax.persistence.EnumType;
//import javax.persistence.Enumerated;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
@ -59,13 +59,13 @@ public class CmmUserDto implements Serializable { //extends RepresentationModel<
private String email;
@Schema(required = true, title = "권한", example = "USER", description = "권한 - ROLE_USER, ROLE_ADMIN")
@Enumerated(EnumType.STRING)
//@Enumerated(EnumType.STRING)
@EnumNamePattern(regexp = "ADMIN|USER|GUEST", message = "{auth.user.pattern.RoleType}")
private RoleType roleType;
////////////////////////// Socail 사용시 ////////////////////////////////////////////////////////////////
@Schema(required = true, title = "ProviderType Type", example = "LOCAL", description = "SNS TYPE")
@Enumerated(EnumType.STRING)
//@Enumerated(EnumType.STRING)
@Enums(enumClass = ProviderType.class, ignoreCase = false, message = "{auth.user.pattern.ProviderType}")
private ProviderType providerType;

@ -6,27 +6,13 @@ import com.xit.core.oauth2.oauth.entity.RoleType;
import com.xit.core.support.jpa.AuditEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.Hibernate;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
@Schema(name = "CmmUserMst", description = "사용자 마스터") //, parent = AuditEntity.class)
@Table(
name = "tb_cmm_user_mst",
indexes = {
@Index(unique = true, name = "idx_tb_cmm_user_mst_01", columnList ="user_id")
//@Index(name = "idx_tb_cmm_user_mst_02", columnList ="user_id,user_name,user_email")
}
)
@Entity
@DynamicInsert
@DynamicUpdate
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@ -37,72 +23,47 @@ public class CmmUser extends AuditEntity implements Serializable { //extends Rep
@Setter
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Schema(required = true, title = "사용자ID(PK)", example = "W000000001")
@Id
@Column(name = "cmm_user_id", length = 64)
private String cmmUserId;
@Setter
@Schema(required = true, title = "사용자ID(실제ID)", example = "minuk926", description = "논리적인 실제 PK(unique)")
@Column(name = "user_id", length = 64, nullable = false, unique = true)
//@NotNull
//@Size(max = 64)
private String userId;
//TODO : ???
@Setter
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@Schema(required = true, title = "사용자 비밀번호", example = "minuk926")
@Column(name="password", length = 128, nullable = false)
//@NotNull
//@Size(max = 128)
private String password;
@Setter
@Schema(required = true, title = "사용자 이름", example = "홍길동")
@Column(name="user_name", length = 100, nullable = false)
//@NotNull
//@Size(max = 100)
private String userName;
@Setter
@Schema(title = "사용자 이메일", example = "a@b.com")
@Column(name="email", length = 100, nullable = false)
//@Size(max = 100)
private String email;
@Setter
@Schema(title = "전화번호", example = "01012341234")
@Column(name="user_mbl", length = 100)
//@Size(max = 128)
private String userMbl;
@Setter
@Column(name = "role_type", length = 20, nullable = false)
@Enumerated(EnumType.STRING)
//@NotNull
private RoleType roleType;
/////////////////////////// Social login 관련 ////////////////////////////////////
@Setter
@Column(name = "provider_type", length = 50, nullable = false)
@Enumerated(EnumType.STRING)
//@NotNull
private ProviderType providerType;
@Setter
@Schema(title = "프로필이미지URL", example = " ", description = "SNS로 로그인시 필수")
@Column(name = "profile_image_url", length = 256)
//@NotNull
//@Size(max = 256)
private String profileImageUrl;
@Builder.Default
@Setter
@Column(name = "email_verified_yn", length = 1, nullable = false)
//@NotNull
//@Size(min = 1, max = 1)
private String emailVerifiedYn = "N";
public CmmUser(
@ -170,14 +131,7 @@ public class CmmUser extends AuditEntity implements Serializable { //extends Rep
//
// }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
CmmUser cmmUser = (CmmUser) o;
return Objects.equals(cmmUserId, cmmUser.cmmUserId);
}
@Override
public int hashCode() {

@ -3,7 +3,6 @@ package com.xit.biz.cmm.entity.ids;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.persistence.Column;
import java.io.Serializable;
@Schema(name = "CmmCodeSIds", description = "소분류코드 PK(ClassIds) && 콤보코드 조회시 파라메터(searchKeyDto)로 사용")
@ -14,18 +13,14 @@ import java.io.Serializable;
public class CmmCodeSIds implements Serializable {
@Schema(required = true, title = "코드그룹ID", example = "G_CODE_SAM", description = "공통코드그룹ID")
@Column(name = "code_grp_id", nullable = false, length = 20)
private String codeGrpId;
@Schema(required = true, title = "대분류코드", example = "L0001", description = "대분류 코드값")
@Column(name = "code_lcd", nullable = false, length = 10)
private String codeLcd;
@Schema(required = true, title = "중분류코드", example = "M0001", description = "중분류 코드값")
@Column(name = "code_mcd", nullable = false, length = 10)
private String codeMcd;
@Schema(required = true, title = "공통코드 코드", example = "001", description = "공통코드의 코드값")
@Column(name = "code_cd", nullable = false, length = 10)
private String codeCd;
}

@ -73,7 +73,7 @@ public class AuthMinService implements IAuthMinService {
* @return TokenDto
*/
@Override
@Transactional
//@Transactional
public TokenDto login(final LoginMinRequestDto loginRequestDto,
HttpServletRequest request,
HttpServletResponse response,
@ -197,7 +197,7 @@ public class AuthMinService implements IAuthMinService {
* @return TokenDto
*/
@Override
@Transactional
//@Transactional
public TokenDto reissue(final TokenRequestDto tokenRequestDto, HttpServletRequest request, HttpServletResponse response) {
TokenDto tokenDto = new TokenDto();
String sAccessToken = null;
@ -291,28 +291,28 @@ public class AuthMinService implements IAuthMinService {
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public boolean validationToken(final String accessToken, final boolean isExceptionThrow) {
return jwtTokenProvider.validateTokenExcludeExpired(accessToken, false, isExceptionThrow);
}
// TODO :: 적용 필요
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Map<String, Object> findAccessTokenInfo(String accessToken) {
return jwtTokenProvider.getAccessTokenInfo(accessToken); //authTokenProvider.getAccessTokenInfo(accessToken);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Optional<CmmUser> findMyUserWithoutAuthorities() {
//cmmUserRepos
return Optional.empty(); //cmmUserRepository.findOneWithAuthorities(SecurityUtil.getCurrentMemberId());
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Optional<CmmUser> findUserWithAuthorities(final String userId) {
return Optional.empty(); //cmmUserRepository.findOneWithAuthorities(userId);
}

@ -4,7 +4,6 @@ import com.xit.core.oauth2.utils.HeaderUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.persistence.Transient;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@ -9,8 +9,6 @@ import lombok.*;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.crypto.password.PasswordEncoder;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
@ -29,7 +27,7 @@ public class LoginMinRequestDto {
* Enum type Validation -> controller
*/
@Schema(required = true, title = "Provider Type", example = "LOCAL", description = "Provider TYPE")
@Enumerated(EnumType.STRING)
//@Enumerated(EnumType.STRING)
@Enums(enumClass = ProviderType.class, ignoreCase = false, message = "{auth.user.pattern.ProviderType}")
private ProviderType providerType;

@ -9,8 +9,6 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
import javax.persistence.Column;
import javax.persistence.Transient;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@ -65,7 +63,6 @@ public class MinInfoBoard680Dto implements Serializable {
@Schema(required = false, title = "기타", example = " ", description = "Input Description...")
private String inEtc;
@Transient
@Schema(required = false, title = "파일", example = " ", description = "파일")
private MultipartFile[] files;

@ -3,7 +3,6 @@ package com.xit.biz.ctgy.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.persistence.*;
import java.time.LocalDate;
@Schema(name = "MinSimsaUser680ScDto", description = "거주자/장애인 심사사용자매핑")

@ -2,11 +2,8 @@ package com.xit.biz.ctgy.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.domain.Persistable;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@ -17,60 +14,44 @@ import java.util.Objects;
* Persistable : persitance getId isNew Override
*/
@Schema(name = "MinUserinfo", description = "null")
@Table(name = "min_userinfo", schema = "", catalog = "")
@Entity
@DynamicInsert
@DynamicUpdate
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Builder
public class MinUserinfo implements Persistable<String> {
@Id
@Schema(required = true, title = "민원심사사용자코드", example = " ", description = "Input Description...")
@Column(name = "userid", nullable = false, length = 20)
private String userid;
@Schema(required = true, title = "사용자암호", example = " ", description = "Input Description...")
@Column(name = "passwd", nullable = false, length = 48)
private String passwd;
@Schema(required = true, title = "사용자성명", example = " ", description = "Input Description...")
@Column(name = "name", nullable = false, length = 100)
private String name;
@Schema(required = false, title = "사용자주민번호", example = " ", description = "Input Description...")
@Column(name = "regnum", nullable = true, length = 20)
private String regnum;
@Schema(required = false, title = "전화번호", example = " ", description = "Input Description...")
@Column(name = "mphone", nullable = true, length = 20)
private String mphone;
@Schema(required = false, title = "이메일", example = " ", description = "Input Description...")
@Column(name = "email", nullable = true, length = 20)
private String email;
@Schema(required = true, title = "사용구분", example = " ", description = "Input Description...")
@Column(name = "accesstype", nullable = true, length = 3)
private String accesstype;
@Schema(required = true, title = "단속조", example = " ", description = "Input Description...")
@Column(name = "team", nullable = true, length = 3)
private String team;
@Schema(required = false, title = "등록일시", example = " ", description = "Input Description...")
@Column(name = "regdate", nullable = true)
private LocalDate regdate;
@Schema(required = false, title = "사용여부", example = " ", description = "Input Description...")
@Column(name = "isenable", nullable = true, length = 1)
@Setter
private String isenable;
@Schema(required = false, title = "구청코드", example = " ", description = "Input Description...")
@Column(name = "gu", nullable = true, length = 3)
private String gu;
@ -85,7 +66,6 @@ public class MinUserinfo implements Persistable<String> {
}
@PrePersist
public void onPrePersist(){
LocalDateTime localDateTime = LocalDateTime.now();
this.regdate = LocalDate.parse(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
@ -93,7 +73,6 @@ public class MinUserinfo implements Persistable<String> {
this.gu = "680";
}
@PreUpdate
public void onPreUpdate(){
// LocalDateTime localDateTime = LocalDateTime.now();
// this.inNalja = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));

@ -24,6 +24,7 @@ import javax.annotation.Nonnull;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URLEncoder;
@ -127,7 +128,11 @@ public class CmmFileController {
response.setContentType(contentType);
response.setHeader(HttpHeaders.CONTENT_TYPE, contentType);
response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(fileName, StandardCharsets.UTF_8) + "\";");
try {
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(fileName, "utf-8") + "\";");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
//response.setHeader(HttpHeaders.CONTENT_ENCODING, "binary");
response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(fileSize));
try {

@ -24,6 +24,7 @@ import javax.annotation.Nonnull;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@ -105,7 +106,11 @@ public class CtgyFileMgtController {
response.setContentType(contentType);
response.setHeader(HttpHeaders.CONTENT_TYPE, contentType);
response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(dto.getInFilename(), StandardCharsets.UTF_8) + "\";");
try {
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(dto.getInFilename(), "utf-8") + "\";");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
//response.setHeader(HttpHeaders.CONTENT_ENCODING, "binary");
response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(dto.getInFilesize()));
try {
@ -149,7 +154,7 @@ public class CtgyFileMgtController {
headers.add(HttpHeaders.CONTENT_TYPE, contentType);
headers.setContentDisposition(ContentDisposition.builder("attachment")
.filename(entity.getInFilename(), StandardCharsets.UTF_8)
//.filename(URLEncoder.encode(entity.getInFilename(), StandardCharsets.UTF_8))
//.filename(URLEncoder.encode(entity.getInFilename(), "utf-8"))
.build());
headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(entity.getInFilesize()));

@ -52,14 +52,14 @@ public class MinUserController {
@Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회")
@GetMapping("/info")
@Secured(policy = SecurityPolicy.TOKEN)
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public ResponseEntity<? extends IRestResponse> getMinUser() {
return RestResponse.of(service.findMinUser());
}
@Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회")
@GetMapping("/{userid}")
//@Transactional(readOnly = true)
////@Transactional(readOnly = true)
public ResponseEntity<? extends IRestResponse> getMinUser(@PathVariable final String userid) {
return RestResponse.of(service.findMinUserByUserid(userid));
}

@ -58,7 +58,7 @@ public class OAuth2MinController {
*/
@Operation(summary = "login" , description = "login")
@PostMapping("/login")
@Transactional
//@Transactional
public ResponseEntity<? extends IRestResponse> login(
@Valid
@RequestBody

@ -35,7 +35,7 @@ public class BoardService implements IBoardService {
}
@Override
@Transactional
//@Transactional
public void saveBoard(BoardDto dto) {
// update 인 경우
@ -61,7 +61,7 @@ public class BoardService implements IBoardService {
}
@Override
@Transactional
//@Transactional
public void removeBoard(final Long ciCode) {
BoardDto savedDto = boardDao.findById(ciCode).orElseThrow(() -> new CustomBaseException(ErrorCode.NOT_FOUND));

@ -85,7 +85,7 @@ public class CmmCodeService implements ICmmCodeService {
// }
//
// @Override
// @Transactional
// //@Transactional
// public CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp) {
// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeGrpId()), "코드 그룹을 입력해 주세요.");
// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeNm()), "코드 그룹명 입력해 주세요.");
@ -93,7 +93,7 @@ public class CmmCodeService implements ICmmCodeService {
// return cmmCodeGrpRepository.save(cmmCodeGrp);
// }
//
// @Transactional
// //@Transactional
// @Override
// public Object saveCmmCode(CmmCodeDto cmmCodeDto) {
// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "코드그룹을 입력해 주세요.");

@ -36,7 +36,7 @@ public class CmmFileService implements ICmmFileService {
* @return String makePath
*/
@Override
@Transactional
//@Transactional
public String uploadFiles(MultipartFile[] files, String rootPath, String uploadPath) {
String makePath = "";

@ -59,7 +59,7 @@ public class CtgyFileService implements ICtgyFileService {
* @return CmmFileMst
*/
@Override
@Transactional
//@Transactional
public List<MinInfoBoard680Dto> saveFiles(@Nonnull MinInfoBoard680Dto dto) {
List<MinInfoBoard680Dto> entityList = new ArrayList<>();
MultipartFile[] files = dto.getFiles();
@ -133,7 +133,7 @@ public class CtgyFileService implements ICtgyFileService {
}
@Override
@Transactional
//@Transactional
public void removePublicBoardFile(Long inCode) {
MinInfoBoard680Dto savedEntity = publicBoardDao.findByInCode(inCode);

@ -22,26 +22,26 @@ public class MinUserService implements IMinUserService {
private final PasswordEncoder passwordEncoder;
private final UserDao userDao;
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<MinUserinfoDto> findMinUsers(final MinUserinfoDto dto, Pageable pageable) {
pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize());
return userDao.findMinUserList(dto, pageable);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public MinUserinfoDto findMinUser() {
return userDao.findByUserid(HeaderUtil.getUserId()).orElse(null);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public MinUserinfoDto findMinUserByUserid(final String userid) {
return userDao.findByUserid(userid).orElse(null);
}
@Override
@Transactional
//@Transactional
public void saveMinUser(MinUserinfoDto dto) {
Optional<MinUserinfoDto> opUser = userDao.findByUserid(dto.getUserid());
dto.setPasswd(passwordEncoder.encode(dto.getPasswd()));
@ -57,7 +57,7 @@ public class MinUserService implements IMinUserService {
}
@Override
@Transactional
//@Transactional
public void removeMinUser(MinUserinfoDto dto) {
dto.setIsenable("0");
userDao.removeMinUserinfo(dto);

@ -32,7 +32,7 @@ public class ParkingService implements IParkingService {
private final UserDao userDao;
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<JudgeListDto> findParkings(final JudgeListDto dto, Pageable pageable) {
return parkingDao.findParkings(dto, pageable);
}
@ -87,13 +87,13 @@ public class ParkingService implements IParkingService {
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) {
return parkingDao.findParkingJudgeTargets(dto);
}
@Override
@Transactional
//@Transactional
public void saveParkingJudgeTargets(ParkingTargetDto dto) {
boolean isFirst = true;
@ -152,7 +152,7 @@ public class ParkingService implements IParkingService {
* @param dto ParkingTargetDto
*/
@Override
@Transactional
//@Transactional
public void removeParkingJudge(final ParkingTargetDto dto) {
List<Long> msMaincodes = parkingDao.findAllMsMaincode(dto);
@ -169,13 +169,13 @@ public class ParkingService implements IParkingService {
// 심사자
//---------------------------------------------------------------------------------
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public List<JudgeListDto> findByUserJudges() {
return parkingDao.findByUserJudges();
}
@Override
@Transactional
//@Transactional
public void saveJudgeResult(JudgeListDto dto){
parkingDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
dto.getMsuResult(),

@ -15,19 +15,19 @@ public class PublicBoardService implements IPublicBoardService {
private final PublicBoardDao publicBoardDao;
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<MinInfoBoard680Dto> findAll(final MinInfoBoard680Dto dto, Pageable pageable) {
return publicBoardDao.findAll(dto, pageable);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public MinInfoBoard680Dto findByInCode(final Long inCode) {
return publicBoardDao.findByInCode(inCode);
}
@Override
@Transactional
//@Transactional
public void modifyByInCode(Long inCode) {
publicBoardDao.updateInHitForMinInfoBoard680(inCode);
}

@ -57,20 +57,20 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
// 관리자
//---------------------------------------------------------------------------------
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable);
return residentAndDisabledDao.findJudgeDatas(scDatagb, pageable);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public GnRecallScDto findJudgeData(@NotNull final Long scCode) {
return residentAndDisabledDao.findJudgeData(scCode);
}
@Override
@Transactional
//@Transactional
public void saveJudgeData(GnRecallScDto dto) {
boolean isNew = Checks.isEmpty(dto.getScCode()) || dto.getScCode() == 0L;
@ -102,19 +102,19 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override
@Transactional
//@Transactional
public void removeJudgeData(@NotNull final Long scCode){
residentAndDisabledDao.deleteJudgeData(scCode);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public List<JudgeTargetDto> findJudgeTargets(JudgeTargetDto dto) {
return residentAndDisabledDao.findJudgeTargets(dto);
}
@Override
@Transactional
//@Transactional
public void saveJudgeTargets(JudgeTargetDto dto) {
boolean isFirst = true;
@ -165,7 +165,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable);
@ -173,7 +173,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Map<String,Object> findJudgeResults(JudgeListDto dto) {
Map<String, Object> resultMap = new HashMap<>();
@ -232,7 +232,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
* @param dto ParkingTargetDto
*/
@Override
@Transactional
//@Transactional
public void removeJudge(@NotNull final JudgeListDto dto) {
List<Long> msMaincodes = residentAndDisabledDao.findAllMsMaincode(dto);
@ -247,7 +247,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
}
@Override
@Transactional
//@Transactional
public void saveJudgeStds(final JudgeStdDto dto) {
int stdCnt = dto.getJudgeStdCnt();
@ -275,7 +275,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
});
}
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Map<String,Object> findDashboard(){
Map<String, Object> resultMap = new HashMap<>();
@ -312,13 +312,13 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
// 심사자
//---------------------------------------------------------------------------------
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public List<JudgeListDto> findByUserJudges(JudgeListDto dto) {
return residentAndDisabledDao.findByUserJudges(dto);
}
@Override
@Transactional
//@Transactional
public void saveJudgeResult(JudgeListDto dto){
residentAndDisabledDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
dto.getMsuResult(),

@ -37,7 +37,7 @@ public class AuthorizationAspect {
@Before("execution(public * com.xit..controller.*Controller.*(..)) ")
public void insertAdminLog(JoinPoint joinPoint) throws WeakKeyException, UnsupportedEncodingException, TokenAuthException {
SecretKey key = Keys.hmacShaKeyFor(secretKey.getBytes(StandardCharsets.UTF_8));
SecretKey key = Keys.hmacShaKeyFor(secretKey.getBytes("utf-8"));
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
String authorization = request.getHeader("Authorization");

@ -21,7 +21,7 @@ public class RequestLucyXssWrapper extends HttpServletRequestWrapper {
public RequestLucyXssWrapper(HttpServletRequest request) throws IOException {
super(request);
XssFilter filter = XssFilter.getInstance("lucy-xss-sax.xml");
b = new String(filter.doFilter(getBody(request))).getBytes(StandardCharsets.UTF_8);
b = new String(filter.doFilter(getBody(request))).getBytes("utf-8");
}
public ServletInputStream getInputStream() throws IOException {
@ -67,7 +67,7 @@ public class RequestLucyXssWrapper extends HttpServletRequestWrapper {
try {
InputStream inputStream = request.getInputStream();
if (inputStream != null) {
br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
br = new BufferedReader(new InputStreamReader(inputStream, "utf-8"));
char[] charBuffer = new char[128];
int bytesRead = -1;
while ((bytesRead = br.read(charBuffer)) > 0) {

@ -6,14 +6,11 @@ import com.xit.core.exception.CustomBaseException;
import com.xit.core.util.Checks;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.JDBCException;
import org.hibernate.exception.GenericJDBCException;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
@ -21,7 +18,6 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import javax.persistence.PersistenceException;
import javax.validation.ConstraintViolationException;
import java.util.HashMap;
import java.util.Map;
@ -197,10 +193,10 @@ public class CustomRestExceptionHandler extends ResponseEntityExceptionHandler {
log.error("handleException RuntimeException : {}", Checks.isEmpty(message) ? StringUtils.EMPTY : e.getClass().getCanonicalName());
// Hibernate SQL 예외인 경우 메세지 획득
if(e instanceof PersistenceException || e instanceof JDBCException || e instanceof JpaSystemException || e instanceof GenericJDBCException){
message = ((GenericJDBCException) e.getCause()).getSQLException().getLocalizedMessage();
// if(e instanceof PersistenceException || e instanceof JDBCException || e instanceof JpaSystemException || e instanceof GenericJDBCException){
// message = ((GenericJDBCException) e.getCause()).getSQLException().getLocalizedMessage();
}
// //message = ((GenericJDBCException) e.getCause()).getSQLException().getLocalizedMessage();
// }
return RestErrorResponse.of(HttpStatus.INTERNAL_SERVER_ERROR.toString(), message);
}

@ -9,8 +9,6 @@ import lombok.*;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.crypto.password.PasswordEncoder;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
@ -29,7 +27,7 @@ public class LoginRequestDto {
* Enum type Validation -> controller
*/
@Schema(required = true, title = "Provider Type", example = "LOCAL", description = "Provider TYPE")
@Enumerated(EnumType.STRING)
//@Enumerated(EnumType.STRING)
@Enums(enumClass = ProviderType.class, ignoreCase = false, message = "{auth.user.pattern.ProviderType}")
private ProviderType providerType;

@ -6,24 +6,17 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* (redis )
* RDB
*/
@Schema(name = "RefreshToken", description = "Refresh Token 테이블")
@Table(name = "refresh_token")
@Entity
@Getter
@Setter
@NoArgsConstructor
public class RefreshToken {
@Schema(required = true, title = "사용자ID", example = " ", description = "사용자 ID")
@Id
private String key;
@Schema(required = true, title = "refresh token", example = " ", description = "refresh token")

@ -1,16 +1,15 @@
package com.xit.core.support;
import org.springframework.jdbc.support.JdbcUtils;
import java.util.LinkedHashMap;
import java.util.Map;
@SuppressWarnings("rawtypes")
public class CamelCaseLinkedMap extends LinkedHashMap {
@Override
public Object put(Object key, Object value){
if(key != null && key.toString().contains("_")) return super.put(JdbcUtils.convertUnderscoreNameToPropertyName((String)key), value);
else return super.put(key, value);
//if(key != null && key.toString().contains("_")) return super.put(JdbcUtils.convertUnderscoreNameToPropertyName((String)key), value);
//else return super.put(key, value);
return super.put(key, value);
}
}

@ -1,6 +1,5 @@
package com.xit.core.support;
import org.springframework.jdbc.support.JdbcUtils;
import java.util.HashMap;
@ -9,7 +8,8 @@ public class CamelCaseMap<K, V> extends HashMap {
@Override
public Object put(Object key, Object value){
if(key != null && key.toString().contains("_")) return super.put(JdbcUtils.convertUnderscoreNameToPropertyName((String)key), value);
else return super.put(key, value);
//if(key != null && key.toString().contains("_")) return super.put(JdbcUtils.convertUnderscoreNameToPropertyName((String)key), value);
//else return super.put(key, value);
return super.put(key, value);
}
}

@ -10,61 +10,61 @@ import java.io.Serializable;
import java.util.List;
import java.util.Optional;
//@Transactional(value = "jpaTransactionManager")
////@Transactional(value = "jpaTransactionManager")
public abstract class AbstractJpaCrudService<T extends Serializable, ID> implements IJpaOperation<T, ID> {
protected abstract CrudRepository<T, ID> getRepository();
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public T findOne(final ID id) {
return getRepository().findById(id).orElse(null);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Optional<T> findById(final ID id) {
return getRepository().findById(id);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public List<T> findAll() {
return Lists.newArrayList(getRepository().findAll());
}
@Override
@Transactional
//@Transactional
public T save(final T entity) {
return getRepository().save(entity);
}
@Override
@Transactional
//@Transactional
public T update(final T entity) {
return getRepository().save(entity);
}
@Override
@Transactional
//@Transactional
public void delete(final T entity) {
getRepository().delete(entity);
}
@Override
@Transactional
//@Transactional
public void deleteById(final ID id) {
getRepository().deleteById(id);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<T> findAll(final Pageable pageable) {
return null;
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<T> findPaginated(final int page, final int size) {
return null;
}

@ -11,37 +11,37 @@ import java.io.Serializable;
import java.util.List;
import java.util.Optional;
//@Transactional(value = "jpaTransactionManager")
////@Transactional(value = "jpaTransactionManager")
public abstract class AbstractJpaService<T extends Serializable, ID> implements IJpaOperation<T, ID> {
protected abstract PagingAndSortingRepository<T, ID> getRepository();
// Paging
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<T> findAll(final Pageable pageable) {
return getRepository().findAll(pageable);
}
// Paging
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Page<T> findPaginated(final int page, final int size) {
return getRepository().findAll(PageRequest.of(page, size));
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public T findOne(final ID id) {
return getRepository().findById(id).orElse(null);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public Optional<T> findById(final ID id) {
return getRepository().findById(id);
}
@Override
@Transactional(readOnly = true)
//@Transactional(readOnly = true)
public List<T> findAll() {
return Lists.newArrayList(getRepository().findAll());
}
@ -50,25 +50,25 @@ public abstract class AbstractJpaService<T extends Serializable, ID> implements
// write
@Override
@Transactional
//@Transactional
public T save(final T entity) {
return getRepository().save(entity);
}
@Override
@Transactional
//@Transactional
public T update(final T entity) {
return getRepository().save(entity);
}
@Override
@Transactional
//@Transactional
public void delete(final T entity) {
getRepository().delete(entity);
}
@Override
@Transactional
//@Transactional
public void deleteById(final ID id) {
getRepository().deleteById(id);
}

@ -3,14 +3,11 @@ package com.xit.core.support.jpa;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@ -21,56 +18,39 @@ import java.time.format.DateTimeFormatter;
* @see com.xit.core.support.jpa.AuditorAwareConfig
*/
@Schema(name = "AuditEntity", description = "감사 필드 정의")
@EntityListeners(AuditingEntityListener.class)
@Getter
// JPA Entity 클래스들이 해당 클래스를 상속할 경우 정의한 필드 적용
@MappedSuperclass
public class AuditEntity implements Serializable {
private static final long serialVersionUID = 1146360965411496820L;
@Setter
@Schema(description = "생성시 생성자 자동 할당", example = " ")
@CreatedBy
@Column(name = "created_by", updatable = false, length = 64)
private String createdBy;
@Setter
@Schema(description = "변경시 변경자 자동 할당", example = " ")
@LastModifiedBy
@Column(name = "modified_by", length = 64, insertable = false)
private String modifiedBy;
@Setter
@Schema(description = "생성시 생성일시 자동 할당", example = " ")
@CreatedDate
//@JsonIgnore
//@Temporal(TemporalType.TIMESTAMP)
//@Column(name = "created_dtm", updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
@Column(name = "created_dtm", updatable = false)
private LocalDateTime createdDtm;
@Setter
@Schema(description = "변경시 변경일시 자동 할당", example = " ")
@LastModifiedDate
//@JsonIgnore
//@Temporal(TemporalType.TIMESTAMP)
//@Column(name = "modified_dtm", insertable = false, columnDefinition = "TIMESTAMP DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP")
@Column(name = "modified_dtm", insertable = false)
private LocalDateTime modifiedDtm;
@Schema(example = "Y", required = true)
@Column(name = "use_yn", nullable = false, length = 1)
//@Column(name = "use_yn", nullable = false, length = 1)
@ColumnDefault(value = "'Y'")
private String useYn = "Y";
@PrePersist
public void onPrePersist(){
this.createdBy = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
this.modifiedBy = this.createdBy;
}
@PreUpdate
public void onPreUpdate(){
this.modifiedBy = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
}

@ -1,18 +0,0 @@
package com.xit.core.support.jpa;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;
import java.io.Serializable;
/**
* Repository
* NoRepositoryBean annotaion
*
* @author Lim, Jong Uk (minuk926)
* @since 2021-07-22
*/
@NoRepositoryBean
public interface ISimpleRepository<T, ID extends Serializable> extends JpaRepository<T, ID> { //Repository<T, ID> {
boolean contains(T entity);
}

@ -4,7 +4,6 @@ import com.xit.core.util.Checks;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.Objects;
@ -25,26 +24,4 @@ public class JpaUtil {
// if(Checks.isEmpty(sort)) return PageRequest.of(limit*(page-1), limit);
// else return PageRequest.of(limit*(page-1), limit, Objects.requireNonNull(sort));
}
/**
*
* @param id Long
* @param repository JpaRepository
* @param entity Object
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public static void saveIfNullId(Long id, JpaRepository repository, Object entity) {
if(id == null) repository.save(entity);
}
/**
*
* @param id Long
* @param repository JpaRepository
* @param entity Object
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public static void saveIfNullId(String id, JpaRepository repository, Object entity) {
if(id == null) repository.save(entity);
}
}

@ -1,36 +0,0 @@
package com.xit.core.support.jpa;
import org.springframework.data.jpa.repository.support.JpaEntityInformation;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;
import javax.persistence.EntityManager;
import java.io.Serializable;
/**
*
* @EnableJpaRepositories repositoryBaseClass
* Repository ISimpleRepository
*
* querydsl
* ( SimpleJpaRepository QuerydslJpaRepository
* deprecated )
*
* @param <T>
* @param <ID>
*/
//public class SimpleBaseRepository<T, ID extends Serializable> extends QuerydslJpaRepository<T, ID> implements ISimpleRepository<T, ID>{
public class SimpleBaseRepository<T, ID extends Serializable> extends SimpleJpaRepository<T, ID> implements ISimpleRepository<T, ID>{
private final EntityManager em;
public SimpleBaseRepository(JpaEntityInformation<T, ?> entityInformation, EntityManager em) {
super(entityInformation, em);
this.em = em;
}
@Override
public boolean contains(T entity) {
return em.contains(entity);
}
}

@ -207,16 +207,16 @@ public class AwsFileUtil {
if (userAgent.contains("MSIE 5.5")) {
// MS IE 5.5 이하
return URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "\\ ");
return URLEncoder.encode(fileName, "utf-8").replaceAll("\\+", "\\ ");
} else if (userAgent.contains("MSIE")) {
// MS IE (&#xBCF4;&#xD1B5;&#xC740; 6.x &#xC774;&#xC0C1; &#xAC00;&#xC815;)
return URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "\\ ");
return URLEncoder.encode(fileName, "utf-8").replaceAll("\\+", "\\ ");
} else if (userAgent.contains("Trident")) {
// MS IE 11
return URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "\\ ");
return URLEncoder.encode(fileName, "utf-8").replaceAll("\\+", "\\ ");
} else {
// 모질라나 오페라
return new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
return new String(fileName.getBytes("utf-8"), StandardCharsets.ISO_8859_1);
}
}

@ -585,7 +585,7 @@ public class CommUtil {
String encodedFilename = "";
try {
String encodedFilename1 = "\"" + new String(filename.getBytes(StandardCharsets.UTF_8), "8859_1") + "\"";
String encodedFilename1 = "\"" + new String(filename.getBytes("utf-8"), "8859_1") + "\"";
switch (browser) {
case "Firefox":
@ -597,7 +597,7 @@ public class CommUtil {
for (int i = 0; i < filename.length(); i++) {
char c = filename.charAt(i);
if (c > '~') {
sb.append(URLEncoder.encode("" + c, StandardCharsets.UTF_8));
sb.append(URLEncoder.encode("" + c, "utf-8"));
} else {
sb.append(c);
}
@ -605,7 +605,7 @@ public class CommUtil {
encodedFilename = sb.toString();
break;
default:
encodedFilename = URLEncoder.encode(filename, StandardCharsets.UTF_8).replaceAll("\\+", "%20"); // MSIE 외 모든 브라우저
encodedFilename = URLEncoder.encode(filename, "utf-8").replaceAll("\\+", "%20"); // MSIE 외 모든 브라우저
break;
}

@ -49,9 +49,9 @@ public class ConvertUtils {
return java.util.Date.from(instant);
}
public static LocalDate toLocalDateFromDate(java.util.Date date){
return LocalDate.ofInstant(date.toInstant(), ZoneId.systemDefault());
}
// public static LocalDate toLocalDateFromDate(java.util.Date date){
// return LocalDate.ofInstant(date.toInstant(), ZoneId.systemDefault());
// }
public static LocalDateTime toLocalDateTimeFromDate(java.util.Date date){
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());

@ -32,10 +32,10 @@ public class DateUtil {
//return java.sql.Timestamp.valueOf(localDateTime);
}
public static LocalDate toLocalDateFromDate(Date date){
return LocalDate.ofInstant(date.toInstant(), ZoneId.systemDefault());
//return new java.sql.Date(date.getTime()).toLocalDate();
}
// public static LocalDate toLocalDateFromDate(Date date){
// return LocalDate.ofInstant(date.toInstant(), ZoneId.systemDefault());
// //return new java.sql.Date(date.getTime()).toLocalDate();
// }
public static LocalDateTime toLocalDateTimeFromDate(Date date){
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());

@ -51,10 +51,10 @@ public class PoiExcelView extends AbstractXlsxView {
encodedFilename = filename;
}else if (Objects.equals("MSIE", browser) || Objects.equals("Trident", browser)) {// IE11 문자열 깨짐 방지
encodedFilename = URLEncoder.encode(filename, StandardCharsets.UTF_8).replaceAll("\\+", "%20");
encodedFilename = URLEncoder.encode(filename, "utf-8").replaceAll("\\+", "%20");
} else {
String encodedFilename1 = "\"" + new String(filename.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\"";
String encodedFilename1 = "\"" + new String(filename.getBytes("utf-8"), StandardCharsets.ISO_8859_1) + "\"";
if (Objects.equals("Firefox", browser)) {
encodedFilename = encodedFilename1;
@ -66,7 +66,7 @@ public class PoiExcelView extends AbstractXlsxView {
for (int i = 0; i < filename.length(); i++) {
char c = filename.charAt(i);
if (c > '~') {
sb.append(URLEncoder.encode("" + c, StandardCharsets.UTF_8));
sb.append(URLEncoder.encode("" + c, "utf-8"));
} else {
sb.append(c);
}

Loading…
Cancel
Save