浏览代码

规划成果包上传

zhaoxiaolin 5 月之前
父节点
当前提交
4542df6630

+ 32 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/controller/ResultsController.java

@@ -0,0 +1,32 @@
+package com.onemap.api.controller;
+
+
+import com.onemap.api.domain.CghjQxcgsbrwIoDto;
+import com.onemap.api.service.ResultsService;
+import com.onemap.common.core.web.controller.BaseController;
+import com.onemap.common.core.web.domain.RequestResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 智慧选址接口
+ *
+ * @author onemap
+ */
+@RequestMapping("/open/results/md5")
+@RestController
+public class ResultsController extends BaseController {
+    @Autowired
+    private ResultsService ResultsService;
+
+    @PostMapping("/md5")
+    public RequestResult md5(@RequestBody CghjQxcgsbrwIoDto cghjQxcgsbrwIoDto, HttpServletRequest request) {
+        return ResultsService.md5(cghjQxcgsbrwIoDto, request);
+    }
+
+}

+ 29 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/CghjQxcgsbrwIoDto.java

@@ -0,0 +1,29 @@
+package com.onemap.api.domain;
+
+public class CghjQxcgsbrwIoDto {
+
+    private String md5;
+    private int size;
+    private boolean New=false;
+
+    private String appid;
+    private String ghlx;
+
+    public String getMd5() {return md5;}
+    public void setMd5(String md5) {this.md5 = md5;}
+
+    public int getSize() {return size;}
+    public void setSize(int size) {this.size = size;}
+
+    public boolean getNew() {return New;}
+    public void setNew() {this.New = New;}
+
+    public String getAppid() {
+        return appid;
+    }
+    public void setAppid(String appid) {
+        this.appid = appid;
+    }
+    public String getGhlx() {return ghlx;}
+    public void setGhlx(String ghlx) {this.ghlx = ghlx;}
+}

+ 11 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/service/ResultsService.java

@@ -0,0 +1,11 @@
+package com.onemap.api.service;
+
+import com.onemap.api.domain.CghjQxcgsbrwIoDto;
+import com.onemap.common.core.web.domain.RequestResult;
+
+import javax.servlet.http.HttpServletRequest;
+
+public interface ResultsService {
+
+    RequestResult md5(CghjQxcgsbrwIoDto cghjQxcgsbrwIoDto, HttpServletRequest request);
+}

+ 47 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ResultsServiceImpl.java

@@ -0,0 +1,47 @@
+package com.onemap.api.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.onemap.api.domain.CghjQxcgsbrwIoDto;
+import com.onemap.api.domain.AuthorizeDto;
+import com.onemap.api.domain.TSysOpenUser;
+import com.onemap.api.mapper.TSysOpenUserMapper;
+import com.onemap.api.service.ResultsService;
+import com.onemap.common.core.constant.SecurityConstants;
+import com.onemap.common.core.domain.R;
+import com.onemap.common.core.utils.StringUtils;
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.common.security.service.TokenService;
+import com.onemap.system.api.RemoteUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+
+@Service
+public class ResultsServiceImpl implements ResultsService {
+
+    @Autowired
+    private TSysOpenUserMapper tSysOpenUserMapper;
+    @Autowired
+    private RemoteUserService remoteUserService;
+    @Autowired
+    private TokenService tokenService;
+
+    @Override
+    public RequestResult md5(CghjQxcgsbrwIoDto cghjQxcgsbrwIoDto, HttpServletRequest request) {
+        String appid = cghjQxcgsbrwIoDto.getAppid();
+
+
+        if (cghjQxcgsbrwIoDto.getMd5() == null || cghjQxcgsbrwIoDto.getMd5().isEmpty()){
+            return RequestResult.error("文件MD5参数不能为空");
+        }
+
+        if (cghjQxcgsbrwIoDto.getGhlx() == null || cghjQxcgsbrwIoDto.getGhlx().isEmpty()){
+            cghjQxcgsbrwIoDto.setGhlx("总体规划");
+        }
+
+        return RequestResult.success("");
+    }
+}