feat: myinfo
This commit is contained in:
@@ -23,6 +23,7 @@ import org.mindrot.jbcrypt.BCrypt;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -173,4 +174,18 @@ public class MembersCoreService {
|
||||
public boolean existsByEmployeeNo(String employeeNo) {
|
||||
return membersRepository.existsByEmployeeNo(employeeNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원정보 조회 (단건 ) by uuid
|
||||
*
|
||||
* @param uuid
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public MembersDto.EntityData getUserInfoByUuid(String memberUuid) {
|
||||
MemberEntity member =
|
||||
membersRepository
|
||||
.findByUUID(UUID.fromString(memberUuid))
|
||||
.orElseThrow(MemberNotFoundException::new);
|
||||
return member.toEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.enums.RoleType;
|
||||
import com.kamco.cd.kamcoback.common.enums.StatusType;
|
||||
import com.kamco.cd.kamcoback.members.dto.MembersDto.EntityData;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
@@ -14,8 +16,10 @@ import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Slf4j
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@@ -100,4 +104,19 @@ public class MemberEntity {
|
||||
this.status = newStatus;
|
||||
this.statusChgDttm = ZonedDateTime.now();
|
||||
}
|
||||
|
||||
public EntityData toEntity() {
|
||||
return new EntityData(
|
||||
id,
|
||||
uuid,
|
||||
RoleType.valueOf(userRole),
|
||||
name,
|
||||
employeeNo,
|
||||
StatusType.valueOf(status),
|
||||
createdDttm,
|
||||
firstLoginDttm,
|
||||
lastLoginDttm,
|
||||
statusChgDttm,
|
||||
pwdResetYn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user