5a1ed941 by xiaojie

【数据资产】

1、上传文件到obs
1 parent ec952258
...@@ -220,6 +220,15 @@ public class EnterpriseController { ...@@ -220,6 +220,15 @@ public class EnterpriseController {
220 return CommonRes.success(vo); 220 return CommonRes.success(vo);
221 } 221 }
222 222
223 @Autowired
224 private DataPortService dataPortService;
225
226 @PostMapping("/test")
227 public CommonRes test(@RequestBody EnterpriseRegisterRQVO enterpriseRegisterRQVO) {
228 dataPortService.test(enterpriseRegisterRQVO);
229 return CommonRes.success(true);
230 }
231
223 //endregion 232 //endregion
224 233
225 } 234 }
......
...@@ -42,4 +42,12 @@ public interface DaopCommonFeign { ...@@ -42,4 +42,12 @@ public interface DaopCommonFeign {
42 @RequestMapping(value = "/obs/upload-image",method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) 42 @RequestMapping(value = "/obs/upload-image",method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
43 CommonRes uploadImage(@RequestPart MultipartFile image); 43 CommonRes uploadImage(@RequestPart MultipartFile image);
44 44
45 /**
46 * 上传
47 * @param file
48 * @return
49 */
50 @RequestMapping(value = "/obs/upload-file",method = RequestMethod.POST)
51 CommonRes uploadFile(@RequestPart MultipartFile file);
52
45 } 53 }
......
...@@ -155,7 +155,7 @@ public class DataPortServiceImpl implements DataPortService { ...@@ -155,7 +155,7 @@ public class DataPortServiceImpl implements DataPortService {
155 } 155 }
156 } else { 156 } else {
157 MultipartFile image = new MockMultipartFile("测试.png", "测试,png", "application/octet-stream", resource.getByteArray()); 157 MultipartFile image = new MockMultipartFile("测试.png", "测试,png", "application/octet-stream", resource.getByteArray());
158 String url = (String) daopCommonFeign.uploadImage(image).getData(); 158 String url = (String) daopCommonFeign.uploadFile(image).getData();
159 log.info("======url======, {}", url); 159 log.info("======url======, {}", url);
160 System.out.println(url); 160 System.out.println(url);
161 } 161 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!