fix : 관리자 구독서비스 수정
This commit is contained in:
@@ -5,6 +5,7 @@ import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import com.wb.domainserver.common.prop.PaginationProperties;
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.service.BOMaComncdService;
|
||||
import com.wb.domainserver.domain.admin.sys.comncd.vo.BOMaComncdVO;
|
||||
import com.wb.domainserver.domain.gcone.common.service.BOCommonService;
|
||||
import com.wb.domainserver.domain.gcone.goods.cmnuse.vo.BOCmnuseVO;
|
||||
import com.wb.domainserver.domain.gcone.goods.goods.vo.BOGoodsVO;
|
||||
import com.wb.domainserver.domain.gcone.goods.goodsinfo.vo.BOGoodsInfoVO;
|
||||
@@ -22,7 +23,10 @@ import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.communicate.ValidateResultConverter;
|
||||
import com.wb.domainserver.util.dataaccess.DataMap;
|
||||
import com.wb.domainserver.util.file.service.FileStorageService;
|
||||
import com.wb.domainserver.util.file.vo.FileVo;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -35,6 +39,7 @@ import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -70,10 +75,15 @@ public class SubsvcController {
|
||||
/** 공통 메시지 처리를 위한 메시지 객체 */
|
||||
@Autowired
|
||||
private GconeMessageSource gconeMessageSource;
|
||||
/** 파일 업로드 */
|
||||
@Autowired
|
||||
private FileStorageService filestore;
|
||||
|
||||
@Autowired
|
||||
private BOSubsvcService service;
|
||||
@Autowired
|
||||
private BOCommonService commonService;
|
||||
@Autowired
|
||||
private BOMaComncdService boMaComncdService;
|
||||
@Autowired
|
||||
private PaginationProperties paginationProperties;
|
||||
@@ -155,6 +165,55 @@ public class SubsvcController {
|
||||
return "mngr/goods/subsvc/SubsvcU";
|
||||
}
|
||||
|
||||
/**
|
||||
* 상품 수정(상품이미지)
|
||||
* @param vo
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/updateSubsvc", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> updateSubsvc(BOSubsvcVO vo, HttpServletRequest request, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
vo.setUpdusr(user.getUserInnb());
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
//파일 업로드 관련 START
|
||||
List<HashMap<String, Object>> uploadFileMap = new ArrayList<HashMap<String, Object>>();
|
||||
|
||||
request.setAttribute("shopCd", vo.getSopmalCd());
|
||||
request.setAttribute("pathGubun", "GDIG"); //이미지구분코드 - 상품
|
||||
|
||||
try {
|
||||
/*파일 업로드 후 경로 추출하여 vo에 셋팅*/
|
||||
uploadFileMap = filestore.fileUpload(request);
|
||||
if(uploadFileMap.size() == 1){
|
||||
FileVo thumbNail = (FileVo) uploadFileMap.get(0).get("thumbNail");
|
||||
vo.setImg(thumbNail.getFilePath() + File.separator + thumbNail.getFileName());
|
||||
}
|
||||
} catch (WnbtRestException wre) {
|
||||
log.error(wre.getMessage(), wre);
|
||||
throw new WnbtRestException("파일 업로드에 실패했습니다." + wre.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new WnbtRestException("파일 업로드에 실패했습니다." + e.getMessage());
|
||||
}
|
||||
//파일 업로드 관련 END
|
||||
|
||||
Map<String, Object> message = new HashMap<>();
|
||||
String result = service.updateBOMngrSubsvc(vo);
|
||||
message.put("message",result);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(message))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스 목록 조회 리스트
|
||||
* @param vo
|
||||
|
||||
Reference in New Issue
Block a user