초기소스
This commit is contained in:
@@ -0,0 +1,320 @@
|
||||
/*
|
||||
* Copyright 2020-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.wb.domainserver.domain.sample.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.wb.domainserver.common.msg.GconeMessageSource;
|
||||
import com.wb.domainserver.domain.sample.vo.SampleVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtResponseBody;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.MultiValueMapConverter;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.communicate.ValidateResultConverter;
|
||||
import com.wb.domainserver.util.excel.ExcelDownloadUtil;
|
||||
import com.wb.domainserver.util.file.FileMngUtil;
|
||||
import com.wb.domainserver.util.string.StringUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.multipart.MultipartRequest;
|
||||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Joe Grandja
|
||||
* @author Dmitriy Dubson
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@Slf4j
|
||||
@Controller
|
||||
public class DefaultController {
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
private final SendToResrc sendToResrc;
|
||||
|
||||
@Autowired
|
||||
private GconeMessageSource gconeMessageSource;
|
||||
|
||||
@Autowired
|
||||
private FileMngUtil fileMngUtil;
|
||||
|
||||
@Value("${mngrfo.common.fileupload.uploaddirs.goods}")
|
||||
private String uploadFilePath;
|
||||
|
||||
@Value("${mngrfo.common.fileupload.extensions.images}")
|
||||
private String whiteListFileUploadExtensions;
|
||||
|
||||
public DefaultController(SendToResrc sendToResrc){
|
||||
this.sendToResrc = sendToResrc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 추후 삭제 index > mngrordr(관리자>주문)
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/mngrordr")
|
||||
public String mngrordr() {
|
||||
return "mngrordr";
|
||||
}
|
||||
|
||||
/**
|
||||
* 추후 삭제 index > goodsmngr(관리자>상품)
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/goodsmngr")
|
||||
public String goodsmngr() {
|
||||
return "goodsmngr";
|
||||
}
|
||||
|
||||
/**
|
||||
* 추후 삭제 index > sopmalpc(사용자 PC)
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/sopmalpc")
|
||||
public String sopmalpc() {
|
||||
return "sopmalpc";
|
||||
}
|
||||
|
||||
/**
|
||||
* 추후 삭제 index > integ(통합관리자)
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/integ")
|
||||
public String integ() {
|
||||
return "integ";
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/index")
|
||||
public String index(){
|
||||
return "index";
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/logged-out2")
|
||||
public String logout(){ return "index"; }
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/sample/uiCcSetE101")
|
||||
public String uiCcSetE101() {
|
||||
return "sample/UiCcSetE101";
|
||||
}
|
||||
|
||||
/**
|
||||
* 추후 삭제 index > itrnt(인트라넷)
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/benefit")
|
||||
public String benefit() {
|
||||
return "benefit";
|
||||
}
|
||||
|
||||
/**
|
||||
* sample목록조회
|
||||
* @param vo 파라미터VO
|
||||
* @param model 모델객체
|
||||
* @return sample목록조회 JSP경로
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/sample/SampleInqireListR")
|
||||
public String index2(@Validated SampleVO vo,
|
||||
BindingResult bindingResult,
|
||||
ModelMap model){
|
||||
|
||||
log.debug("excute hree!!");
|
||||
|
||||
if(bindingResult.hasErrors()) {
|
||||
log.debug(gconeMessageSource.getMessage("error.internal-server"));
|
||||
}
|
||||
|
||||
MultiValueMap<String, Object> paramMap = MultiValueMapConverter.convert(new ObjectMapper(), vo);
|
||||
|
||||
log.debug("paramMap is {}", paramMap);
|
||||
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/sample/sampleListR", paramMap)
|
||||
);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
resultMap.put("cgn028List", objectMapper.writeValueAsString(resultMap.get("cgn028List")));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
model.addAttribute("resultMap", resultMap);
|
||||
|
||||
return "sample/SampleInqireListR";
|
||||
}
|
||||
|
||||
/**
|
||||
* 엑셀 다운로드 샘플
|
||||
* 주의사항 1. return 값을 void로 설정
|
||||
* 주의사항 2. 필히, HttpServletResponse response를 인자로 설정하여 엑셀UTIL에 넘길것
|
||||
* 주의사항 3. headerMap과 dataMap의 key를 동기화 할 것
|
||||
* @param response
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/sample/excelFileDownload")
|
||||
public void excelFileDownload(HttpServletResponse response) {
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
headerMap.put("itme01", "내용1");
|
||||
headerMap.put("itme02", "내용2");
|
||||
headerMap.put("itme03", "내용3");
|
||||
headerMap.put("itme04", "내용4");
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("itme01", "data11");
|
||||
dataMap.put("itme02", "data12");
|
||||
dataMap.put("itme03", "data13");
|
||||
dataMap.put("itme04", "data14");
|
||||
dataList.add(dataMap);
|
||||
|
||||
dataMap = new HashMap<>();
|
||||
dataMap.put("itme01", "data21");
|
||||
dataMap.put("itme02", "data22");
|
||||
dataMap.put("itme03", "data23");
|
||||
dataMap.put("itme04", "data24");
|
||||
dataList.add(dataMap);
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
ExcelDownloadUtil.createExcel("sample_excel_file", headerMap, dataList, response);
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/sample/SampleSmartEditor")
|
||||
public String SampleSmartEditor() {
|
||||
return "sample/SampleSmartEditor";
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@PostMapping("/sample/insertEdiotrValue")
|
||||
public ResponseEntity<?> insertEdiotrValue(@Validated SampleVO vo,
|
||||
BindingResult bindingResult,
|
||||
final MultipartRequest mRequset,
|
||||
ModelMap model) {
|
||||
MultiValueMap<String, MultipartFile> multipartFiles = null;
|
||||
|
||||
if(bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
}
|
||||
|
||||
multipartFiles = mRequset.getMultiFileMap();
|
||||
|
||||
log.debug("multipartFiles is {}", multipartFiles);
|
||||
WnbtResponseBody responseBody = new WnbtResponseBody("");
|
||||
responseBody.setMessage(gconeMessageSource.getMessage("success.common.insert"));
|
||||
|
||||
WnbtResponse response = WnbtResponse.builder().resBody(responseBody).build();
|
||||
return ResponseEntity.status(HttpStatus.OK).body(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일 업로드 샘플
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/sample/fileUpload")
|
||||
public ResponseEntity<?> fileUpload(HttpServletRequest request) {
|
||||
Map<String, Object> ulpladFileMap = new HashMap<>();
|
||||
MultipartHttpServletRequest mptRequest = WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class);
|
||||
if (mptRequest != null) {
|
||||
MultiValueMap<String, MultipartFile> files = mptRequest.getMultiFileMap();
|
||||
//이하의 샘플코드는 업로드된 모든 멀티파트 파일을 동일한 경로 및 확장자 제한 조건을 적용하여 업로드하고 해당 정보를 Map담도록 작성되어있습니다.
|
||||
//실제 업무 적용시 각 업무 로직(첨부파일 별로 저장경로가 다르거나 확장자 제한 조건이 다를 경우)에 맞춰서 작성하셔야 합니다.
|
||||
//샘플코드는 참조용으로만 사용하시기 바랍니다.
|
||||
Iterator<String> fInputs = files.keySet().iterator();
|
||||
while (fInputs.hasNext()) {
|
||||
String key = fInputs.next();
|
||||
ulpladFileMap.put(key, fileMngUtil.parseFileInf(files.get(key), "test", uploadFilePath, whiteListFileUploadExtensions));
|
||||
}
|
||||
}
|
||||
return ResponseEntity.status(HttpStatus.OK).body(ulpladFileMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 업로드된 이미지 view 샘플
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/sample/imageView")
|
||||
public void selectImages(HttpServletRequest request,
|
||||
HttpServletResponse response) throws Exception {
|
||||
String physicalName = request.getParameter("physicalName");
|
||||
String orginalName = request.getParameter("orginalName");
|
||||
String mimeTypeParam = request.getParameter("mimeTypeParam");
|
||||
if(!StringUtil.isEmpty(physicalName)) {
|
||||
fileMngUtil.viewFile(response, uploadFilePath, physicalName, orginalName, mimeTypeParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/sample/inputValidation")
|
||||
public ResponseEntity<?> fileUpload(HttpServletRequest request,
|
||||
@Validated SampleVO vo,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if(bindingResult.hasErrors()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convert(bindingResult, gconeMessageSource));
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body("");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.wb.domainserver.domain.sample.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.wb.domainserver.common.prop.PaginationProperties;
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.service.BOMaComncdService;
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.vo.BOBbsVO;
|
||||
import com.wb.domainserver.domain.sample.service.SampleService;
|
||||
import com.wb.domainserver.domain.sure.service.SureService;
|
||||
import com.wb.domainserver.response.ApiResponse;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@EnableConfigurationProperties(value = PaginationProperties.class)
|
||||
public class SampleController {
|
||||
|
||||
@Autowired
|
||||
private SampleService service;
|
||||
|
||||
@Autowired
|
||||
private SureService sureService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private BOMaComncdService bomaComncdService;
|
||||
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
@Autowired
|
||||
private PaginationProperties paginationProperties;
|
||||
|
||||
|
||||
/**
|
||||
* 멀티 데이터베이스 설정
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value = "/sample/selectMultyDatabase")
|
||||
public ResponseEntity<?> selectMultyDatabase(@RequestBody BOBbsVO vo) {
|
||||
|
||||
DataMap content = new DataMap();
|
||||
String gconeCount = service.selectGconeDatabase(vo);
|
||||
String sureCount = sureService.selectSureDatabase(vo);
|
||||
|
||||
content.put("sureCount", sureCount);
|
||||
content.put("gconeCount", gconeCount);
|
||||
return ApiResponse.of(content).ifPresentOrElse(HttpStatus.OK, HttpStatus.NOT_FOUND);
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/loginCheck")
|
||||
public ResponseEntity<?> selectMultyDatabase(@RequestParam("userName") String userName, @RequestParam("password") String password) {
|
||||
|
||||
// 처리 로직 (예: 데이터베이스 조회)
|
||||
// 여기서는 예시로 데이터베이스 조회 결과 대신 임의의 응답 데이터를 설정합니다.
|
||||
Map<String, Object> responseBody = new HashMap<>();
|
||||
responseBody.put("result", "SUCCESS"); // 결과 상태
|
||||
responseBody.put("useYn", "Y"); // 임의의 값
|
||||
|
||||
responseBody.put("userName", userName); // 임의의 값
|
||||
responseBody.put("password", password); // 임의의 값
|
||||
|
||||
// 성공 응답 반환
|
||||
return ResponseEntity.ok(responseBody);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.wb.domainserver.domain.sample.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.wb.domainserver.domain.sample.vo.SampleVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.MultiValueMapConverter;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* 해당 클래스에 대한 설명을 입력하세요.
|
||||
* @author 개발자 성명을 입력해주세요.
|
||||
* @since 2023-11-20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* == (Modification Information) == 개정이력
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2023-11-20 개발자명을 입력하세요. 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class SampleRestController {
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
private final MessageSource messageSource;
|
||||
private final SendToResrc sendToResrc;
|
||||
|
||||
public SampleRestController(MessageSource messageSource, SendToResrc sendToResrc){
|
||||
this.messageSource = messageSource;
|
||||
this.sendToResrc = sendToResrc;
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@GetMapping("/domainTest")
|
||||
public ResponseEntity<WnbtResponse> domainTest() {
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofGet(RESRC.GCONEBO, "/messages/list"),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@GetMapping("/domainTest1")
|
||||
public ResponseEntity<WnbtResponse> domainTest1(@RequestParam("param") String param) {
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("param", param);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofGetWithParam(RESRC.GCONEBO, "/messages/list1", paramMap),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@GetMapping("/domainTest2")
|
||||
public ResponseEntity<WnbtResponse> domainTest2() {
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("param", "파라미터테스트");
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofGetWithParam(RESRC.GCONEBO, "/messages/list2", param),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@PostMapping("/domainTest3")
|
||||
public ResponseEntity<WnbtResponse> domainTest3(@ModelAttribute SampleVO vo) {
|
||||
|
||||
MultiValueMap<String, Object> param = MultiValueMapConverter.convert(new ObjectMapper(), vo);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/messages/list3", param),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@GetMapping("/errorTest")
|
||||
public String errorTest(){
|
||||
throw new WnbtRestException("ERROR-CODE", messageSource.getMessage("error.internal-server", null, LocaleContextHolder.getLocale()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.wb.domainserver.domain.sample.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.vo.BOBbsVO;
|
||||
import com.wb.domainserver.domain.gcone.goods.banner.vo.BOBannerVO;
|
||||
import com.wb.domainserver.domain.sample.vo.SampleVO;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
|
||||
@Mapper
|
||||
public interface SampleMapper {
|
||||
|
||||
public Integer selectSampleListTotCnt(SampleVO vo);
|
||||
public List<DataMap> selectSampleList(SampleVO vo);
|
||||
|
||||
|
||||
String domainTest();
|
||||
|
||||
int authCheck(Map<String, Object> dataMap);
|
||||
|
||||
public int insertGconeCheck(SampleVO vo);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.wb.domainserver.domain.sample.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.wb.domainserver.domain.gcone.bbs.bbs.vo.BOBbsVO;
|
||||
import com.wb.domainserver.domain.sample.mapper.SampleMapper;
|
||||
import com.wb.domainserver.domain.sample.vo.SampleVO;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SampleService {
|
||||
|
||||
@Autowired
|
||||
private SampleMapper sampleMapper;
|
||||
|
||||
public String selectGconeDatabase(BOBbsVO vo) {
|
||||
|
||||
try {
|
||||
SampleVO vo1 = new SampleVO();
|
||||
vo1.setMessage1("1");;
|
||||
vo1.setMessage2("테스트1");;
|
||||
int gconeCount = sampleMapper.insertGconeCheck(vo1);
|
||||
String result = "gconeCount:"+gconeCount;
|
||||
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("Transaction failed: ", e);
|
||||
throw e; // 트랜잭션 롤백을 위해 예외를 다시 던집니다.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.wb.domainserver.domain.sample.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PrevewVO {
|
||||
|
||||
private Integer mainSetupInnb;
|
||||
|
||||
private Integer mainSiteInnb;
|
||||
|
||||
private String sessionId;
|
||||
|
||||
private String[] cookieValArr;
|
||||
|
||||
/*접속환경*/
|
||||
private String env;
|
||||
|
||||
/*이벤트 페이지 여부*/
|
||||
private String evtPageAt;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.wb.domainserver.domain.sample.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SampleVO extends AbstractVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String message1;
|
||||
private String message2;
|
||||
private String message3;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user