초기소스
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.wb.domainserver.domain.comm.vo;
|
||||
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
|
||||
@Data
|
||||
public abstract class AbstractVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 사용여부 */
|
||||
private String useAt;
|
||||
/** 등록자 */
|
||||
private int regusr;
|
||||
/** 등록일시 */
|
||||
private Date registDt;
|
||||
/** 등록일자 */
|
||||
private String registDe;
|
||||
/** 수정자 */
|
||||
private int updusr;
|
||||
/** 수정일시 */
|
||||
private Date updtDt;
|
||||
/** 수정일자 */
|
||||
private String updtDe;
|
||||
/** 현재페이지 */
|
||||
private int pageIndex = 1;
|
||||
/** 페이지갯수 */
|
||||
private int pageUnit = 10;
|
||||
/** 페이지사이즈 */
|
||||
private int pageSize = 10;
|
||||
/** 첫페이지 인덱스 */
|
||||
private int firstIndex = 1;
|
||||
/** 마지막페이지 인덱스 */
|
||||
private int lastIndex = 1;
|
||||
/** 페이지당 레코드 개수 */
|
||||
private int recordCountPerPage = 10;
|
||||
/** pagination객체 */
|
||||
private PaginationInfo paginationInfo;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.wb.domainserver.domain.comm.vo;
|
||||
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
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.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 공통화면 처리를 위한 Controller
|
||||
* @author 김혜인
|
||||
* @since 2024-05-02
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* == (Modification Information) == 개정이력
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2024-05-02 김혜인. 최초 생성 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
// @Controller
|
||||
@RequestMapping("/comm")
|
||||
public class CommonController {
|
||||
// @Autowired
|
||||
private FileMngUtil fileMngUtil;
|
||||
|
||||
@Value("${sopmalfo.common.fileupload.uploaddirs.goods}")
|
||||
private String uploadFilePath;
|
||||
|
||||
@Value("${sopmalfo.common.fileupload.extensions.images}")
|
||||
private String whiteListFileUploadExtensions;
|
||||
|
||||
/**
|
||||
* CK에디터로 업로드된 이미지 파일 처리
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/ckeditor/image/fileUpload")
|
||||
public ResponseEntity<?> fileUpload(HttpServletRequest request) {
|
||||
Map<String, List<Map<String, Object>>> ulpladFileMap = new HashMap<>();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
MultipartHttpServletRequest mptRequest = WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class);
|
||||
//TODO : 에디터 이미지 경로 확정 후 수정
|
||||
if (mptRequest != null) {
|
||||
MultiValueMap<String, MultipartFile> files = mptRequest.getMultiFileMap();
|
||||
|
||||
Iterator<String> fInputs = files.keySet().iterator();
|
||||
while (fInputs.hasNext()) {
|
||||
String key = fInputs.next();
|
||||
ulpladFileMap.put(key, fileMngUtil.parseFileInf(files.get(key), "test", uploadFilePath, whiteListFileUploadExtensions));
|
||||
}
|
||||
}
|
||||
if(ulpladFileMap.get("upload") != null
|
||||
&& !ulpladFileMap.get("upload").isEmpty()) {
|
||||
resultMap.put("uploaded", true);
|
||||
resultMap.put("url", "/comm/ckeditor/image/fileView?item01="+ulpladFileMap.get("upload").get(0).get("streFileNm"));
|
||||
} else {
|
||||
resultMap.put("uploaded", false);
|
||||
resultMap.put("url", "");
|
||||
}
|
||||
return ResponseEntity.status(HttpStatus.OK).body(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* CK에디터로 업로드된 이미지 view 처리
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/ckeditor/image/fileView")
|
||||
public void fileUpload(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
String item01 = request.getParameter("item01");
|
||||
try {
|
||||
if(!StringUtil.isEmpty(item01)) {
|
||||
//TODO : 에디터 이미지 경로 확정 후 수정
|
||||
fileMngUtil.viewFile(response, uploadFilePath, item01, "", null);
|
||||
}
|
||||
|
||||
} catch (WnbtRestException wre){
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch(Exception e) {
|
||||
log.error("에디터 업로드 이미지 조회 중 오류가 발생하였습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
63
src/main/java/com/wb/domainserver/domain/comm/vo/MenuVO.java
Normal file
63
src/main/java/com/wb/domainserver/domain/comm/vo/MenuVO.java
Normal file
@@ -0,0 +1,63 @@
|
||||
package com.wb.domainserver.domain.comm.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MenuVO extends AbstractVO {
|
||||
|
||||
/** 메뉴코드*/
|
||||
private String menuCd;
|
||||
/** 상위 메뉴코드*/
|
||||
private String upperMenuCd;
|
||||
/** 메뉴명*/
|
||||
@NotEmpty(message = "메뉴명")
|
||||
private String menuNm;
|
||||
/** 메뉴DETPH*/
|
||||
private String menuDepth;
|
||||
/** LEVEL*/
|
||||
@NotEmpty(message = "순서")
|
||||
private String sortOrdr;
|
||||
/** 최상단메뉴코드*/
|
||||
private String upmostMenuCd;
|
||||
/** 메뉴설명*/
|
||||
private String menuDc;
|
||||
/** 노출,미노출,기간노출*/
|
||||
private String expsrCd;
|
||||
/** 노출시작일시*/
|
||||
private String expsrBgnDt;
|
||||
/** 노출종료일시*/
|
||||
private String expsrEndDt;
|
||||
/** ++ 추가 접근권한 */
|
||||
private String authorDv;
|
||||
/** 쇼핑몰 코드 */
|
||||
private String sopmalCd;
|
||||
/** 카테고리 코드 */
|
||||
private String ctgry;
|
||||
/** 최상단메뉴코드 */
|
||||
private String topMenuCd;
|
||||
|
||||
private String nextDeptCd1;
|
||||
private String nextDeptCd2;
|
||||
private String nextDepth2;
|
||||
private String nextDepth3;
|
||||
|
||||
/** fm_auth_fnct_menu(mapping table) */
|
||||
private String url;
|
||||
|
||||
private String ty;
|
||||
private String ctgryId;
|
||||
private String upperCtgryId;
|
||||
private String ctgryNm;
|
||||
private String ctgryDepth;
|
||||
private String menuExpsrAt;
|
||||
private String gnbExpsrAt;
|
||||
private String bbsId;
|
||||
private String menuChrColor;
|
||||
private String originalHost;
|
||||
/*접속환경구분*/
|
||||
private String env;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user