공지사항 반영
parent
8bfb63d06d
commit
d05c196e8b
@ -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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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> {
|
||||||
|
|
||||||
|
}
|
@ -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> {
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue