|
|
@@ -0,0 +1,52 @@
|
|
|
+package com.lemon.lifecenter.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
+
|
|
|
+import com.lemon.lifecenter.common.LifeCenterController;
|
|
|
+import com.lemon.lifecenter.common.LifeCenterFunction;
|
|
|
+import com.lemon.lifecenter.dto.AppVersionDTO;
|
|
|
+import com.lemon.lifecenter.service.DeviceService;
|
|
|
+
|
|
|
+@Controller
|
|
|
+public class AppVersionController extends LifeCenterController {
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DeviceService deviceService;
|
|
|
+
|
|
|
+ @RequestMapping( "/app/version/edit" )
|
|
|
+ private ModelAndView edit() {
|
|
|
+ List<AppVersionDTO> versionList = deviceService.selectAppVersionAll();
|
|
|
+
|
|
|
+ ModelAndView mv = setMV( "/version/edit" );
|
|
|
+ mv.addObject( "versionList", versionList );
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
+ @RequestMapping( "/app/version/edit/update" )
|
|
|
+ private String editUpdate( @ModelAttribute("dto") AppVersionDTO dto, HttpServletResponse response ) {
|
|
|
+ AppVersionDTO appDTO = new AppVersionDTO();
|
|
|
+ appDTO.setDeviceType( dto.getDeviceType().split(",")[0] );
|
|
|
+ appDTO.setVersion( dto.getVersion().split(",")[0] );
|
|
|
+ appDTO.setDownloadUrl( dto.getDownloadUrl().split(",")[0] );
|
|
|
+ deviceService.updateAppVersion(appDTO);
|
|
|
+
|
|
|
+ appDTO = new AppVersionDTO();
|
|
|
+ appDTO.setDeviceType( dto.getDeviceType().split(",")[1] );
|
|
|
+ appDTO.setVersion( dto.getVersion().split(",")[1] );
|
|
|
+ appDTO.setDownloadUrl( dto.getDownloadUrl().split(",")[1] );
|
|
|
+ deviceService.updateAppVersion(appDTO);
|
|
|
+
|
|
|
+ LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '수정완료', callBack : function(){ location.href='/app/version/edit'; } });" );
|
|
|
+ return "/common/blank";
|
|
|
+ }
|
|
|
+}
|