|
|
@@ -7,6 +7,7 @@ import com.zhongshu.card.client.model.school.*;
|
|
|
import com.zhongshu.card.client.ret.ResultContent;
|
|
|
import com.zhongshu.card.client.service.school.BookInfoService;
|
|
|
import com.zhongshu.card.client.service.school.NoticeInfoService;
|
|
|
+import com.zhongshu.card.client.utils.type.OrganizationUserType;
|
|
|
import com.zhongshu.card.server.core.service.org.RoleServiceImpl;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
@@ -41,55 +42,67 @@ public class BookInfoController {
|
|
|
BookInfoService bookInfoService;
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "添加-编辑公告", description = "添加-编辑公告")
|
|
|
- @RequestMapping(value = "addNoticeInfo", method = {RequestMethod.POST})
|
|
|
- public ResultContent addNoticeInfo(@RequestBody NoticeInfoAddParam param) {
|
|
|
- return this.noticeInfoService.addNoticeInfo(param);
|
|
|
+ @Operation(summary = "添加-编辑教师", description = "添加-编辑教师")
|
|
|
+ @RequestMapping(value = "addTeacher", method = {RequestMethod.POST})
|
|
|
+ public ResultContent addTeacher(@RequestBody BookInfoAddParam param) {
|
|
|
+ param.setUserType(OrganizationUserType.Teacher);
|
|
|
+ return this.bookInfoService.addBookInfo(param);
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "删除公告", description = "删除公告")
|
|
|
- @RequestMapping(value = "deleteNoticeInfo", method = {RequestMethod.POST})
|
|
|
- public ResultContent deleteNoticeInfo(@RequestBody IDParam param) {
|
|
|
- return this.noticeInfoService.deleteNoticeInfo(param.getId());
|
|
|
+ @Operation(summary = "添加-编辑学生", description = "添加-编辑学生")
|
|
|
+ @RequestMapping(value = "addStudent", method = {RequestMethod.POST})
|
|
|
+ public ResultContent addStudent(@RequestBody BookInfoAddParam param) {
|
|
|
+ param.setUserType(OrganizationUserType.Student);
|
|
|
+ return this.bookInfoService.addBookInfo(param);
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "置顶公告", description = "置顶公告")
|
|
|
- @RequestMapping(value = "topping", method = {RequestMethod.POST})
|
|
|
- public ResultContent topping(@RequestBody IDParam param) {
|
|
|
- return this.noticeInfoService.topping(param.getId());
|
|
|
+ @Operation(summary = "删除教师", description = "删除学生")
|
|
|
+ @RequestMapping(value = "deleteTeacher", method = {RequestMethod.POST})
|
|
|
+ public ResultContent deleteTeacher(@RequestBody IDParam param) {
|
|
|
+ return this.bookInfoService.deleteById(param.getId());
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "公告详情", description = "公告详情")
|
|
|
- @RequestMapping(value = "getDetail", method = {RequestMethod.POST})
|
|
|
- public ResultContent<NoticeInfoModel> getDetail(@RequestBody IDParam param) {
|
|
|
- return this.noticeInfoService.getDetail(param.getId());
|
|
|
+ @Operation(summary = "删除学生", description = "删除学生")
|
|
|
+ @RequestMapping(value = "deleteStudent", method = {RequestMethod.POST})
|
|
|
+ public ResultContent deleteStudent(@RequestBody IDParam param) {
|
|
|
+ return this.bookInfoService.deleteById(param.getId());
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "公告增加阅读量", description = "公告增加阅读量")
|
|
|
- @RequestMapping(value = "addView", method = {RequestMethod.POST})
|
|
|
- public ResultContent addView(@RequestBody IDParam param) {
|
|
|
- return this.noticeInfoService.addView(param.getId());
|
|
|
+ @Operation(summary = "教师详情", description = "教师详情")
|
|
|
+ @RequestMapping(value = "getTeacherDetail", method = {RequestMethod.POST})
|
|
|
+ public ResultContent<BookInfoModel> getTeacherDetail(@RequestBody IDParam param) {
|
|
|
+ return this.bookInfoService.getByDetailById(param.getId());
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "公告列表-分页查询", description = "公告列表-分页查询")
|
|
|
- @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
|
|
|
- public ResultContent<Page<NoticeInfoModel>> page(
|
|
|
+ @Operation(summary = "学生详情", description = "学生详情")
|
|
|
+ @RequestMapping(value = "getStudentDetail", method = {RequestMethod.POST})
|
|
|
+ public ResultContent<BookInfoModel> getStudentDetail(@RequestBody IDParam param) {
|
|
|
+ return this.bookInfoService.getByDetailById(param.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "教师列表-分页查询", description = "教师列表-分页查询")
|
|
|
+ @RequestMapping(value = {"pageTeacher"}, method = {RequestMethod.POST})
|
|
|
+ public ResultContent<Page<BookInfoModel>> pageTeacher(
|
|
|
@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
- @Parameter(required = false) NoticeInfoSearchParam param) {
|
|
|
- return noticeInfoService.page(param, pageable);
|
|
|
+ @Parameter(required = false) BookInfoSearch param) {
|
|
|
+ param.setUserType(OrganizationUserType.Teacher);
|
|
|
+ return bookInfoService.page(param, pageable);
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "公告阅读量列表-分页查询", description = "公告阅读量-分页查询")
|
|
|
- @RequestMapping(value = {"pageView"}, method = {RequestMethod.POST})
|
|
|
- public ResultContent<Page<NoticeInfoViewModel>> pageView(
|
|
|
+ @Operation(summary = "学生列表-分页查询", description = "学生列表-分页查询")
|
|
|
+ @RequestMapping(value = {"pageStudent"}, method = {RequestMethod.POST})
|
|
|
+ public ResultContent<Page<BookInfoModel>> pageStudent(
|
|
|
@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
- @Parameter(required = false) NoticeInfoViewSearch param) {
|
|
|
- return noticeInfoService.pageView(param, pageable);
|
|
|
+ @Parameter(required = false) BookInfoSearch param) {
|
|
|
+ param.setUserType(OrganizationUserType.Student);
|
|
|
+ return bookInfoService.page(param, pageable);
|
|
|
}
|
|
|
+
|
|
|
}
|