MCPcopy Create free account
hub / github.com/Hello-hao/Tbed / ClientController

Class ClientController

src/main/java/cn/hellohao/controller/ClientController.java:17–44  ·  view source on GitHub ↗

@author Hellohao @version 1.0 @date 2019-07-18 17:22

Source from the content-addressed store, hash-verified

15 * @date 2019-07-18 17:22
16 */
17@RestController
18@RequestMapping("/api")
19public class ClientController {
20
21 @Autowired private ClientService clientService;
22
23 @PostMapping(value = "/uploadbymail")
24 @ResponseBody
25 public Msg uploadbymail(
26 HttpServletRequest request,
27 @RequestParam(value = "file") MultipartFile file,
28 @RequestParam(value = "mail", defaultValue = "") String mail,
29 @RequestParam(value = "pass", defaultValue = "") String pass,
30 @RequestParam(value = "days", defaultValue = "0") String days) {
31 if (file == null
32 || StringUtils.isBlank(mail)
33 || StringUtils.isBlank(pass)) {
34 Msg msg = new Msg();
35 msg.setCode("400");
36 msg.setInfo("相关参数不能为空");
37 return msg;
38 }
39 Msg resultBean =
40 clientService.uploadImg(
41 request, file, mail, pass, Integer.valueOf(days.toString()));
42 return resultBean;
43 }
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected