This commit is contained in:
khj0414 2025-01-24 10:29:41 +09:00
parent ea9870be56
commit dac68fc3eb
4 changed files with 48 additions and 13 deletions

View File

@ -22,7 +22,7 @@ import io.company.localhost.common.annotation.ParameterCheck;
import io.company.localhost.common.annotation.ReqMap; import io.company.localhost.common.annotation.ReqMap;
import io.company.localhost.common.dto.ApiResponse; import io.company.localhost.common.dto.ApiResponse;
import io.company.localhost.common.dto.MapDto; import io.company.localhost.common.dto.MapDto;
import io.company.localhost.service.RegisterService; import io.company.localhost.service.netmemberService;
import io.company.localhost.service.commoncodService; import io.company.localhost.service.commoncodService;
import io.company.localhost.utils.AuthUtil; import io.company.localhost.utils.AuthUtil;
import io.company.localhost.utils.SessionListener; import io.company.localhost.utils.SessionListener;
@ -60,7 +60,7 @@ import static org.springframework.security.web.authentication.rememberme.Abstrac
public class UserController { public class UserController {
private final commoncodService commoncodservice; private final commoncodService commoncodservice;
private final RegisterService registerService; private final netmemberService netmemberservice;
/** /**
* 사용 가능 색상 조회 * 사용 가능 색상 조회
@ -97,8 +97,8 @@ public class UserController {
* @throws RuntimeException 파일 업로드 실패 * @throws RuntimeException 파일 업로드 실패
*/ */
@PostMapping("/join") @PostMapping("/join")
public ApiResponse<Integer> register(@RequestParam("memberPrf") MultipartFile memberPrf, @ReqMap MapDto map) { public ApiResponse<Integer> register(@RequestParam("profile") MultipartFile profile, @ReqMap MapDto map) {
int member = registerService.register(memberPrf, map); int member = netmemberservice.register(profile, map);
return ApiResponse.ok(member); return ApiResponse.ok(member);
} }
@ -111,7 +111,7 @@ public class UserController {
*/ */
@GetMapping("/checkId") @GetMapping("/checkId")
public ApiResponse<Boolean> selectCheckId(@RequestParam String memberIds) { public ApiResponse<Boolean> selectCheckId(@RequestParam String memberIds) {
boolean isDuplicate = registerService.selectCheckId(memberIds); boolean isDuplicate = netmemberservice.selectCheckId(memberIds);
return ApiResponse.ok(!isDuplicate); return ApiResponse.ok(!isDuplicate);
} }
@ -198,6 +198,19 @@ public class UserController {
return ApiResponse.ok(returnMessage); return ApiResponse.ok(returnMessage);
} }
/**
* 사원 목록 전체 조회
*
*
*
*/
@ParameterCheck
@GetMapping("/allUserList")
public ApiResponse<List<MapDto>> getallUserList() {
List<MapDto> allUserList = netmemberservice.getallUserList();
return ApiResponse.ok(allUserList);
}
@Guest @Guest

View File

@ -14,6 +14,8 @@
*************************************************************/ *************************************************************/
package io.company.localhost.mapper; package io.company.localhost.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import io.company.localhost.common.dto.MapDto; import io.company.localhost.common.dto.MapDto;
@ -27,4 +29,6 @@ public interface NetmemberMapper {
int insertMember(MapDto map); int insertMember(MapDto map);
int selectCheckId(String memberIds); int selectCheckId(String memberIds);
List<MapDto> getallUserList();
} }

View File

@ -15,6 +15,7 @@
package io.company.localhost.service; package io.company.localhost.service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import org.springframework.security.crypto.password.DelegatingPasswordEncoder; import org.springframework.security.crypto.password.DelegatingPasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,7 +28,7 @@ import lombok.RequiredArgsConstructor;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class RegisterService { public class netmemberService {
private final NetmemberMapper memberMapper; private final NetmemberMapper memberMapper;
private final commoncodMapper commoncodMapper; private final commoncodMapper commoncodMapper;
private final DelegatingPasswordEncoder passwordEncoder; private final DelegatingPasswordEncoder passwordEncoder;
@ -40,9 +41,9 @@ public class RegisterService {
* @param map * @param map
* @return * @return
*/ */
public int register(MultipartFile memberPrf, MapDto map) { public int register(MultipartFile profile, MapDto map) {
// 프로필 이미지 저장, 저장된 경로 가져옴 // 프로필 이미지 저장, 저장된 경로 가져옴
String profilePath = fileService.uploadFile(memberPrf, "profiles"); String profilePath = fileService.uploadFile(profile, "profiles");
map.put("memberPrf", profilePath); map.put("memberPrf", profilePath);
// 비밀번호 암호화 저장 // 비밀번호 암호화 저장
@ -53,7 +54,7 @@ public class RegisterService {
map.put("memberRol", "ROLE_MEMBER"); map.put("memberRol", "ROLE_MEMBER");
map.put("memberPos", 500107); map.put("memberPos", 500107);
map.put("memberTkn", "Null"); map.put("memberTkn", "Null");
map.put("memberPrm", "Y"); map.put("memberPrm", "N");
map.put("memberDel", "N"); map.put("memberDel", "N");
map.put("memberLea", "N"); map.put("memberLea", "N");
map.put("memberRdt", LocalDateTime.now()); map.put("memberRdt", LocalDateTime.now());
@ -78,5 +79,14 @@ public class RegisterService {
public boolean selectCheckId(String memberIds) { public boolean selectCheckId(String memberIds) {
return memberMapper.selectCheckId(memberIds) > 0; return memberMapper.selectCheckId(memberIds) > 0;
} }
/**
* 사원 목록 전체 조회
*
* @param
* @return
*/
public List<MapDto> getallUserList() {
return memberMapper.getallUserList();
}
} }

View File

@ -43,9 +43,7 @@
MEMBERPWR, MEMBERPWR,
MEMBERPOS, MEMBERPOS,
MEMBERARR, MEMBERARR,
MEMBERDTL,
MEMBERZIP, MEMBERZIP,
MEMBERBTH,
MEMBERTEL, MEMBERTEL,
MEMBERRDT, MEMBERRDT,
MEMBERCDT, MEMBERCDT,
@ -65,9 +63,7 @@
#{memberPwr}, #{memberPwr},
#{memberPos}, #{memberPos},
#{memberArr}, #{memberArr},
#{memberDtl},
#{memberZip}, #{memberZip},
#{memberBth},
#{memberTel}, #{memberTel},
#{memberRdt}, #{memberRdt},
#{memberCdt}, #{memberCdt},
@ -85,5 +81,17 @@
FROM netmember FROM netmember
WHERE MEMBERIDS = #{memberIds} WHERE MEMBERIDS = #{memberIds}
</select> </select>
<select id="getallUserList" resultType="Map">
SELECT *
FROM
netmember
WHERE
MEMBERDEL = "N"
AND
MEMBERPRM = "Y"
AND
MEMBERLEA ="N"
</select>
</mapper> </mapper>