Commit f9e51c78 by 钱炳权

增加接口错误提示

parent 3f6bd303
......@@ -2,6 +2,7 @@ package com.example.fuzzControll.controller;
import com.example.fuzzControll.pojo.vo.AjaxResult;
import com.example.fuzzControll.service.SeedFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -14,6 +15,7 @@ import java.util.List;
/**
* aflnet种子文件
*/
@Slf4j
@RestController
@RequestMapping("/seedFile")
public class SeedFileController {
......@@ -30,6 +32,7 @@ public class SeedFileController {
try {
files = service.getSeedFiles();
} catch (Exception e) {
log.error(e.toString());
return AjaxResult.error("种子文件获取失败!");
}
return AjaxResult.success(files);
......@@ -43,6 +46,7 @@ public class SeedFileController {
try {
service.delFile(fileName);
} catch (Exception e) {
log.error(e.toString());
return AjaxResult.error("种子文件删除失败!");
}
return AjaxResult.success("种子文件删除成功!");
......@@ -55,6 +59,7 @@ public class SeedFileController {
try {
service.upload(file);
} catch (Exception e) {
log.error(e.toString());
return AjaxResult.error("种子文件upload失败!");
}
return AjaxResult.success("种子文件upload成功!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment