@PostMapping(value="/addOne.action")
@ApiOperation("添加一个")
@ApiImplicitParams({ })
public ResponseVo<String> addOne(Title title, @RequestParam("话题图片") MultipartFile mfile, HttpServletRequest req)throws Exception{
//获取/file的路径
String path=req.getServletContext().getRealPath("/imgs");//获取imgs的位置
File muDiFile=new File(path,"tphoto_"+System.currentTimeMillis()+"_"+mfile.getOriginalFilename());//目的
mfile.transferTo(muDiFile);
title.setTphoto(muDiFile.getName());
//userBasic.setUid( (int) (Math.random() * 999));
int hang=service.addOne(title);
return new ResponseVo<>(200,null,"添加("+title.getTid()+")"+(hang>0?"成功!":"失败!"));
}
怎么实现时间像图片一样通过点击选择?
实现图片通过点击选择是因为MultipartFile吗?