Browse Source

로그확인용임시 커밋

pull/18/head
lkd9125(이경도) 9 months ago
parent
commit
95cac94b68
  1. 8
      pav-server/src/main/java/com/palnet/biz/api/ctr/cntrl/controller/CtrCntrlController.java
  2. 18
      pav-server/src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java

8
pav-server/src/main/java/com/palnet/biz/api/ctr/cntrl/controller/CtrCntrlController.java

@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException; import org.json.simple.parser.ParseException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -29,6 +30,9 @@ import java.util.Map;
@Tag(name = "드론 관제 시스템", description = "드론 관제 관련 API") @Tag(name = "드론 관제 시스템", description = "드론 관제 관련 API")
public class CtrCntrlController { public class CtrCntrlController {
@Value("${spring.profiles.active}")
private String activeProfile;
private final CtrCntrlService service; private final CtrCntrlService service;
public CtrCntrlController(CtrCntrlService service) { public CtrCntrlController(CtrCntrlService service) {
@ -171,6 +175,8 @@ public class CtrCntrlController {
public ResponseEntity<? extends BasicResponse> findGroupAuthInfo(int cstmrSno) { public ResponseEntity<? extends BasicResponse> findGroupAuthInfo(int cstmrSno) {
List<CtrCntrlGroupArcrftModel> list; List<CtrCntrlGroupArcrftModel> list;
log.info("====================================================================================");
log.info("activeProfile => {}", activeProfile);
try { try {
list = service.getGroupAuthInfo(); // 그룹의 기체 정보 조회하는 기능 list = service.getGroupAuthInfo(); // 그룹의 기체 정보 조회하는 기능
} catch (Exception e) { } catch (Exception e) {
@ -186,6 +192,8 @@ public class CtrCntrlController {
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
} }
log.info("====================================================================================");
return ResponseEntity.ok().body(new SuccessResponse<List>(list)); return ResponseEntity.ok().body(new SuccessResponse<List>(list));
} }

18
pav-server/src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java

@ -2030,6 +2030,10 @@ public class CtrCntrlQueryRepository{
Integer cstmrSno = jwtTokenUtil.getCstmrSnoByToken(); Integer cstmrSno = jwtTokenUtil.getCstmrSnoByToken();
List<JwtGroupModel> groupAuth = jwtTokenUtil.getGroupAuthByToken(); List<JwtGroupModel> groupAuth = jwtTokenUtil.getGroupAuthByToken();
log.info("User CstmrSno => {}", cstmrSno);
log.info("User Auth => {}", authId);
log.info("User GroupAuth => {}", groupAuth);
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
builder.and(pgb.useYn.eq("Y")); builder.and(pgb.useYn.eq("Y"));
if("ADMIN".equals(authId) || "SUPER".equals(authId)) { if("ADMIN".equals(authId) || "SUPER".equals(authId)) {
@ -2067,6 +2071,11 @@ public class CtrCntrlQueryRepository{
.where(builder) .where(builder)
.fetch(); .fetch();
log.info("Control Query Result=> {}", model);
log.info("====================================================================================");
for(CtrCntrlGroupModel list : model) { for(CtrCntrlGroupModel list : model) {
if(groupAuth != null) { if(groupAuth != null) {
@ -2115,8 +2124,14 @@ public class CtrCntrlQueryRepository{
int cstmrSno = jwtTokenUtil.getCstmrSnoByToken(); int cstmrSno = jwtTokenUtil.getCstmrSnoByToken();
String groupAuth = null; String groupAuth = null;
List<JwtGroupModel> groupAuthList = jwtTokenUtil.getGroupAuthByToken(); List<JwtGroupModel> groupAuthList = jwtTokenUtil.getGroupAuthByToken();
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
builder.and(arcrftBas.groupId.eq(groupId)); builder.and(arcrftBas.groupId.eq(groupId));
log.info("groupId => {}", groupId);
log.info("User CstmrSno => {}", cstmrSno);
log.info("User Auth => {}", appAuth);
if("USER".equals(appAuth) || "ROLE_USER".equals(appAuth)) { if("USER".equals(appAuth) || "ROLE_USER".equals(appAuth)) {
for(JwtGroupModel list : groupAuthList) { for(JwtGroupModel list : groupAuthList) {
if(list.getGroupId().equals(groupId)) { if(list.getGroupId().equals(groupId)) {
@ -2150,6 +2165,9 @@ public class CtrCntrlQueryRepository{
.where(builder) .where(builder)
.fetch(); .fetch();
log.info("Arcrft Query Result => {}", arcrftList);
return arcrftList; return arcrftList;
//------------------------------------------- //-------------------------------------------

Loading…
Cancel
Save