From d05c196e8b67aa9e4749da6b6db1e02ea0b6af8f Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 18 Mar 2022 20:17:32 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MinCivBoard680Controller.java | 4 +- .../controller/MinInfoBoard680Controller.java | 51 ++++++++++++++++ .../controller/MinSimsa680Controller.java | 10 ++- .../xit/biz/ctgy/dto/MinInfoBoard680Dto.java | 61 +++++++++++++++++++ .../dto/struct/MinInfoBoard680Mapstruct.java | 12 ++++ .../xit/biz/ctgy/entity/MinInfoBoard680.java | 2 - .../IMinInfoBoard680Repository.java | 7 +++ .../IMinSimsa680RepositoryImpl.java | 5 +- .../ctgy/service/IMinCivBoard680Service.java | 2 +- .../ctgy/service/IMinInfoBoard680Service.java | 10 +++ .../biz/ctgy/service/IMinSimsa680Service.java | 6 +- .../service/impl/MinCivBoard680Service.java | 4 +- .../service/impl/MinInfoBoard680Service.java | 38 ++++++++++++ .../ctgy/service/impl/MinSimsa680Service.java | 8 +-- 14 files changed, 197 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/xit/biz/ctgy/controller/MinInfoBoard680Controller.java create mode 100644 src/main/java/com/xit/biz/ctgy/dto/MinInfoBoard680Dto.java create mode 100644 src/main/java/com/xit/biz/ctgy/dto/struct/MinInfoBoard680Mapstruct.java create mode 100644 src/main/java/com/xit/biz/ctgy/repository/IMinInfoBoard680Repository.java create mode 100644 src/main/java/com/xit/biz/ctgy/service/IMinInfoBoard680Service.java create mode 100644 src/main/java/com/xit/biz/ctgy/service/impl/MinInfoBoard680Service.java diff --git a/src/main/java/com/xit/biz/ctgy/controller/MinCivBoard680Controller.java b/src/main/java/com/xit/biz/ctgy/controller/MinCivBoard680Controller.java index 98ca675..baa594d 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/MinCivBoard680Controller.java +++ b/src/main/java/com/xit/biz/ctgy/controller/MinCivBoard680Controller.java @@ -43,10 +43,10 @@ public class MinCivBoard680Controller { @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findMinCivBoard680s( @Parameter(hidden = true) - final MinCivBoard680Dto minCivBoard680Dto, + final MinCivBoard680Dto dto, @Parameter(hidden = true) final Pageable pageable) { - return RestResponse.of(service.findMinCivBoard680s(mapstruct.toEntity(minCivBoard680Dto), pageable)); + return RestResponse.of(service.findAll(mapstruct.toEntity(dto), pageable)); } } diff --git a/src/main/java/com/xit/biz/ctgy/controller/MinInfoBoard680Controller.java b/src/main/java/com/xit/biz/ctgy/controller/MinInfoBoard680Controller.java new file mode 100644 index 0000000..1a5b5d5 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/controller/MinInfoBoard680Controller.java @@ -0,0 +1,51 @@ +package com.xit.biz.ctgy.controller; + +import com.xit.biz.ctgy.dto.MinInfoBoard680Dto; +import com.xit.biz.ctgy.dto.struct.MinInfoBoard680Mapstruct; +import com.xit.biz.ctgy.service.IMinInfoBoard680Service; +import com.xit.core.api.IRestResponse; +import com.xit.core.api.RestResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.mapstruct.factory.Mappers; +import org.springframework.data.domain.Pageable; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "MinInfoBoard680Controller", description = "공지사항 관리") +@RestController +@RequestMapping("/api/v1/ctgy/pboard") +@Validated +@RequiredArgsConstructor +public class MinInfoBoard680Controller { + + private final IMinInfoBoard680Service service; + + private final MinInfoBoard680Mapstruct mapstruct = Mappers.getMapper(MinInfoBoard680Mapstruct.class); + + // TODO :: 파라메터 정의 필요 + @Operation(summary = "게시글 목록 조회" , description = "게시글 목록 조회") + @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "inTitle", description = "제목", required = false, example = " "), + @Parameter(in = ParameterIn.QUERY, name = "inName", description = "이름", required = false, example = " "), + @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), + @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") + }) + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findMinCivBoard680s( + @Parameter(hidden = true) + final MinInfoBoard680Dto dto, + @Parameter(hidden = true) + final Pageable pageable) { + return RestResponse.of(service.findAll(mapstruct.toEntity(dto), pageable)); + } + +} diff --git a/src/main/java/com/xit/biz/ctgy/controller/MinSimsa680Controller.java b/src/main/java/com/xit/biz/ctgy/controller/MinSimsa680Controller.java index 40a5b82..d69b484 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/MinSimsa680Controller.java +++ b/src/main/java/com/xit/biz/ctgy/controller/MinSimsa680Controller.java @@ -49,10 +49,10 @@ public class MinSimsa680Controller { public ResponseEntity findMinSimsa680Groups( @Valid @Parameter(hidden = true) - final MinSimsa680GroupDto minSimsa680GroupDto, + final MinSimsa680GroupDto dto, @Parameter(hidden = true) final Pageable pageable) { - return RestResponse.of(service.findMinSimsa680Groups(minSimsa680GroupDto, pageable)); + return RestResponse.of(service.findGroups(dto, pageable)); } @Operation(summary = "심사(대상) 상세 조회" , description = "심사(대상) 상세 조회") @@ -66,10 +66,8 @@ public class MinSimsa680Controller { public ResponseEntity findMinSimsa680Details( @Valid @Parameter(hidden = true) - final MinSimsa680GroupDto minSimsa680GroupDto, - @Parameter(hidden = true) - final Pageable pageable) { - return RestResponse.of(service.findMinSimsa680Details(minSimsa680GroupDto)); + final MinSimsa680GroupDto dto) { + return RestResponse.of(service.findDetails(dto)); } // TODO :: 파라메터 정의 필요 diff --git a/src/main/java/com/xit/biz/ctgy/dto/MinInfoBoard680Dto.java b/src/main/java/com/xit/biz/ctgy/dto/MinInfoBoard680Dto.java new file mode 100644 index 0000000..0ea5f8d --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/dto/MinInfoBoard680Dto.java @@ -0,0 +1,61 @@ +package com.xit.biz.ctgy.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.persistence.Column; +import java.io.Serializable; + +@Schema(name = "MinInfoBoard680Dto", description = "공지사항") +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MinInfoBoard680Dto implements Serializable { + private static final long SerialVersionUID = 1L; + + @Schema(title = "공지사항코드", example = " ", description = "공지사항코드") + private Long inCode; + + @Schema(title = "공지사항구분", example = " ", description = "공지사항구분") + private String inBgubun; + + @Schema(required = false, title = "날짜", example = " ", description = "Input Description...") + private String inNalja; + + @Schema(required = false, title = "시간", example = " ", description = "Input Description...") + private String inTime; + + @Schema(required = false, title = "성명", example = " ", description = "Input Description...") + private String inName; + + @Schema(required = false, title = "부서", example = " ", description = "Input Description...") + private String inDept; + + @Schema(required = false, title = "글번호", example = " ", description = "Input Description...") + private Long inContentno; + + @Schema(required = false, title = "제목", example = " ", description = "Input Description...") + private String inTitle; + + @Schema(required = false, title = "내용", example = " ", description = "Input Description...") + private String inContents; + + @Schema(required = false, title = "조회수", example = " ", description = "Input Description...") + private Long inHit; + + @Schema(required = false, title = "파일명", example = " ", description = "Input Description...") + private String inFilename; + + @Schema(required = false, title = "파일사이즈", example = " ", description = "Input Description...") + private Long inFilesize; + + @Schema(required = false, title = "파일URL", example = " ", description = "Input Description...") + private String inFileurl; + + @Schema(required = false, title = "기타", example = " ", description = "Input Description...") + private String inEtc; +} diff --git a/src/main/java/com/xit/biz/ctgy/dto/struct/MinInfoBoard680Mapstruct.java b/src/main/java/com/xit/biz/ctgy/dto/struct/MinInfoBoard680Mapstruct.java new file mode 100644 index 0000000..31054e6 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/dto/struct/MinInfoBoard680Mapstruct.java @@ -0,0 +1,12 @@ +package com.xit.biz.ctgy.dto.struct; + +import com.xit.biz.ctgy.dto.MinInfoBoard680Dto; +import com.xit.biz.ctgy.entity.MinInfoBoard680; +import com.xit.core.support.jpa.mapstruct.IMapstruct; +import com.xit.core.support.jpa.mapstruct.MapStructMapperConfig; +import org.mapstruct.Mapper; + +@Mapper(config = MapStructMapperConfig.class) +public interface MinInfoBoard680Mapstruct extends IMapstruct { + +} diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinInfoBoard680.java b/src/main/java/com/xit/biz/ctgy/entity/MinInfoBoard680.java index 0ab1f99..9559938 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinInfoBoard680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinInfoBoard680.java @@ -16,8 +16,6 @@ public class MinInfoBoard680 implements Serializable { private static final long SerialVersionUID = 1L; @Id - private Long id; - @Schema(required = true, title = "공지사항코드", example = " ", description = "Input Description...") @Column(name = "in_code", nullable = false) private Long inCode; diff --git a/src/main/java/com/xit/biz/ctgy/repository/IMinInfoBoard680Repository.java b/src/main/java/com/xit/biz/ctgy/repository/IMinInfoBoard680Repository.java new file mode 100644 index 0000000..8e00914 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/repository/IMinInfoBoard680Repository.java @@ -0,0 +1,7 @@ +package com.xit.biz.ctgy.repository; + +import com.xit.biz.ctgy.entity.MinInfoBoard680; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface IMinInfoBoard680Repository extends JpaRepository { +} diff --git a/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java index b3e31fe..f0261fb 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java @@ -73,10 +73,9 @@ public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom BooleanBuilder builder = new BooleanBuilder(); builder.and(minSimsa680.msSdate.eq(dto.getMsSdate())); builder.and(minSimsa680.msEdate.eq(dto.getMsEdate())); - builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam())); - if (!Checks.isEmpty(dto.getMsChasu())) { - builder.and(minSimsa680.msChasu.eq(dto.getMsChasu())); + if (!Checks.isEmpty(dto.getMsuTeam())) { + builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam())); } List rslt = diff --git a/src/main/java/com/xit/biz/ctgy/service/IMinCivBoard680Service.java b/src/main/java/com/xit/biz/ctgy/service/IMinCivBoard680Service.java index 0c80e96..02d2f7f 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IMinCivBoard680Service.java +++ b/src/main/java/com/xit/biz/ctgy/service/IMinCivBoard680Service.java @@ -7,5 +7,5 @@ import org.springframework.data.domain.Pageable; public interface IMinCivBoard680Service { - Page findMinCivBoard680s(MinCivBoard680 minCivBoard680, Pageable pageable); + Page findAll(MinCivBoard680 minCivBoard680, Pageable pageable); } diff --git a/src/main/java/com/xit/biz/ctgy/service/IMinInfoBoard680Service.java b/src/main/java/com/xit/biz/ctgy/service/IMinInfoBoard680Service.java new file mode 100644 index 0000000..f2c3475 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/service/IMinInfoBoard680Service.java @@ -0,0 +1,10 @@ +package com.xit.biz.ctgy.service; + +import com.xit.biz.ctgy.entity.MinInfoBoard680; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +public interface IMinInfoBoard680Service { + + Page findAll(MinInfoBoard680 entity, Pageable pageable); +} diff --git a/src/main/java/com/xit/biz/ctgy/service/IMinSimsa680Service.java b/src/main/java/com/xit/biz/ctgy/service/IMinSimsa680Service.java index e88293c..5cc7ed9 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IMinSimsa680Service.java +++ b/src/main/java/com/xit/biz/ctgy/service/IMinSimsa680Service.java @@ -11,10 +11,10 @@ import java.util.List; public interface IMinSimsa680Service { //Page findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable); - Page findMinSimsa680Groups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); - List findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto); + Page findGroups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); + List findDetails(MinSimsa680GroupDto minSimsa680GroupDto); - Page findMinSimsa680s(MinSimsa680 minSimsa680, Pageable pageable); + Page findAll(MinSimsa680 minSimsa680, Pageable pageable); Page findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable); } diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/MinCivBoard680Service.java b/src/main/java/com/xit/biz/ctgy/service/impl/MinCivBoard680Service.java index 5c77b07..7b7f5ab 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/MinCivBoard680Service.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/MinCivBoard680Service.java @@ -22,13 +22,13 @@ public class MinCivBoard680Service implements IMinCivBoard680Service { private final IMinCivBoard680Repository repository; @Transactional(readOnly = true) - public Page findMinCivBoard680s(MinCivBoard680 minCivBoard680, Pageable pageable) { + public Page findAll(MinCivBoard680 entity, Pageable pageable) { //Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); pageable = JpaUtil.getPagingInfo(pageable); ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll() .withMatcher("ciTitle", contains()) .withMatcher("ciName", contains()); - Example example = Example.of(minCivBoard680, exampleMatcher); + Example example = Example.of(entity, exampleMatcher); Page page = repository.findAll(example, pageable); // List userList = page.getContent(); return page; diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/MinInfoBoard680Service.java b/src/main/java/com/xit/biz/ctgy/service/impl/MinInfoBoard680Service.java new file mode 100644 index 0000000..5922835 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/service/impl/MinInfoBoard680Service.java @@ -0,0 +1,38 @@ +package com.xit.biz.ctgy.service.impl; + +import com.xit.biz.ctgy.entity.MinCivBoard680; +import com.xit.biz.ctgy.entity.MinInfoBoard680; +import com.xit.biz.ctgy.repository.IMinCivBoard680Repository; +import com.xit.biz.ctgy.repository.IMinInfoBoard680Repository; +import com.xit.biz.ctgy.service.IMinCivBoard680Service; +import com.xit.biz.ctgy.service.IMinInfoBoard680Service; +import com.xit.core.support.jpa.JpaUtil; +import lombok.AllArgsConstructor; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.ExampleMatcher; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; + +@Service +@AllArgsConstructor +public class MinInfoBoard680Service implements IMinInfoBoard680Service { + + private final IMinInfoBoard680Repository repository; + + @Transactional(readOnly = true) + public Page findAll(MinInfoBoard680 entity, Pageable pageable) { + //Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); + pageable = JpaUtil.getPagingInfo(pageable); + ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll() + .withMatcher("inTitle", contains()) + .withMatcher("inName", contains()); + Example example = Example.of(entity, exampleMatcher); + Page page = repository.findAll(example, pageable); + // List userList = page.getContent(); + return page; + } +} diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/MinSimsa680Service.java b/src/main/java/com/xit/biz/ctgy/service/impl/MinSimsa680Service.java index 5809eca..9972b64 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/MinSimsa680Service.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/MinSimsa680Service.java @@ -22,24 +22,24 @@ public class MinSimsa680Service implements IMinSimsa680Service { private final IMinSimsa680Repository repository; @Transactional(readOnly = true) - public Page findMinSimsa680s(MinSimsa680 minSimsa680, Pageable pageable) { + public Page findAll(MinSimsa680 entity, Pageable pageable) { pageable = JpaUtil.getPagingInfo(pageable); ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll() .withMatcher("ciTitle", contains()) .withMatcher("ciName", contains()); - Example example = Example.of(minSimsa680, exampleMatcher); + Example example = Example.of(entity, exampleMatcher); Page page = repository.findAll(example, pageable); // List userList = page.getContent(); return page; } @Transactional(readOnly = true) - public Page findMinSimsa680Groups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) { + public Page findGroups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) { return repository.findMinSimsa680Groups(minSimsa680GroupDto, pageable); } @Transactional(readOnly = true) - public List findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto) { + public List findDetails(MinSimsa680GroupDto minSimsa680GroupDto) { return repository.findMinSimsa680Details(minSimsa680GroupDto); }