|
@@ -6,6 +6,8 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.zglc.fm.base.Result;
|
|
|
import com.zglc.fm.entity.DeleteEntity;
|
|
|
import com.zglc.fm.entity.BookEntity;
|
|
|
+import com.zglc.fm.entity.FaultEntity;
|
|
|
+import com.zglc.fm.service.FaultService;
|
|
|
import com.zglc.fm.service.BookService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -31,9 +33,12 @@ public class BookController {
|
|
|
|
|
|
@Resource
|
|
|
private final BookService bookService;
|
|
|
+ private FaultService faultService;
|
|
|
@Autowired(required = false)
|
|
|
- public BookController(BookService bookService){
|
|
|
+
|
|
|
+ public BookController(BookService bookService, FaultService faultService){
|
|
|
this.bookService = bookService;
|
|
|
+ this.faultService = faultService;
|
|
|
}
|
|
|
|
|
|
@Value("${spring.article.sourcePath}")
|
|
@@ -91,15 +96,6 @@ public class BookController {
|
|
|
return Result.success(bookService.listAll());
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation("按书籍类型id列出所有")
|
|
|
-// @ApiResponses({
|
|
|
-// @ApiResponse(code = 0, message = "成功")
|
|
|
-// })
|
|
|
-// @GetMapping("listByType")
|
|
|
-// public Result<List<BookEntity>> listBy(Integer typeId) {
|
|
|
-// return Result.success(userService.searchAllUser(departmentId,roleId,null,null));
|
|
|
-// }
|
|
|
-
|
|
|
@ApiOperation("分页按书籍类型id筛选")
|
|
|
@ApiResponses({
|
|
|
@ApiResponse(code = 0, message = "成功")
|
|
@@ -110,9 +106,15 @@ public class BookController {
|
|
|
return Result.success(new PageInfo<>( bookService.searchAllBook(typeId,name)));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ @ApiOperation("筛选相关故障案例")
|
|
|
+ @ApiResponses({
|
|
|
+ @ApiResponse(code = 0, message = "成功")
|
|
|
+ })
|
|
|
+ @GetMapping("relevantFault")
|
|
|
+ public Result<PageInfo<FaultEntity>> relevantFault(String bookName,Integer page, Integer size) {
|
|
|
+ PageHelper.startPage(page, size, "id desc");
|
|
|
+ return Result.success(new PageInfo<>( faultService.searchAllFault(bookName)));
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation("ID查找")
|
|
|
@ApiResponses({
|