|
|
@@ -1,51 +1,85 @@
|
|
|
-package org.jeecg.modules.api.hwversion;
|
|
|
-
|
|
|
-
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.jeecg.common.util.ErrorCode;
|
|
|
-import org.jeecg.modules.api.sys.BaseAppController;
|
|
|
-import org.jeecg.modules.hwversion.service.IHwVersionService;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-import org.springframework.web.servlet.ModelAndView;
|
|
|
-import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-@Slf4j
|
|
|
-@Api(tags = "app版本控制api")
|
|
|
-@RestController
|
|
|
-@RequestMapping("/api/hwVersion")
|
|
|
-public class HwVersionControllerAPI extends BaseAppController {
|
|
|
- @Resource
|
|
|
- private IHwVersionService hwVersionService;
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 检查app版本
|
|
|
- */
|
|
|
- @GetMapping(value = "/checkVersion")
|
|
|
- public ModelAndView getEnrollments(HttpServletRequest request, HttpServletResponse response) {
|
|
|
- Map<String, Object> returnMap = new HashMap<String, Object>();
|
|
|
- Map<String, String> requestMap = findRequestMap(request);
|
|
|
- Map<String, Object> obj = null;
|
|
|
- try {
|
|
|
- returnMap = hwVersionService.checkVersion(requestMap, request, response);
|
|
|
- obj = successResult(ErrorCode.code_1000, "获取版本信息成功", returnMap);
|
|
|
- } catch (Exception e) {
|
|
|
- System.out.println("Exception e:" + e);
|
|
|
- e.printStackTrace();
|
|
|
- obj = errorResult(ErrorCode.code_2006, "获取数据失败");
|
|
|
- logError(request, e.getMessage(), e);
|
|
|
- }
|
|
|
-
|
|
|
- ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
|
|
|
- return view;
|
|
|
- }
|
|
|
-}
|
|
|
+package org.jeecg.modules.api.hwversion;
|
|
|
+
|
|
|
+
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.jeecg.common.util.ErrorCode;
|
|
|
+import org.jeecg.modules.api.sys.BaseAppController;
|
|
|
+import org.jeecg.modules.hwversion.service.IHwVersionService;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
+import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Api(tags = "app版本控制api")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/hwVersion")
|
|
|
+public class HwVersionControllerAPI extends BaseAppController {
|
|
|
+ @Resource
|
|
|
+ private IHwVersionService hwVersionService;
|
|
|
+ @Value("${jeecg.taxRegistration.name}")
|
|
|
+ private String taxName;
|
|
|
+ @Value("${jeecg.taxRegistration.message}")
|
|
|
+ private String taxMessage;
|
|
|
+ @Value("${jeecg.taxRegistration.url}")
|
|
|
+ private String taxUrl;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 检查app版本
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/checkVersion")
|
|
|
+ public ModelAndView getEnrollments(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ Map<String, Object> returnMap = new HashMap<String, Object>();
|
|
|
+ Map<String, String> requestMap = findRequestMap(request);
|
|
|
+ Map<String, Object> obj = null;
|
|
|
+ try {
|
|
|
+ returnMap = hwVersionService.checkVersion(requestMap, request, response);
|
|
|
+ obj = successResult(ErrorCode.code_1000, "获取版本信息成功", returnMap);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("Exception e:" + e);
|
|
|
+ e.printStackTrace();
|
|
|
+ obj = errorResult(ErrorCode.code_2006, "获取数据失败");
|
|
|
+ logError(request, e.getMessage(), e);
|
|
|
+ }
|
|
|
+
|
|
|
+ ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
|
|
|
+ return view;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 税务登记入口信息
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/taxRegistration")
|
|
|
+ public ModelAndView getTaxRegistration(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ Map<String, Object> returnMap = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> obj = null;
|
|
|
+ try {
|
|
|
+ returnMap.put("taxName", taxName);
|
|
|
+ returnMap.put("taxMessage", taxMessage);
|
|
|
+ returnMap.put("taxUrl", taxUrl);
|
|
|
+ obj = successResult(ErrorCode.code_1000, "获取信息成功", returnMap);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("Exception e:" + e);
|
|
|
+ e.printStackTrace();
|
|
|
+ obj = errorResult(ErrorCode.code_2006, "获取数据失败");
|
|
|
+ logError(request, e.getMessage(), e);
|
|
|
+ }
|
|
|
+
|
|
|
+ ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
|
|
|
+ return view;
|
|
|
+ }
|
|
|
+}
|