Przeglądaj źródła

앱 버전 체크 api 수정

junekeunsong 4 lat temu
rodzic
commit
c8d2b4062a

+ 5 - 5
src/main/java/com/lemon/lifecenter/controller/RestApiController.java

@@ -7,6 +7,7 @@ import java.util.Map;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -24,15 +25,15 @@ public class RestApiController {
     private RestApiService restApiService;
     
     @RequestMapping(value="/mobile/getAppVersion", method = RequestMethod.POST)
-    public ArrayList<HashMap<String, String>> appVersion(@RequestParam(value="deviceType", required=false, defaultValue="") String deviceType) {
-        ArrayList<HashMap<String, String>> result = new ArrayList<>();
+    public HashMap<String, String> appVersion(@RequestBody AppVersionDTO dto) {
         HashMap<String, String> data = new HashMap<String, String>();
         
         String code = "99";
+        String deviceType = dto.getDeviceType();
         if (deviceType.equals("")) {
             code = "01";
         } else {
-            AppVersionDTO dto = restApiService.selectAppVersion(deviceType);
+            dto = restApiService.selectAppVersion(deviceType);
             if (dto == null) {
                 code = "02";
             } else {
@@ -43,7 +44,6 @@ public class RestApiController {
             
         }
         data.put("code", code);
-        result.add(data);
-        return result;
+        return data;
     }
 }

+ 7 - 0
src/main/java/com/lemon/lifecenter/dto/AppVersionDTO.java

@@ -3,7 +3,14 @@ package com.lemon.lifecenter.dto;
 public class AppVersionDTO {
     private String version = "";
     private String downloadUrl = "";
+    private String deviceType = "";
     
+    public String getDeviceType() {
+        return deviceType;
+    }
+    public void setDeviceType(String deviceType) {
+        this.deviceType = deviceType;
+    }
     public String getVersion() {
         return version;
     }