|
@@ -3,6 +3,8 @@ package com.zswl.dataservicestarter.controller;
|
|
import com.github.javaparser.quality.NotNull;
|
|
import com.github.javaparser.quality.NotNull;
|
|
import com.zswl.dataservicestarter.service.UserService;
|
|
import com.zswl.dataservicestarter.service.UserService;
|
|
import com.zswl.dataservicestarter.utils.result.ResultContent;
|
|
import com.zswl.dataservicestarter.utils.result.ResultContent;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
import lombok.Cleanup;
|
|
import lombok.Cleanup;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -17,32 +19,36 @@ import java.io.InputStream;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
-/** */
|
|
|
|
|
|
+/**
|
|
|
|
+ *
|
|
|
|
+ */
|
|
@RequestMapping("/test")
|
|
@RequestMapping("/test")
|
|
@RestController
|
|
@RestController
|
|
@Validated
|
|
@Validated
|
|
public class TestController {
|
|
public class TestController {
|
|
|
|
|
|
- @Autowired UserService userService;
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ UserService userService;
|
|
|
|
|
|
- @RequestMapping(
|
|
|
|
- value = "test",
|
|
|
|
- method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
|
- public ResultContent test(String name) {
|
|
|
|
- Map map = new HashMap();
|
|
|
|
- map.put("obj", name);
|
|
|
|
- map.put("time", System.currentTimeMillis());
|
|
|
|
|
|
+ @ApiOperation(value = "测试方法", notes = "测试方法")
|
|
|
|
+ @RequestMapping(
|
|
|
|
+ value = "test",
|
|
|
|
+ method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
|
+ public ResultContent test(String name) {
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ map.put("obj", name);
|
|
|
|
+ map.put("time", System.currentTimeMillis());
|
|
|
|
|
|
- return userService.addUser(name);
|
|
|
|
- }
|
|
|
|
|
|
+ return userService.addUser(name);
|
|
|
|
+ }
|
|
|
|
|
|
- @RequestMapping(value = "uploadFileDelegate", method = RequestMethod.POST)
|
|
|
|
- @SneakyThrows
|
|
|
|
- public ResultContent uploadFileDelegate(
|
|
|
|
- @RequestParam(value = "file") @NotNull MultipartFile multipartFile,
|
|
|
|
- String path,
|
|
|
|
- String epId) {
|
|
|
|
- @Cleanup InputStream inputStream = multipartFile.getInputStream();
|
|
|
|
- return ResultContent.buildSuccess();
|
|
|
|
- }
|
|
|
|
|
|
+ @RequestMapping(value = "uploadFileDelegate", method = RequestMethod.POST)
|
|
|
|
+ @SneakyThrows
|
|
|
|
+ public ResultContent uploadFileDelegate(
|
|
|
|
+ @RequestParam(value = "file") @NotNull MultipartFile multipartFile,
|
|
|
|
+ String path,
|
|
|
|
+ String epId) {
|
|
|
|
+ @Cleanup InputStream inputStream = multipartFile.getInputStream();
|
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
|
+ }
|
|
}
|
|
}
|