mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
:art:完善部分新功能
This commit is contained in:
@@ -500,8 +500,10 @@ public class AdminController {
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
String uuid = jsonObj.getString("uuid");
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
MyProgress myProgress =
|
||||
JSON.parseObject(iRedisService.getValue(uuid).toString(), MyProgress.class);
|
||||
MyProgress myProgress = null;
|
||||
try{
|
||||
myProgress = JSON.parseObject(iRedisService.getValue(uuid).toString(), MyProgress.class);
|
||||
}catch (Exception e){ }
|
||||
if (null == myProgress) {
|
||||
jsonObject.put("succ", myProgress.getDelSuccessCount());
|
||||
jsonObject.put("errorlist", new ArrayList<String>());
|
||||
|
||||
@@ -2,11 +2,9 @@ package cn.hellohao.controller;
|
||||
|
||||
import cn.hellohao.pojo.Msg;
|
||||
import cn.hellohao.service.impl.ClientService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -17,18 +15,30 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* @date 2019-07-18 17:22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class ClientController {
|
||||
|
||||
@Autowired
|
||||
private ClientService clientService;
|
||||
|
||||
@Autowired private ClientService clientService;
|
||||
|
||||
@PostMapping(value = "/uploadbymail")
|
||||
@ResponseBody
|
||||
public Msg uploadbymail(HttpServletRequest request, @RequestParam("file") MultipartFile file, String mail, String pass) {
|
||||
Msg resultBean = clientService.uploadImg(request, file, mail, pass);
|
||||
public Msg uploadbymail(
|
||||
HttpServletRequest request,
|
||||
@RequestParam(value = "file") MultipartFile file,
|
||||
@RequestParam(value = "mail", defaultValue = "") String mail,
|
||||
@RequestParam(value = "pass", defaultValue = "") String pass,
|
||||
@RequestParam(value = "days", defaultValue = "0") String days) {
|
||||
if (file == null
|
||||
|| StringUtils.isBlank(mail)
|
||||
|| StringUtils.isBlank(pass)) {
|
||||
Msg msg = new Msg();
|
||||
msg.setCode("400");
|
||||
msg.setInfo("相关参数不能为空");
|
||||
return msg;
|
||||
}
|
||||
Msg resultBean =
|
||||
clientService.uploadImg(
|
||||
request, file, mail, pass, Integer.valueOf(days.toString()));
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user