mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 04:27:21 +09:00
공지사항 불필요한 리스트 수정 및 FAQ 추가 개발 진행
This commit is contained in:
@@ -137,7 +137,7 @@ public class HomeMgtController {
|
||||
@RequestMapping(value = "/getImageUrl", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public FileResDto fileResDto(MultipartHttpServletRequest multipartRequest) {
|
||||
|
||||
|
||||
return homeService.fileResDto(multipartRequest);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,14 @@ public class HomeMgtController {
|
||||
FileIoUtils.fileDownload(file, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 02.
|
||||
* auth : kjh
|
||||
* desc : 이미지 미리보기.
|
||||
* @param imgurl
|
||||
* @return imgurl
|
||||
*/
|
||||
@ApiOperation(value = "이미지 미리보기", notes = "이미지 미리보기")
|
||||
@GetMapping(value = "/preview/{imgurl}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public ResponseEntity<byte[]> previewImageResource(@PathVariable @ApiParam(value = "이미지 경로") String imgurl) {
|
||||
@@ -189,4 +196,86 @@ public class HomeMgtController {
|
||||
return new ResponseEntity<byte[]>(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 조회.
|
||||
* @param faqListReqDto
|
||||
* @return FaqListResDto
|
||||
*/
|
||||
@ApiOperation(value = "/faqList", notes = "자주묻는 질문 조회")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/faqList", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public FaqListResDto faqList(@RequestBody @Valid FaqListReqDto faqListReqDto,
|
||||
BindingResult bindingResult, HttpServletResponse response) {
|
||||
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new FaqListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return homeService.faqList(faqListReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 등록.
|
||||
* @param insertFaqReqDto
|
||||
* @return InsertFaqResDto
|
||||
*/
|
||||
@ApiOperation(value = "/insertFaq", notes = "자주묻는 질문 등록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/insertFaq", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public InsertFaqResDto insertFaq(@RequestBody @Valid InsertFaqReqDto insertFaqReqDto, BindingResult bindingResult) {
|
||||
|
||||
System.out.println("insertFaqReqDto ::::" + insertFaqReqDto);
|
||||
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new InsertFaqResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return homeService.insertFaq(insertFaqReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 수정.
|
||||
* @param updateFaqReqDto
|
||||
* @return UpdateFaqResDto
|
||||
*/
|
||||
@ApiOperation(value = "/updateFaq", notes = "자주묻는 질문 등록")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/updateFaq", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public UpdateFaqResDto updateFaq(@RequestBody @Valid UpdateFaqReqDto updateFaqReqDto, BindingResult bindingResult) {
|
||||
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new UpdateFaqResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return homeService.updateFaq(updateFaqReqDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 삭제.
|
||||
* @param deleteFaqReqDto
|
||||
* @return DeleteFaqResDto
|
||||
*/
|
||||
@ApiOperation(value = "/deleteFaq", notes = "공지사항 삭제")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "/deleteFaq", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public DeleteFaqResDto deleteFaq(@RequestBody @Valid DeleteFaqReqDto deleteFaqReqDto, BindingResult bindingResult) {
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new DeleteFaqResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return homeService.deleteFaq(deleteFaqReqDto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,16 @@ public interface HomeMgtMapper {
|
||||
|
||||
int deleteNotice(DeleteNoticeReqDto deleteNoticeReqDto);
|
||||
|
||||
int selectFaqTotalCnt(FaqListReqDto faqListReqDto);
|
||||
|
||||
List<FaqDto> selectFaqList(FaqListReqDto faqListReqDto);
|
||||
|
||||
int selectFaqNumber(FaqListReqDto faqListReqDto);
|
||||
|
||||
void insertFaq(InsertFaqReqDto insertFaqReqDto);
|
||||
|
||||
int updateFaq(UpdateFaqReqDto updateFaqReqDto);
|
||||
|
||||
int deleteFaq(DeleteFaqReqDto deleteFaqReqDto);
|
||||
|
||||
}
|
||||
|
||||
@@ -288,4 +288,111 @@ public class HomeMgtService {
|
||||
return new DeleteNoticeResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : faq 목록 조회
|
||||
* @param faqListReqDto
|
||||
* @return FaqListResDto
|
||||
*/
|
||||
public FaqListResDto faqList(FaqListReqDto faqListReqDto) {
|
||||
|
||||
HomeMgtMapper homeMgtMapper = sqlSessionSlave.getMapper(HomeMgtMapper.class);
|
||||
|
||||
String nowPage = String.valueOf(faqListReqDto.getPage());
|
||||
int totalCnt = homeMgtMapper.selectFaqTotalCnt(faqListReqDto);
|
||||
|
||||
|
||||
if(totalCnt == 0) {
|
||||
Paging paging = new Paging();
|
||||
paging.setPage(nowPage);
|
||||
paging.setTotalCnt(String.valueOf(totalCnt));
|
||||
FaqListRes faqListRes = new FaqListRes();
|
||||
faqListRes.setList(new ArrayList<>());
|
||||
faqListRes.setPaging(paging);
|
||||
return new FaqListResDto(ApiResponseCode.CM_NOT_FOUND, faqListRes);
|
||||
}
|
||||
|
||||
int page = faqListReqDto.getPage();
|
||||
int pagePerRows = faqListReqDto.getPagePerRows();
|
||||
page = (page -1) * pagePerRows;
|
||||
faqListReqDto.setPage(page);
|
||||
|
||||
List<FaqDto> faqDto = homeMgtMapper.selectFaqList(faqListReqDto);
|
||||
|
||||
Paging paging = new Paging();
|
||||
paging.setPage(nowPage);
|
||||
paging.setTotalCnt(String.valueOf(totalCnt));
|
||||
|
||||
FaqListRes faqListRes = new FaqListRes();
|
||||
faqListRes.setList(faqDto);
|
||||
faqListRes.setPaging(paging);
|
||||
|
||||
return new FaqListResDto(ApiResponseCode.SUCCESS, faqListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 등록
|
||||
* @param insertFaqReqDto
|
||||
* @return InsertFaqResDto
|
||||
*/
|
||||
public InsertFaqResDto insertFaq(InsertFaqReqDto insertFaqReqDto) {
|
||||
|
||||
HomeMgtMapper homeMgtMapper = sqlSessionSlave.getMapper(HomeMgtMapper.class);
|
||||
|
||||
//공지사항 등록
|
||||
try {
|
||||
insertFaqReqDto.setFaqSbst(insertFaqReqDto.getFaqSbst().replaceAll("\\n", "<br />"));
|
||||
homeMgtMapper.insertFaq(insertFaqReqDto);
|
||||
}catch(Exception e){
|
||||
return new InsertFaqResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
return new InsertFaqResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 수정
|
||||
* @param updateFaqReqDto
|
||||
* @return UpdateFaqResDto
|
||||
*/
|
||||
public UpdateFaqResDto updateFaq(UpdateFaqReqDto updateFaqReqDto) {
|
||||
|
||||
HomeMgtMapper homeMgtMapper = sqlSessionSlave.getMapper(HomeMgtMapper.class);
|
||||
|
||||
//공지사항 수정
|
||||
try {
|
||||
updateFaqReqDto.setFaqSbst(updateFaqReqDto.getFaqSbst().replaceAll("\\n", "<br />"));
|
||||
homeMgtMapper.updateFaq(updateFaqReqDto);
|
||||
}catch(Exception e){
|
||||
return new UpdateFaqResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
return new UpdateFaqResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 11. 03.
|
||||
* auth : kjh
|
||||
* desc : FAQ 삭제
|
||||
* @param deleteFaqReqDto
|
||||
* @return
|
||||
*/
|
||||
public DeleteFaqResDto deleteFaq(DeleteFaqReqDto deleteFaqReqDto) {
|
||||
|
||||
HomeMgtMapper homeMgtMapper = sqlSessionSlave.getMapper(HomeMgtMapper.class);
|
||||
|
||||
try {
|
||||
homeMgtMapper.deleteFaq(deleteFaqReqDto);
|
||||
} catch (Exception e) {
|
||||
return new DeleteFaqResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
return new DeleteFaqResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
src/main/java/kr/co/uplus/ez/api/homeMgt/dto/DeleteFaq.java
Normal file
15
src/main/java/kr/co/uplus/ez/api/homeMgt/dto/DeleteFaq.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeleteFaq implements Serializable{
|
||||
|
||||
@ApiModelProperty(example = "FAQ 번호", name = "FAQ 번호", dataType = "int")
|
||||
private int faqNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeleteFaqReqDto implements Serializable{
|
||||
|
||||
private List<DeleteFaq> list;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class DeleteFaqResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
// 데이터.
|
||||
private Object data;
|
||||
|
||||
public DeleteFaqResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public DeleteFaqResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public DeleteFaqResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
54
src/main/java/kr/co/uplus/ez/api/homeMgt/dto/FaqDto.java
Normal file
54
src/main/java/kr/co/uplus/ez/api/homeMgt/dto/FaqDto.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class FaqDto implements Serializable {
|
||||
@ApiModelProperty(example = "리스트 번호", name = "리스트 번호", dataType = "Integer")
|
||||
private Integer no;
|
||||
|
||||
@ApiModelProperty(example = "faq 번호", name = "faq 번호", dataType = "int")
|
||||
private int faqNo;
|
||||
|
||||
@ApiModelProperty(example = "분류 코드", name = "분류 코드", dataType = "String")
|
||||
private String ctgCd;
|
||||
|
||||
@ApiModelProperty(example = "분류코드명", name = "분류코드명", dataType = "String")
|
||||
private String ctgCdNm;
|
||||
|
||||
@ApiModelProperty(example = "제목", name = "제목", dataType = "String")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(example = "내용", name = "내용", dataType = "String")
|
||||
private String faqSbst;
|
||||
|
||||
@ApiModelProperty(example = "사용 여부", name = "사용 여부", dataType = "String")
|
||||
private String useYn;
|
||||
|
||||
@ApiModelProperty(example = "등록 ID", name = "등록 ID", dataType = "String")
|
||||
private String regId;
|
||||
|
||||
@ApiModelProperty(example = "등록 일시", name = "등록 일시", dataType = "String")
|
||||
private String regDt;
|
||||
|
||||
@ApiModelProperty(example = "변경 ID", name = "변경 ID", dataType = "String")
|
||||
private String chgId;
|
||||
|
||||
@ApiModelProperty(example = "변경 일시", name = "변경 일시", dataType = "String")
|
||||
private String chgDt;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "페이지당 조회할 목록 수",notes = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "int")
|
||||
private int pagePerRows;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int")
|
||||
private int page;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class FaqListReqDto implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "분류 코드", name = "분류 코드", dataType = "String")
|
||||
private String searchType1;
|
||||
|
||||
@ApiModelProperty(example = "제목 검색어", name = "제목 검색어", dataType = "String")
|
||||
private String searchText1;
|
||||
|
||||
@ApiModelProperty(example = "faq 번호", name = "faq 번호", dataType = "int")
|
||||
private int faqNo;
|
||||
|
||||
@ApiModelProperty(example = "분류 코드", name = "분류 코드", dataType = "String")
|
||||
private String ctgCd;
|
||||
|
||||
@ApiModelProperty(example = "제목", name = "제목", dataType = "String")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(example = "내용", name = "내용", dataType = "String")
|
||||
private String faqSbst;
|
||||
|
||||
@ApiModelProperty(example = "사용 여부", name = "사용 여부", dataType = "String")
|
||||
private String useYn;
|
||||
|
||||
@ApiModelProperty(example = "등록 ID", name = "등록 ID", dataType = "String")
|
||||
private String regId;
|
||||
|
||||
@ApiModelProperty(example = "변경 ID", name = "변경 ID", dataType = "String")
|
||||
private String chgId;
|
||||
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "페이지당 조회할 목록 수",notes = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "int")
|
||||
private int pagePerRows;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int")
|
||||
private int page;
|
||||
|
||||
}
|
||||
15
src/main/java/kr/co/uplus/ez/api/homeMgt/dto/FaqListRes.java
Normal file
15
src/main/java/kr/co/uplus/ez/api/homeMgt/dto/FaqListRes.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class FaqListRes implements Serializable {
|
||||
|
||||
private Paging paging;
|
||||
private List<FaqDto> list;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class FaqListResDto extends ResponseMessage implements Serializable {
|
||||
// 데이터.
|
||||
private FaqListRes data;
|
||||
|
||||
public FaqListResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public FaqListResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public FaqListResDto(ApiResponseCode returnStr, FaqListRes data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class InsertFaqReqDto implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "분류 코드", name = "분류 코드", dataType = "String")
|
||||
private String ctgCd;
|
||||
|
||||
@ApiModelProperty(example = "제목", name = "제목", dataType = "String")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(example = "자주묻는 질문 내용", name = "자주묻는 질문 내용", dataType = "String")
|
||||
private String faqSbst;
|
||||
|
||||
@ApiModelProperty(example = "사용 여부", name = "사용 여부", dataType = "String")
|
||||
private String useYn;
|
||||
|
||||
@ApiModelProperty(example = "등록 ID", name = "등록 ID", dataType = "String")
|
||||
private String regId;
|
||||
|
||||
@ApiModelProperty(example = "변경 ID", name = "변경 ID", dataType = "String")
|
||||
private String chgId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class InsertFaqResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
// 데이터.
|
||||
private Object data;
|
||||
|
||||
public InsertFaqResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public InsertFaqResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public InsertFaqResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class UpdateFaqReqDto implements Serializable{
|
||||
|
||||
@ApiModelProperty(example = "faq 번호", name = "faq 번호", dataType = "int")
|
||||
private int faqNo;
|
||||
|
||||
@ApiModelProperty(example = "분류 코드", name = "분류 코드", dataType = "String")
|
||||
private String ctgCd;
|
||||
|
||||
@ApiModelProperty(example = "제목", name = "제목", dataType = "String")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(example = "내용", name = "내용", dataType = "String")
|
||||
private String faqSbst;
|
||||
|
||||
@ApiModelProperty(example = "사용 여부", name = "사용 여부", dataType = "String")
|
||||
private String useYn;
|
||||
|
||||
@ApiModelProperty(example = "변경 ID", name = "변경 ID", dataType = "String")
|
||||
private String chgId;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package kr.co.uplus.ez.api.homeMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class UpdateFaqResDto extends ResponseMessage implements Serializable {
|
||||
// 데이터.
|
||||
private Object data;
|
||||
|
||||
public UpdateFaqResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public UpdateFaqResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public UpdateFaqResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -13,14 +13,14 @@
|
||||
FROM
|
||||
hubez_common.EZ_NTBBS N1
|
||||
WHERE 1 = 1
|
||||
<include refid="NoticeListCondition"></include>
|
||||
<include refid="ListCondition"></include>
|
||||
</select>
|
||||
|
||||
<!-- 공지사항 조회 -->
|
||||
<select id="selectNoticeList"
|
||||
parameterType="kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto"
|
||||
resultType="kr.co.uplus.ez.api.homeMgt.dto.NoticeDto">
|
||||
/* sysMgt-mapper.xml(selectNoticeList) */
|
||||
/* homeMgt-mapper.xml(selectNoticeList) */
|
||||
SELECT
|
||||
@ROWNUM := @ROWNUM + 1 AS NO,
|
||||
NT_NO,
|
||||
@@ -79,7 +79,7 @@
|
||||
FROM
|
||||
hubez_common.EZ_NTBBS N1 , ( SELECT @ROWNUM := #{page} ) AS R
|
||||
WHERE 1=1
|
||||
<include refid="NoticeListCondition"></include>
|
||||
<include refid="ListCondition"></include>
|
||||
ORDER BY N1.REG_DT DESC
|
||||
LIMIT #{page}, #{pagePerRows}
|
||||
</select>
|
||||
@@ -88,13 +88,13 @@
|
||||
<select id="selectNoticeNumber"
|
||||
parameterType="kr.co.uplus.ez.api.homeMgt.dto.NoticeListReqDto"
|
||||
resultType="int">
|
||||
/* sysMgt-mapper.xml(selectNoticeList) */
|
||||
/* homeMgt-mapper.xml(selectNoticeList) */
|
||||
SELECT
|
||||
NT_NO,
|
||||
FROM
|
||||
hubez_common.EZ_NTBBS N1
|
||||
WHERE 1=1
|
||||
<include refid="NoticeListCondition"></include>
|
||||
<include refid="ListCondition"></include>
|
||||
ORDER BY N1.REG_DT DESC
|
||||
LIMIT #{page}, #{pagePerRows}
|
||||
</select>
|
||||
@@ -174,8 +174,7 @@
|
||||
/* homeMgt-mapper.xml (updateNotice) */
|
||||
UPDATE hubez_common.EZ_NTBBS
|
||||
SET
|
||||
CHG_DT = now()
|
||||
,CTG_CD = #{ctgCd}
|
||||
CTG_CD = #{ctgCd}
|
||||
,EMG_YN = #{emgYn}
|
||||
,USE_YN = #{useYn}
|
||||
,TITLE = #{title}
|
||||
@@ -216,9 +215,125 @@
|
||||
</foreach>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
|
||||
<!-- faq 개수 조회 -->
|
||||
<select id="selectFaqTotalCnt"
|
||||
parameterType="kr.co.uplus.ez.api.homeMgt.dto.FaqListReqDto"
|
||||
resultType="int">
|
||||
/* homeMgt-mapper.xml(selectFaqTotalCnt) */
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
hubez_common.EZ_FAQ N1
|
||||
WHERE 1 = 1
|
||||
<include refid="ListCondition"></include>
|
||||
</select>
|
||||
|
||||
<!-- faq 조회 -->
|
||||
<select id="selectFaqList" parameterType="kr.co.uplus.ez.api.homeMgt.dto.FaqListReqDto"
|
||||
resultType="kr.co.uplus.ez.api.homeMgt.dto.FaqDto">
|
||||
/* homeMgt-mapper.xml(selectFaqList) */
|
||||
SELECT
|
||||
@ROWNUM := @ROWNUM + 1 AS NO,
|
||||
FAQ_NO,
|
||||
CTG_CD,
|
||||
(
|
||||
SELECT DTL_CD_NM
|
||||
FROM hubez_common.EZ_CD_DTL
|
||||
WHERE DTL_CD = N1.CTG_CD
|
||||
AND GRP_CD = 'FAQ_CTG_CD' AND USE_YN = 'Y'
|
||||
) AS CTG_CD_NM,
|
||||
TITLE,
|
||||
REPLACE(FAQ_SBST,<![CDATA['<br />']]>, '\n') AS FAQ_SBST,
|
||||
USE_YN,
|
||||
RETV_CNT,
|
||||
REG_ID,
|
||||
DATE_FORMAT(REG_DT, '%Y-%m-%d') AS REG_DT,
|
||||
CHG_ID,
|
||||
CHG_DT
|
||||
FROM hubez_common.EZ_FAQ AS N1 , ( SELECT @ROWNUM := #{page} ) AS R
|
||||
WHERE 1=1
|
||||
<include refid="ListCondition"></include>
|
||||
ORDER BY N1.REG_DT DESC
|
||||
LIMIT #{page}, #{pagePerRows}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- FAQ 채번 -->
|
||||
<select id="selectFaqNumber"
|
||||
parameterType="kr.co.uplus.ez.api.homeMgt.dto.FaqListReqDto"
|
||||
resultType="int">
|
||||
/* homeMgt-mapper.xml(selectFaqList) */
|
||||
SELECT
|
||||
FAQ_NO,
|
||||
FROM
|
||||
hubez_common.EZ_FAQ N1
|
||||
WHERE 1=1
|
||||
<include refid="ListCondition"></include>
|
||||
ORDER BY N1.REG_DT DESC
|
||||
LIMIT #{page}, #{pagePerRows}
|
||||
</select>
|
||||
|
||||
<!-- FAQ 등록 -->
|
||||
<insert id="insertFaq" parameterType="kr.co.uplus.ez.api.homeMgt.dto.InsertFaqReqDto">
|
||||
/* homeMgt-mapper.xml (insertFaq) */
|
||||
INSERT INTO
|
||||
hubez_common.EZ_FAQ(
|
||||
CTG_CD,
|
||||
TITLE,
|
||||
FAQ_SBST,
|
||||
USE_YN,
|
||||
RETV_CNT,
|
||||
REG_ID,
|
||||
REG_DT,
|
||||
CHG_ID,
|
||||
CHG_DT
|
||||
)VALUES(
|
||||
#{ctgCd},
|
||||
#{title},
|
||||
#{faqSbst},
|
||||
#{useYn},
|
||||
0,
|
||||
#{regId},
|
||||
NOW(),
|
||||
#{chgId},
|
||||
NOW()
|
||||
);
|
||||
</insert>
|
||||
|
||||
<!-- FAQ 변경 -->
|
||||
<update id="updateFaq" parameterType="kr.co.uplus.ez.api.homeMgt.dto.UpdateFaqReqDto">
|
||||
/* homeMgt-mapper.xml (updateFaq) */
|
||||
UPDATE hubez_common.EZ_FAQ
|
||||
SET
|
||||
CTG_CD = #{ctgCd}
|
||||
,USE_YN = #{useYn}
|
||||
,TITLE = #{title}
|
||||
,FAQ_SBST = #{faqSbst}
|
||||
,CHG_DT = NOW()
|
||||
,CHG_ID = #{chgId}
|
||||
WHERE
|
||||
FAQ_NO = #{faqNo}
|
||||
</update>
|
||||
|
||||
<!-- 공지사항 삭제 -->
|
||||
<delete id="deleteFaq" parameterType="kr.co.uplus.ez.api.homeMgt.dto.DeleteFaqReqDto">
|
||||
/* homeMgt-mapper.xml(deleteFaq) */
|
||||
DELETE
|
||||
FROM
|
||||
hubez_common.EZ_FAQ
|
||||
<where>
|
||||
FAQ_NO IN
|
||||
<foreach collection="list" item="item" index="i" open="("
|
||||
separator="," close=")">
|
||||
#{item.faqNo}
|
||||
</foreach>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
<sql id="NoticeListCondition">
|
||||
<sql id="ListCondition">
|
||||
<if test="searchType1 != null and searchType1 != ''">
|
||||
AND N1.CTG_CD = #{searchType1}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user