parent
75cb830775
commit
12893d3cc9
@ -0,0 +1,54 @@
|
|||||||
|
package com.xit.biz.ctgy.controller;
|
||||||
|
|
||||||
|
import com.xit.biz.cmm.dto.CmmUserDto;
|
||||||
|
import com.xit.biz.cmm.dto.struct.CmmUserMapstruct;
|
||||||
|
import com.xit.biz.ctgy.dto.MinCivBoard680Dto;
|
||||||
|
import com.xit.biz.ctgy.dto.struct.MinCivBoard680Mapstruct;
|
||||||
|
import com.xit.biz.ctgy.service.IMinCivBoard680Service;
|
||||||
|
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.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Tag(name = "OAuth2LocalController", description = "인증 관리")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/biz/board")
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class MinCivBoard680Controller {
|
||||||
|
|
||||||
|
private final IMinCivBoard680Service minCivBoard680Service;
|
||||||
|
|
||||||
|
private MinCivBoard680Mapstruct minCivBoard680Mapstruct = Mappers.getMapper(MinCivBoard680Mapstruct.class);
|
||||||
|
|
||||||
|
@Operation(summary = "게시판 목록 조회" , description = "게시판 목록 조회")
|
||||||
|
@Parameters({
|
||||||
|
@Parameter(in = ParameterIn.QUERY, name = "ciTitle", description = "제목", required = false, example = " "),
|
||||||
|
@Parameter(in = ParameterIn.QUERY, name = "ciName", description = "이름", required = false, example = " "),
|
||||||
|
@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "1"),
|
||||||
|
@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)
|
||||||
|
@ModelAttribute("minCivBoard680Dto")
|
||||||
|
final MinCivBoard680Dto minCivBoard680Dto,
|
||||||
|
@Parameter(hidden = true)
|
||||||
|
final Pageable pageable) {
|
||||||
|
return RestResponse.of(minCivBoard680Service.findMinCivBoard680s(minCivBoard680Mapstruct.toEntity(minCivBoard680Dto), pageable));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.xit.biz.ctgy.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Schema(name = "MinCivBoard680Dto", description = "게시판")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class MinCivBoard680Dto implements Serializable {
|
||||||
|
private static final long SerialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(title = "게시판코드", example = " ", description = "Input Description...")
|
||||||
|
private Long ciCode;
|
||||||
|
|
||||||
|
@Schema(title = "글번호", example = " ", description = "Input Description...")
|
||||||
|
private Long ciContentno;
|
||||||
|
|
||||||
|
@Schema(title = "제목", example = " ", description = "Input Description...")
|
||||||
|
private String ciTitle;
|
||||||
|
|
||||||
|
@Schema(title = "사용자 아이디", example = " ", description = "Input Description...")
|
||||||
|
private String ciId;
|
||||||
|
|
||||||
|
@Schema(title = "사용자패스워드", example = " ", description = "Input Description...")
|
||||||
|
private String ciPwd;
|
||||||
|
|
||||||
|
@Schema(title = "사용자 성명", example = " ", description = "Input Description...")
|
||||||
|
private String ciName;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "등록일자", example = " ", description = "Input Description...")
|
||||||
|
private String ciNalja;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "등록시간", example = " ", description = "Input Description...")
|
||||||
|
private String ciTime;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "조회수", example = " ", description = "Input Description...")
|
||||||
|
private Long ciHit;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "REF", example = " ", description = "Input Description...")
|
||||||
|
private Long ciRef;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "STEP", example = " ", description = "Input Description...")
|
||||||
|
private Long ciStep;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "LEVEL", example = " ", description = "Input Description...")
|
||||||
|
private Long ciRevel;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "패스워드", example = " ", description = "Input Description...")
|
||||||
|
private String ciPass;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "이메일", example = " ", description = "Input Description...")
|
||||||
|
private String ciEmail;
|
||||||
|
|
||||||
|
@Schema(required = false, title = "내용", example = " ", description = "Input Description...")
|
||||||
|
private String ciContents;
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.xit.biz.ctgy.dto.struct;
|
||||||
|
|
||||||
|
import com.xit.biz.ctgy.dto.MinCivBoard680Dto;
|
||||||
|
import com.xit.biz.ctgy.entity.MinCivBoard680;
|
||||||
|
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 MinCivBoard680Mapstruct extends IMapstruct<MinCivBoard680Dto, MinCivBoard680> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.xit.biz.ctgy.repository;
|
||||||
|
|
||||||
|
import com.xit.biz.cmm.entity.CmmUser;
|
||||||
|
import com.xit.biz.ctgy.entity.MinCivBoard680;
|
||||||
|
import org.springframework.data.domain.Example;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface IMinCivBoard680Repository extends JpaRepository<MinCivBoard680, Long> {
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.xit.biz.ctgy.service;
|
||||||
|
|
||||||
|
import com.xit.biz.ctgy.entity.MinCivBoard680;
|
||||||
|
import com.xit.core.support.jpa.IJpaOperation;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
public interface IMinCivBoard680Service {
|
||||||
|
|
||||||
|
Page<MinCivBoard680> findMinCivBoard680s(MinCivBoard680 minCivBoard680, Pageable pageable);
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.xit.biz.ctgy.service.impl;
|
||||||
|
|
||||||
|
import com.xit.biz.cmm.entity.CmmUser;
|
||||||
|
import com.xit.biz.ctgy.entity.MinCivBoard680;
|
||||||
|
import com.xit.biz.ctgy.repository.IMinCivBoard680Repository;
|
||||||
|
import com.xit.biz.ctgy.service.IMinCivBoard680Service;
|
||||||
|
import com.xit.core.support.jpa.JpaUtil;
|
||||||
|
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
|
||||||
|
public class MinCivBoard680Service implements IMinCivBoard680Service {
|
||||||
|
|
||||||
|
private final IMinCivBoard680Repository minCivBoard680Repository;
|
||||||
|
|
||||||
|
public MinCivBoard680Service(IMinCivBoard680Repository minCivBoard680Repository) {
|
||||||
|
this.minCivBoard680Repository = minCivBoard680Repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public Page<MinCivBoard680> findMinCivBoard680s(MinCivBoard680 minCivBoard680, 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<MinCivBoard680> example = Example.of(minCivBoard680, exampleMatcher);
|
||||||
|
Page<MinCivBoard680> page = minCivBoard680Repository.findAll(example, pageable);
|
||||||
|
// List<CmmUser> userList = page.getContent();
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue