공지사항 반영

dev
minuk926 3 years ago
parent 8bfb63d06d
commit d05c196e8b

@ -43,10 +43,10 @@ public class MinCivBoard680Controller {
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findMinCivBoard680s( public ResponseEntity<? extends IRestResponse> findMinCivBoard680s(
@Parameter(hidden = true) @Parameter(hidden = true)
final MinCivBoard680Dto minCivBoard680Dto, final MinCivBoard680Dto dto,
@Parameter(hidden = true) @Parameter(hidden = true)
final Pageable pageable) { final Pageable pageable) {
return RestResponse.of(service.findMinCivBoard680s(mapstruct.toEntity(minCivBoard680Dto), pageable)); return RestResponse.of(service.findAll(mapstruct.toEntity(dto), pageable));
} }
} }

@ -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<? extends IRestResponse> findMinCivBoard680s(
@Parameter(hidden = true)
final MinInfoBoard680Dto dto,
@Parameter(hidden = true)
final Pageable pageable) {
return RestResponse.of(service.findAll(mapstruct.toEntity(dto), pageable));
}
}

@ -49,10 +49,10 @@ public class MinSimsa680Controller {
public ResponseEntity<? extends IRestResponse> findMinSimsa680Groups( public ResponseEntity<? extends IRestResponse> findMinSimsa680Groups(
@Valid @Valid
@Parameter(hidden = true) @Parameter(hidden = true)
final MinSimsa680GroupDto minSimsa680GroupDto, final MinSimsa680GroupDto dto,
@Parameter(hidden = true) @Parameter(hidden = true)
final Pageable pageable) { final Pageable pageable) {
return RestResponse.of(service.findMinSimsa680Groups(minSimsa680GroupDto, pageable)); return RestResponse.of(service.findGroups(dto, pageable));
} }
@Operation(summary = "심사(대상) 상세 조회" , description = "심사(대상) 상세 조회") @Operation(summary = "심사(대상) 상세 조회" , description = "심사(대상) 상세 조회")
@ -66,10 +66,8 @@ public class MinSimsa680Controller {
public ResponseEntity<? extends IRestResponse> findMinSimsa680Details( public ResponseEntity<? extends IRestResponse> findMinSimsa680Details(
@Valid @Valid
@Parameter(hidden = true) @Parameter(hidden = true)
final MinSimsa680GroupDto minSimsa680GroupDto, final MinSimsa680GroupDto dto) {
@Parameter(hidden = true) return RestResponse.of(service.findDetails(dto));
final Pageable pageable) {
return RestResponse.of(service.findMinSimsa680Details(minSimsa680GroupDto));
} }
// TODO :: 파라메터 정의 필요 // TODO :: 파라메터 정의 필요

@ -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;
}

@ -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<MinInfoBoard680Dto, MinInfoBoard680> {
}

@ -16,8 +16,6 @@ public class MinInfoBoard680 implements Serializable {
private static final long SerialVersionUID = 1L; private static final long SerialVersionUID = 1L;
@Id @Id
private Long id;
@Schema(required = true, title = "공지사항코드", example = " ", description = "Input Description...") @Schema(required = true, title = "공지사항코드", example = " ", description = "Input Description...")
@Column(name = "in_code", nullable = false) @Column(name = "in_code", nullable = false)
private Long inCode; private Long inCode;

@ -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<MinInfoBoard680, Long> {
}

@ -73,10 +73,9 @@ public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
builder.and(minSimsa680.msSdate.eq(dto.getMsSdate())); builder.and(minSimsa680.msSdate.eq(dto.getMsSdate()));
builder.and(minSimsa680.msEdate.eq(dto.getMsEdate())); builder.and(minSimsa680.msEdate.eq(dto.getMsEdate()));
builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam()));
if (!Checks.isEmpty(dto.getMsChasu())) { if (!Checks.isEmpty(dto.getMsuTeam())) {
builder.and(minSimsa680.msChasu.eq(dto.getMsChasu())); builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam()));
} }
List<MinSimsa680> rslt = List<MinSimsa680> rslt =

@ -7,5 +7,5 @@ import org.springframework.data.domain.Pageable;
public interface IMinCivBoard680Service { public interface IMinCivBoard680Service {
Page<MinCivBoard680> findMinCivBoard680s(MinCivBoard680 minCivBoard680, Pageable pageable); Page<MinCivBoard680> findAll(MinCivBoard680 minCivBoard680, Pageable pageable);
} }

@ -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<MinInfoBoard680> findAll(MinInfoBoard680 entity, Pageable pageable);
}

@ -11,10 +11,10 @@ import java.util.List;
public interface IMinSimsa680Service { public interface IMinSimsa680Service {
//Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable); //Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); Page<MinSimsa680GroupDto> findGroups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto); List<MinSimsa680> findDetails(MinSimsa680GroupDto minSimsa680GroupDto);
Page<MinSimsa680> findMinSimsa680s(MinSimsa680 minSimsa680, Pageable pageable); Page<MinSimsa680> findAll(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable); Page<MinSimsaReviewGroupDto> findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable);
} }

@ -22,13 +22,13 @@ public class MinCivBoard680Service implements IMinCivBoard680Service {
private final IMinCivBoard680Repository repository; private final IMinCivBoard680Repository repository;
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Page<MinCivBoard680> findMinCivBoard680s(MinCivBoard680 minCivBoard680, Pageable pageable) { public Page<MinCivBoard680> findAll(MinCivBoard680 entity, Pageable pageable) {
//Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); //Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr");
pageable = JpaUtil.getPagingInfo(pageable); pageable = JpaUtil.getPagingInfo(pageable);
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll() ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll()
.withMatcher("ciTitle", contains()) .withMatcher("ciTitle", contains())
.withMatcher("ciName", contains()); .withMatcher("ciName", contains());
Example<MinCivBoard680> example = Example.of(minCivBoard680, exampleMatcher); Example<MinCivBoard680> example = Example.of(entity, exampleMatcher);
Page<MinCivBoard680> page = repository.findAll(example, pageable); Page<MinCivBoard680> page = repository.findAll(example, pageable);
// List<CmmUser> userList = page.getContent(); // List<CmmUser> userList = page.getContent();
return page; return page;

@ -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<MinInfoBoard680> 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<MinInfoBoard680> example = Example.of(entity, exampleMatcher);
Page<MinInfoBoard680> page = repository.findAll(example, pageable);
// List<CmmUser> userList = page.getContent();
return page;
}
}

@ -22,24 +22,24 @@ public class MinSimsa680Service implements IMinSimsa680Service {
private final IMinSimsa680Repository repository; private final IMinSimsa680Repository repository;
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Page<MinSimsa680> findMinSimsa680s(MinSimsa680 minSimsa680, Pageable pageable) { public Page<MinSimsa680> findAll(MinSimsa680 entity, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable); pageable = JpaUtil.getPagingInfo(pageable);
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll() ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll()
.withMatcher("ciTitle", contains()) .withMatcher("ciTitle", contains())
.withMatcher("ciName", contains()); .withMatcher("ciName", contains());
Example<MinSimsa680> example = Example.of(minSimsa680, exampleMatcher); Example<MinSimsa680> example = Example.of(entity, exampleMatcher);
Page<MinSimsa680> page = repository.findAll(example, pageable); Page<MinSimsa680> page = repository.findAll(example, pageable);
// List<CmmUser> userList = page.getContent(); // List<CmmUser> userList = page.getContent();
return page; return page;
} }
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) { public Page<MinSimsa680GroupDto> findGroups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) {
return repository.findMinSimsa680Groups(minSimsa680GroupDto, pageable); return repository.findMinSimsa680Groups(minSimsa680GroupDto, pageable);
} }
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto) { public List<MinSimsa680> findDetails(MinSimsa680GroupDto minSimsa680GroupDto) {
return repository.findMinSimsa680Details(minSimsa680GroupDto); return repository.findMinSimsa680Details(minSimsa680GroupDto);
} }

Loading…
Cancel
Save