5a1ed941 by xiaojie

【数据资产】

1、上传文件到obs
1 parent ec952258
......@@ -220,6 +220,15 @@ public class EnterpriseController {
return CommonRes.success(vo);
}
@Autowired
private DataPortService dataPortService;
@PostMapping("/test")
public CommonRes test(@RequestBody EnterpriseRegisterRQVO enterpriseRegisterRQVO) {
dataPortService.test(enterpriseRegisterRQVO);
return CommonRes.success(true);
}
//endregion
}
......
......@@ -42,4 +42,12 @@ public interface DaopCommonFeign {
@RequestMapping(value = "/obs/upload-image",method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
CommonRes uploadImage(@RequestPart MultipartFile image);
/**
* 上传
* @param file
* @return
*/
@RequestMapping(value = "/obs/upload-file",method = RequestMethod.POST)
CommonRes uploadFile(@RequestPart MultipartFile file);
}
......
......@@ -155,7 +155,7 @@ public class DataPortServiceImpl implements DataPortService {
}
} else {
MultipartFile image = new MockMultipartFile("测试.png", "测试,png", "application/octet-stream", resource.getByteArray());
String url = (String) daopCommonFeign.uploadImage(image).getData();
String url = (String) daopCommonFeign.uploadFile(image).getData();
log.info("======url======, {}", url);
System.out.println(url);
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!