|
|
@ -44,6 +44,10 @@ public class BasGroupController { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private final BasGroupService service; |
|
|
|
private final BasGroupService service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 그룹코드 생성 |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
@GetMapping(value = "/createid") |
|
|
|
@GetMapping(value = "/createid") |
|
|
|
@ApiOperation(value = "그룹코드 생성") |
|
|
|
@ApiOperation(value = "그룹코드 생성") |
|
|
|
@Tag(name = "그룹 컨트롤러", description = "그룹 관련 API") |
|
|
|
@Tag(name = "그룹 컨트롤러", description = "그룹 관련 API") |
|
|
@ -51,11 +55,18 @@ public class BasGroupController { |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
String result = service.createid(); |
|
|
|
String result = service.createid(); // 그룹코드를 생성하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
resultMap.put("result", result); |
|
|
|
resultMap.put("result", result); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
@ -66,7 +77,8 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 나의 그룹 목록 조회 |
|
|
|
* 내가 만든 그룹 목록조회하는 기능. |
|
|
|
|
|
|
|
* 고객고유번호[cstmrSno]로 내가 만든 그룹을 조회함. |
|
|
|
* @param rq |
|
|
|
* @param rq |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -77,19 +89,27 @@ public class BasGroupController { |
|
|
|
public ResponseEntity<? extends BasicResponse> mylist(Integer cstmrSno) { |
|
|
|
public ResponseEntity<? extends BasicResponse> mylist(Integer cstmrSno) { |
|
|
|
List<BasGroupModel> result = null; |
|
|
|
List<BasGroupModel> result = null; |
|
|
|
|
|
|
|
|
|
|
|
log.debug("Param : " + cstmrSno); |
|
|
|
log.debug("Param : {}", cstmrSno); |
|
|
|
|
|
|
|
|
|
|
|
//입력값 검증
|
|
|
|
// 고객고유번호[cstmrSno]값 입력값 검증처리
|
|
|
|
if(StringUtils.isEmpty(cstmrSno)) { |
|
|
|
if(StringUtils.isEmpty(cstmrSno)) { |
|
|
|
return ResponseEntity.status(HttpStatus.OK) |
|
|
|
// 검증통과하지 못할 시 서버에서 "의도적인" 에러 반환
|
|
|
|
|
|
|
|
return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드
|
|
|
|
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); |
|
|
|
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
result = service.mylist(cstmrSno); |
|
|
|
result = service.mylist(cstmrSno); // 나의 그룹 목록조회하는 기능.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
@ -100,7 +120,8 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 나의 그룹 - 참여 그룹 목록 조회 |
|
|
|
* 나의 그룹 - 참여 그룹 목록 조회하는 기능, |
|
|
|
|
|
|
|
* 고객고유번호[cstmrSno]로 나의 그룹을 조회함. |
|
|
|
* @param rq |
|
|
|
* @param rq |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -112,17 +133,25 @@ public class BasGroupController { |
|
|
|
List<BasGroupJoinModel> result = null; |
|
|
|
List<BasGroupJoinModel> result = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//입력값 검증
|
|
|
|
// 고객고유번호[cstmrSno]값 입력값 검증처리
|
|
|
|
if(StringUtils.isEmpty(cstmrSno)) { |
|
|
|
if(StringUtils.isEmpty(cstmrSno)) { |
|
|
|
return ResponseEntity.status(HttpStatus.OK) |
|
|
|
// 검증통과하지 못할 시 서버에서 "의도적인" 에러 반환
|
|
|
|
|
|
|
|
return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드
|
|
|
|
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); |
|
|
|
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
result = service.joinList(cstmrSno); |
|
|
|
result = service.joinList(cstmrSno); // 나의 그룹 - 참여 그룹 목록을 조회하는 기능.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
@ -133,7 +162,7 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 그룹 목록 조회 |
|
|
|
* 그룹 목록 조회하는 기능 |
|
|
|
* @param rq |
|
|
|
* @param rq |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -145,17 +174,25 @@ public class BasGroupController { |
|
|
|
List<BasGroupJoinModel> result = null; |
|
|
|
List<BasGroupJoinModel> result = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//입력값 검증
|
|
|
|
// 고객고유번호[cstmrSno]값 입력값 검증처리
|
|
|
|
if(StringUtils.isEmpty(cstmrSno)) { |
|
|
|
if(StringUtils.isEmpty(cstmrSno)) { |
|
|
|
return ResponseEntity.status(HttpStatus.OK) |
|
|
|
// 검증통과하지 못할 시 서버에서 "의도적인" 에러 반환
|
|
|
|
|
|
|
|
return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드
|
|
|
|
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); |
|
|
|
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
result = service.groupList(cstmrSno); |
|
|
|
result = service.groupList(cstmrSno); // 그룹 목록조회하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
@ -166,7 +203,8 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 전체 그룹 목록 조회 |
|
|
|
* 전체 그룹 목록 조회하는 기능, |
|
|
|
|
|
|
|
* BasGroupRqModel 모델 값에 따라 조회하는 기능. |
|
|
|
* @param rq |
|
|
|
* @param rq |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -177,10 +215,17 @@ public class BasGroupController { |
|
|
|
List<BasGroupModel> result = null; |
|
|
|
List<BasGroupModel> result = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
result = service.list(rq); |
|
|
|
result = service.list(rq); // 전체 그룹 목록하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
@ -191,7 +236,8 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 그룹 상세 조회 |
|
|
|
* 그룹 상세 조회하는 기능, |
|
|
|
|
|
|
|
* 그룹아이디[groupId]로 조회함. |
|
|
|
* @param id |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -203,9 +249,16 @@ public class BasGroupController { |
|
|
|
BasGroupModel result = null; |
|
|
|
BasGroupModel result = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
result = service.detail(id); |
|
|
|
result = service.detail(id); // 그룹아이디[groupId]로 상세 조회하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
@ -217,7 +270,8 @@ public class BasGroupController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 그룹 생성 |
|
|
|
* 그룹 생성하는 기능, |
|
|
|
|
|
|
|
* BasGroupModel 모델에 입력받은 값으로 그룹 생성. |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -228,11 +282,19 @@ public class BasGroupController { |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
boolean result = service.create(rq); |
|
|
|
boolean result = service.create(rq); // 그룹 생성하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
resultMap.put("result", result); |
|
|
|
resultMap.put("result", result); |
|
|
|
|
|
|
|
|
|
|
|
} catch (CustomException e) { |
|
|
|
} catch (CustomException e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* CustomException은 개발자가 "의도적으로" 낸 예외처리, |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
resultMap.put("result", false); |
|
|
|
resultMap.put("result", false); |
|
|
|
resultMap.put("errorCode", e.getErrorCode()); |
|
|
|
resultMap.put("errorCode", e.getErrorCode()); |
|
|
@ -244,7 +306,8 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 그룹 수정 |
|
|
|
* 그룹 수정하는 기능, |
|
|
|
|
|
|
|
* BasGroupModel 모델에 입력받은 값으로 그룹 수정. |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -255,7 +318,7 @@ public class BasGroupController { |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
boolean result = service.update(rq); |
|
|
|
boolean result = service.update(rq); // 그룹 수정하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
resultMap.put("result", result); |
|
|
|
resultMap.put("result", result); |
|
|
|
|
|
|
|
|
|
|
@ -266,6 +329,14 @@ public class BasGroupController { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} catch (CustomException e) { |
|
|
|
} catch (CustomException e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* CustomException은 개발자가 "의도적으로" 낸 예외처리, |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
resultMap.put("result", false); |
|
|
|
resultMap.put("result", false); |
|
|
|
resultMap.put("errorCode", e.getErrorCode()); |
|
|
|
resultMap.put("errorCode", e.getErrorCode()); |
|
|
@ -277,7 +348,8 @@ public class BasGroupController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 그룹 삭제 |
|
|
|
* 그룹 삭제하는 기능, |
|
|
|
|
|
|
|
* 그룹아이디[groupId]로 삭제함. |
|
|
|
* @param id |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -289,11 +361,18 @@ public class BasGroupController { |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
Map<String , Object> resultMap = new HashMap<String,Object>(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
boolean result = service.delete(id); |
|
|
|
boolean result = service.delete(id); // 그룹아이디[groupId]로 삭제하는 기능
|
|
|
|
|
|
|
|
|
|
|
|
resultMap.put("result", result); |
|
|
|
resultMap.put("result", result); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* try{ |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
* try 영역 안 코드들중 문제가 생기면 오는 곳. |
|
|
|
|
|
|
|
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 |
|
|
|
|
|
|
|
*/ |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
log.error("IGNORE : {}", e); |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|
.body(new ErrorResponse("Server Error", "-1")); |
|
|
|