Commit f9e51c78 by 钱炳权

增加接口错误提示

parent 3f6bd303
...@@ -2,6 +2,7 @@ package com.example.fuzzControll.controller; ...@@ -2,6 +2,7 @@ package com.example.fuzzControll.controller;
import com.example.fuzzControll.pojo.vo.AjaxResult; import com.example.fuzzControll.pojo.vo.AjaxResult;
import com.example.fuzzControll.service.SeedFileService; import com.example.fuzzControll.service.SeedFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -14,6 +15,7 @@ import java.util.List; ...@@ -14,6 +15,7 @@ import java.util.List;
/** /**
* aflnet种子文件 * aflnet种子文件
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("/seedFile") @RequestMapping("/seedFile")
public class SeedFileController { public class SeedFileController {
...@@ -30,6 +32,7 @@ public class SeedFileController { ...@@ -30,6 +32,7 @@ public class SeedFileController {
try { try {
files = service.getSeedFiles(); files = service.getSeedFiles();
} catch (Exception e) { } catch (Exception e) {
log.error(e.toString());
return AjaxResult.error("种子文件获取失败!"); return AjaxResult.error("种子文件获取失败!");
} }
return AjaxResult.success(files); return AjaxResult.success(files);
...@@ -43,6 +46,7 @@ public class SeedFileController { ...@@ -43,6 +46,7 @@ public class SeedFileController {
try { try {
service.delFile(fileName); service.delFile(fileName);
} catch (Exception e) { } catch (Exception e) {
log.error(e.toString());
return AjaxResult.error("种子文件删除失败!"); return AjaxResult.error("种子文件删除失败!");
} }
return AjaxResult.success("种子文件删除成功!"); return AjaxResult.success("种子文件删除成功!");
...@@ -55,6 +59,7 @@ public class SeedFileController { ...@@ -55,6 +59,7 @@ public class SeedFileController {
try { try {
service.upload(file); service.upload(file);
} catch (Exception e) { } catch (Exception e) {
log.error(e.toString());
return AjaxResult.error("种子文件upload失败!"); return AjaxResult.error("种子文件upload失败!");
} }
return AjaxResult.success("种子文件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