update 请求响应对象 与 分页对象 结构修改 适配接口文档配置

This commit is contained in:
疯狂的狮子li
2021-05-20 13:23:12 +08:00
parent db18050b86
commit 7076deb2b6
17 changed files with 496 additions and 495 deletions

View File

@@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@@ -88,10 +90,10 @@ public class CaptchaController {
code = captcha.getCode();
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
AjaxResult ajax = AjaxResult.success();
Map<String,Object> ajax = new HashMap<>();
ajax.put("uuid", uuid);
ajax.put("img", captcha.getImageBase64());
return ajax;
return AjaxResult.success(ajax);
}
private String getCodeResult(String capStr) {

View File

@@ -18,10 +18,12 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
/**
* 通用请求处理
*
*
* @author ruoyi
*/
@RestController
@@ -34,7 +36,7 @@ public class CommonController
/**
* 通用下载请求
*
*
* @param fileName 文件名称
* @param delete 是否删除
*/
@@ -77,10 +79,10 @@ public class CommonController
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
Map<String,Object> ajax = new HashMap<>();
ajax.put("fileName", fileName);
ajax.put("url", url);
return ajax;
return AjaxResult.success(ajax);
}
catch (Exception e)
{