수정
This commit is contained in:
parent
ea9870be56
commit
dac68fc3eb
@ -22,7 +22,7 @@ import io.company.localhost.common.annotation.ParameterCheck;
|
||||
import io.company.localhost.common.annotation.ReqMap;
|
||||
import io.company.localhost.common.dto.ApiResponse;
|
||||
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.utils.AuthUtil;
|
||||
import io.company.localhost.utils.SessionListener;
|
||||
@ -60,7 +60,7 @@ import static org.springframework.security.web.authentication.rememberme.Abstrac
|
||||
public class UserController {
|
||||
|
||||
private final commoncodService commoncodservice;
|
||||
private final RegisterService registerService;
|
||||
private final netmemberService netmemberservice;
|
||||
|
||||
/**
|
||||
* 사용 가능 색상 조회
|
||||
@ -97,8 +97,8 @@ public class UserController {
|
||||
* @throws RuntimeException 파일 업로드 실패 시
|
||||
*/
|
||||
@PostMapping("/join")
|
||||
public ApiResponse<Integer> register(@RequestParam("memberPrf") MultipartFile memberPrf, @ReqMap MapDto map) {
|
||||
int member = registerService.register(memberPrf, map);
|
||||
public ApiResponse<Integer> register(@RequestParam("profile") MultipartFile profile, @ReqMap MapDto map) {
|
||||
int member = netmemberservice.register(profile, map);
|
||||
return ApiResponse.ok(member);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ public class UserController {
|
||||
*/
|
||||
@GetMapping("/checkId")
|
||||
public ApiResponse<Boolean> selectCheckId(@RequestParam String memberIds) {
|
||||
boolean isDuplicate = registerService.selectCheckId(memberIds);
|
||||
boolean isDuplicate = netmemberservice.selectCheckId(memberIds);
|
||||
return ApiResponse.ok(!isDuplicate);
|
||||
}
|
||||
|
||||
@ -198,6 +198,19 @@ public class UserController {
|
||||
|
||||
return ApiResponse.ok(returnMessage);
|
||||
}
|
||||
/**
|
||||
* 사원 목록 전체 조회
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ParameterCheck
|
||||
@GetMapping("/allUserList")
|
||||
public ApiResponse<List<MapDto>> getallUserList() {
|
||||
List<MapDto> allUserList = netmemberservice.getallUserList();
|
||||
return ApiResponse.ok(allUserList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Guest
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
*************************************************************/
|
||||
package io.company.localhost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import io.company.localhost.common.dto.MapDto;
|
||||
@ -27,4 +29,6 @@ public interface NetmemberMapper {
|
||||
int insertMember(MapDto map);
|
||||
|
||||
int selectCheckId(String memberIds);
|
||||
|
||||
List<MapDto> getallUserList();
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
package io.company.localhost.service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.crypto.password.DelegatingPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -27,7 +28,7 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RegisterService {
|
||||
public class netmemberService {
|
||||
private final NetmemberMapper memberMapper;
|
||||
private final commoncodMapper commoncodMapper;
|
||||
private final DelegatingPasswordEncoder passwordEncoder;
|
||||
@ -40,9 +41,9 @@ public class RegisterService {
|
||||
* @param map
|
||||
* @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);
|
||||
|
||||
// 비밀번호 암호화 및 저장
|
||||
@ -53,7 +54,7 @@ public class RegisterService {
|
||||
map.put("memberRol", "ROLE_MEMBER");
|
||||
map.put("memberPos", 500107);
|
||||
map.put("memberTkn", "Null");
|
||||
map.put("memberPrm", "Y");
|
||||
map.put("memberPrm", "N");
|
||||
map.put("memberDel", "N");
|
||||
map.put("memberLea", "N");
|
||||
map.put("memberRdt", LocalDateTime.now());
|
||||
@ -78,5 +79,14 @@ public class RegisterService {
|
||||
public boolean selectCheckId(String memberIds) {
|
||||
return memberMapper.selectCheckId(memberIds) > 0;
|
||||
}
|
||||
/**
|
||||
* 사원 목록 전체 조회
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public List<MapDto> getallUserList() {
|
||||
return memberMapper.getallUserList();
|
||||
}
|
||||
|
||||
}
|
||||
@ -43,9 +43,7 @@
|
||||
MEMBERPWR,
|
||||
MEMBERPOS,
|
||||
MEMBERARR,
|
||||
MEMBERDTL,
|
||||
MEMBERZIP,
|
||||
MEMBERBTH,
|
||||
MEMBERTEL,
|
||||
MEMBERRDT,
|
||||
MEMBERCDT,
|
||||
@ -65,9 +63,7 @@
|
||||
#{memberPwr},
|
||||
#{memberPos},
|
||||
#{memberArr},
|
||||
#{memberDtl},
|
||||
#{memberZip},
|
||||
#{memberBth},
|
||||
#{memberTel},
|
||||
#{memberRdt},
|
||||
#{memberCdt},
|
||||
@ -85,5 +81,17 @@
|
||||
FROM netmember
|
||||
WHERE MEMBERIDS = #{memberIds}
|
||||
</select>
|
||||
<select id="getallUserList" resultType="Map">
|
||||
SELECT *
|
||||
FROM
|
||||
netmember
|
||||
WHERE
|
||||
MEMBERDEL = "N"
|
||||
AND
|
||||
MEMBERPRM = "Y"
|
||||
AND
|
||||
MEMBERLEA ="N"
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user