|
@ -27,13 +27,13 @@ import javax.validation.Valid; |
|
|
@RestController |
|
|
@RestController |
|
|
public class FileController { |
|
|
public class FileController { |
|
|
@MustLogin |
|
|
@MustLogin |
|
|
@ApiOperation(value = "测评试题查询",notes = "测评试题查询") |
|
|
@ApiOperation(value = "文件上传",notes = "文件上传") |
|
|
@ApiImplicitParams({ |
|
|
@ApiImplicitParams({ |
|
|
@ApiImplicitParam(name = "json", value = "测评试题查询信息", required = true) |
|
|
@ApiImplicitParam(name = "json", value = "文件上传", required = true) |
|
|
}) |
|
|
}) |
|
|
@RequestMapping(value="/saveFile", method = RequestMethod.POST) |
|
|
@RequestMapping(value="/saveFile", method = RequestMethod.POST) |
|
|
public JsonResponse<FileVo.Save> saveFile(@RequestBody @ApiParam @Valid QueryDto<FileDto.Save> queryDto) throws Exception { |
|
|
public JsonResponse<FileVo.Save> saveFile(@RequestBody @ApiParam @Valid QueryDto<FileDto.Save> queryDto) throws Exception { |
|
|
String path = Base64FileUtil.base64ToFile(queryDto.getParam().getBase64(), PropUtil.path, "/file/" + DateUtil.today() + "/"); |
|
|
String path = Base64FileUtil.base64ToFile(queryDto.getParam().getBase64(), PropUtil.path, "/file/" + DateUtil.today() + "/","jpg"); |
|
|
FileVo.Save save = new FileVo.Save(); |
|
|
FileVo.Save save = new FileVo.Save(); |
|
|
save.setPath(PropUtil.imgDomain + path); |
|
|
save.setPath(PropUtil.imgDomain + path); |
|
|
return JsonResponse.newInstance().ok(save); |
|
|
return JsonResponse.newInstance().ok(save); |
|
|