From 218346972dd9896b3f92cc455d1c96302e22e1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=81=E6=9D=80=E6=AD=BB=E4=BA=86=E7=9F=A5=E6=9B=B4?= =?UTF-8?q?=E9=B8=9F?= <1215577830@qq.com> Date: Wed, 30 Jun 2021 03:33:34 +0000 Subject: [PATCH 1/3] =?UTF-8?q?update=20README.md.=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e0822b1..59b4db0 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,48 @@ # 法治小程序后端模块 ## 练习模块 - ### 随机抽取练习题 - + + ### 练习题增删改查、批量增加 + +增删都需要附带增删选项表 + +#### 用户提交练习 + +使用数组封装练习题答案 [id : 答案, ...] + +遍历用户答案与数据库对比,练习答题详情写入数据库(高写入,可舍去) + +返回提交练习的全部数据,以及是否回答正确 + +还需要记录数据: + +- 用户的当前等级练习总题数,正确总题数,以此得出用户该等级练习的正确率 + +- 当前等级练习总题数,正确总题数 + +- 用户在该等级的练习时长,用户各个等级的练习时长加起来则为用户练习总时长 + +### 随机抽取练习题 + 用户要获取固定题型数量的题目 的 数组 - + - 查找practice_config表 数据,获取每个**题型的数量** - 从缓存中获取题目,如果缓存没有,则从数据库中获取保存到缓存,再从缓存中随机抽取对应题数 - - ### redis缓存题目策略 - + +#### redis缓存题目策略 + 通过查询等级、题型数据,获取全部题型,分别放到缓存set集合中 - + practice:gid:tid 命名方式存储 - + 如果没有则从数据库中使用tid 来查询相应题目放到缓存 - + ## 考试模块 ## 用户模块 ## 预约模块 ## 法治文档学习模块 ## 视频以及图片 ## 评价模块 -## 成长等级模块 - - - - - -# 延伸阅读 - +## 成长等级模块 \ No newline at end of file -- Gitee From aaf189080fb3227346dce2e55d13c6f8c4515948 Mon Sep 17 00:00:00 2001 From: taowu <3113644502@qq.com> Date: Tue, 6 Jul 2021 14:37:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=92=8C=E5=9C=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IntervalInfoController.java | 20 ++++++++++--------- .../controller/VisitContentController.java | 14 +++++++------ .../service/impl/IntervalInfoServiceImpl.java | 2 -- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java b/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java index da95783..db81160 100644 --- a/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java +++ b/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java @@ -7,9 +7,11 @@ import com.zgn.fazhi.result.Result; import com.zgn.fazhi.service.IntervalInfoService; import com.zgn.fazhi.service.VisitContentService; import io.swagger.annotations.ApiOperation; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.websocket.server.PathParam; /** @@ -28,28 +30,28 @@ public class IntervalInfoController { } @ApiOperation("根据Id获取时间段") - @GetMapping("/api/getIntervalInfoById") - public Result getById(Integer id){ + @GetMapping("/api/getIntervalInfoById/{id}") + public Result getById(@PathVariable Integer id){ return ResultFactory.buildSuccessResult(intervalInfoService.getIntervalInfoById(id)); } @ApiOperation("增加参观时间段") - @GetMapping("/api/addIntervalInfo") - public Result addVisit(IntervalInfo intervalInfo){ + @PostMapping("/api/addIntervalInfo") + public Result addVisit(@RequestBody IntervalInfo intervalInfo){ intervalInfoService.addIntervalInfo(intervalInfo); return ResultFactory.buildSuccessResult("增加时间段成功"); } @ApiOperation("删除参观时间段") - @GetMapping("/api/deleteIntervalInfo") - public Result deleteVisit(Integer id){ + @GetMapping("/api/deleteIntervalInfo/{id}") + public Result deleteVisit(@PathVariable Integer id){ intervalInfoService.deleteIntervalInfoById(id); return ResultFactory.buildSuccessResult("删除时间段成功"); } @ApiOperation("修改参观时间段") @GetMapping("/api/updateIntervalInfo") - public Result updateVisit(IntervalInfo intervalInfo){ + public Result updateVisit(@RequestBody IntervalInfo intervalInfo){ intervalInfoService.updateIntervalInfo(intervalInfo); return ResultFactory.buildSuccessResult("修改时间段成功"); } diff --git a/src/main/java/com/zgn/fazhi/controller/VisitContentController.java b/src/main/java/com/zgn/fazhi/controller/VisitContentController.java index 7d1dc7b..03e779e 100644 --- a/src/main/java/com/zgn/fazhi/controller/VisitContentController.java +++ b/src/main/java/com/zgn/fazhi/controller/VisitContentController.java @@ -7,6 +7,8 @@ import com.zgn.fazhi.service.VisitContentService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; /** @@ -26,28 +28,28 @@ public class VisitContentController { } @ApiOperation("根据Id获取参观地点") - @GetMapping("/api/getVisitContentById") - public Result getById(Integer id){ + @GetMapping("/api/getVisitContentById/{id}") + public Result getById(@PathVariable Integer id){ return ResultFactory.buildSuccessResult(visitContentService.getAllVisitContentById(id)); } @ApiOperation("增加参观地点") @GetMapping("/api/addVisitContent") - public Result addVisit(VisitContent visitContent){ + public Result addVisit(@RequestBody VisitContent visitContent){ visitContentService.addVisitContent(visitContent); return ResultFactory.buildSuccessResult("增加地点成功"); } @ApiOperation("删除参观地点") - @GetMapping("/api/deleteVisitContent") - public Result deleteVisit(Integer id){ + @GetMapping("/api/deleteVisitContent/{id}") + public Result deleteVisit(@PathVariable Integer id){ visitContentService.deleteVisitContentById(id); return ResultFactory.buildSuccessResult("删除地点成功"); } @ApiOperation("修改参观地点") @GetMapping("/api/updateVisitContent") - public Result updateVisit(VisitContent visitContent){ + public Result updateVisit(@RequestBody VisitContent visitContent){ visitContentService.updateVisitContent(visitContent); return ResultFactory.buildSuccessResult("修改地点成功"); } diff --git a/src/main/java/com/zgn/fazhi/service/impl/IntervalInfoServiceImpl.java b/src/main/java/com/zgn/fazhi/service/impl/IntervalInfoServiceImpl.java index f71e605..9a4b0bc 100644 --- a/src/main/java/com/zgn/fazhi/service/impl/IntervalInfoServiceImpl.java +++ b/src/main/java/com/zgn/fazhi/service/impl/IntervalInfoServiceImpl.java @@ -34,9 +34,7 @@ public class IntervalInfoServiceImpl extends ServiceImpl Date: Tue, 6 Jul 2021 19:04:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9B=BE=E7=89=87=E3=80=81=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E3=80=81=E6=96=87=E6=A1=A3=E5=88=86=E7=B1=BB=E5=92=8C?= =?UTF-8?q?=E7=BB=83=E4=B9=A0=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fazhi/controller/FileTypeController.java | 58 +++++++++++++++++++ .../zgn/fazhi/controller/GradeController.java | 58 +++++++++++++++++++ .../controller/IntervalInfoController.java | 2 +- .../controller/PictureTypeController.java | 57 ++++++++++++++++++ .../fazhi/controller/VideoTypeController.java | 56 ++++++++++++++++++ .../controller/VisitContentController.java | 9 +-- .../zgn/fazhi/service/FileTypeService.java | 33 +++++++++++ .../com/zgn/fazhi/service/GradeService.java | 25 ++++++++ .../fazhi/service/IntervalInfoService.java | 17 ++++-- .../zgn/fazhi/service/PictureTypeService.java | 30 ++++++++++ .../zgn/fazhi/service/VideoTypeService.java | 35 +++++++++++ .../fazhi/service/VisitContentService.java | 19 ++++-- .../service/impl/FileTypeServiceImpl.java | 33 +++++++++++ .../fazhi/service/impl/GradeServiceImpl.java | 23 +++++++- .../service/impl/PictureTypeServiceImpl.java | 28 +++++++++ .../service/impl/VideoTypeServiceImpl.java | 33 +++++++++++ src/main/resources/application-dev.properties | 4 +- 17 files changed, 500 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/zgn/fazhi/controller/FileTypeController.java create mode 100644 src/main/java/com/zgn/fazhi/controller/GradeController.java create mode 100644 src/main/java/com/zgn/fazhi/controller/PictureTypeController.java create mode 100644 src/main/java/com/zgn/fazhi/controller/VideoTypeController.java diff --git a/src/main/java/com/zgn/fazhi/controller/FileTypeController.java b/src/main/java/com/zgn/fazhi/controller/FileTypeController.java new file mode 100644 index 0000000..bd9f2cd --- /dev/null +++ b/src/main/java/com/zgn/fazhi/controller/FileTypeController.java @@ -0,0 +1,58 @@ +package com.zgn.fazhi.controller; + +import com.zgn.fazhi.factory.ResultFactory; +import com.zgn.fazhi.pojo.po.FileType; +import com.zgn.fazhi.pojo.po.IntervalInfo; +import com.zgn.fazhi.result.Result; +import com.zgn.fazhi.service.FileTypeService; +import com.zgn.fazhi.service.IntervalInfoService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 文档分类 + * @author wt + */ +@RestController +public class FileTypeController { + + @Autowired + FileTypeService fileTypeService; + + @ApiOperation("获取全部文档分类") + @GetMapping("/api/getAllFileType") + public Result getAll(){ + return ResultFactory.buildSuccessResult(fileTypeService.getAllFileType()); + } + + + @ApiOperation("根据Id获取文档分类") + @GetMapping("/api/getFileTypeById/{id}") + public Result getById(@PathVariable Integer id){ + return ResultFactory.buildSuccessResult(fileTypeService.getAllFileTypeById(id)); + } + + + @ApiOperation("增加文档分类") + @PostMapping("/api/addFileType") + public Result addFileType(@RequestBody FileType fileType){ + fileTypeService.addFileType(fileType); + return ResultFactory.buildSuccessResult("增加文档分类成功"); + } + + + @ApiOperation("删除文档分类") + @GetMapping("/api/deleteFileType/{id}") + public Result deleteFileType(@PathVariable Integer id){ + fileTypeService.deleteFileTypeById(id); + return ResultFactory.buildSuccessResult("删除文档分类成功"); + } + + @ApiOperation("修改文档分类") + @PostMapping("/api/updateFileType") + public Result updateFileType(@RequestBody FileType fileType){ + fileTypeService.updateFileType(fileType); + return ResultFactory.buildSuccessResult("修改文档分类成功"); + } +} diff --git a/src/main/java/com/zgn/fazhi/controller/GradeController.java b/src/main/java/com/zgn/fazhi/controller/GradeController.java new file mode 100644 index 0000000..eb8e51c --- /dev/null +++ b/src/main/java/com/zgn/fazhi/controller/GradeController.java @@ -0,0 +1,58 @@ +package com.zgn.fazhi.controller; + +import com.zgn.fazhi.factory.ResultFactory; +import com.zgn.fazhi.pojo.po.Grade; +import com.zgn.fazhi.pojo.po.VideoType; +import com.zgn.fazhi.result.Result; +import com.zgn.fazhi.service.GradeService; +import com.zgn.fazhi.service.VideoTypeService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 练习级别 + * @author wt + */ +@RestController +public class GradeController { + @Autowired + GradeService gradeService; + + @ApiOperation("获取全部练习级别") + @GetMapping("/api/getAllGrade") + public Result getAll(){ + return ResultFactory.buildSuccessResult(gradeService.getAllGrade()); + } + + + @ApiOperation("根据Id获取练习级别") + @GetMapping("/api/getGradeById/{id}") + public Result getById(@PathVariable Integer id){ + return ResultFactory.buildSuccessResult(gradeService.getAllGradeById(id)); + } + + + @ApiOperation("增加练习级别") + @PostMapping("/api/addGrade") + public Result addGrade(@RequestBody Grade grade){ + gradeService.addGrade(grade); + return ResultFactory.buildSuccessResult("增加视频分类成功"); + } + + + @ApiOperation("删除练习级别") + @GetMapping("/api/deleteGrade/{id}") + public Result deleteGrade(@PathVariable Integer id){ + gradeService.deleteGradeById(id); + return ResultFactory.buildSuccessResult("删除视频分类成功"); + } + + @ApiOperation("修改练习级别") + @PostMapping("/api/updateGrade") + public Result updateGrade(@RequestBody Grade grade){ + gradeService.updateGrade(grade); + return ResultFactory.buildSuccessResult("修改视频分类成功"); + } +} diff --git a/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java b/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java index db81160..13498a3 100644 --- a/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java +++ b/src/main/java/com/zgn/fazhi/controller/IntervalInfoController.java @@ -50,7 +50,7 @@ public class IntervalInfoController { } @ApiOperation("修改参观时间段") - @GetMapping("/api/updateIntervalInfo") + @PostMapping("/api/updateIntervalInfo") public Result updateVisit(@RequestBody IntervalInfo intervalInfo){ intervalInfoService.updateIntervalInfo(intervalInfo); return ResultFactory.buildSuccessResult("修改时间段成功"); diff --git a/src/main/java/com/zgn/fazhi/controller/PictureTypeController.java b/src/main/java/com/zgn/fazhi/controller/PictureTypeController.java new file mode 100644 index 0000000..d22fba2 --- /dev/null +++ b/src/main/java/com/zgn/fazhi/controller/PictureTypeController.java @@ -0,0 +1,57 @@ +package com.zgn.fazhi.controller; + + +import com.zgn.fazhi.factory.ResultFactory; +import com.zgn.fazhi.pojo.po.PictureType; +import com.zgn.fazhi.result.Result; +import com.zgn.fazhi.service.PictureTypeService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 图片分类 + * @author wt + */ +@RestController +public class PictureTypeController { + + @Autowired + PictureTypeService pictureTypeService; + + @ApiOperation("获取全部图片分类") + @GetMapping("/api/getAllPictureType") + public Result getAll(){ + return ResultFactory.buildSuccessResult(pictureTypeService.getAllPictureType()); + } + + + @ApiOperation("根据Id获取图片分类") + @GetMapping("/api/getPictureTypeById/{id}") + public Result getById(@PathVariable Integer id){ + return ResultFactory.buildSuccessResult(pictureTypeService.getAllPictureTypeById(id)); + } + + + @ApiOperation("增加图片分类") + @PostMapping("/api/addPictureType") + public Result addPictureType(@RequestBody PictureType pictureType){ + pictureTypeService.addPictureType(pictureType); + return ResultFactory.buildSuccessResult("增加图片分类成功"); + } + + + @ApiOperation("删除图片分类") + @GetMapping("/api/deletePictureType/{id}") + public Result deletePictureType(@PathVariable Integer id){ + pictureTypeService.deletePictureTypeById(id); + return ResultFactory.buildSuccessResult("删除图片分类成功"); + } + + @ApiOperation("修改图片分类") + @PostMapping("/api/updatePictureType") + public Result updatePictureType(@RequestBody PictureType pictureType){ + pictureTypeService.updatePictureType(pictureType); + return ResultFactory.buildSuccessResult("修改图片分类成功"); + } +} diff --git a/src/main/java/com/zgn/fazhi/controller/VideoTypeController.java b/src/main/java/com/zgn/fazhi/controller/VideoTypeController.java new file mode 100644 index 0000000..e6e5796 --- /dev/null +++ b/src/main/java/com/zgn/fazhi/controller/VideoTypeController.java @@ -0,0 +1,56 @@ +package com.zgn.fazhi.controller; + +import com.zgn.fazhi.factory.ResultFactory; +import com.zgn.fazhi.pojo.po.VideoType; +import com.zgn.fazhi.result.Result; +import com.zgn.fazhi.service.VideoTypeService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 视频分类 + * @author wt + */ +@RestController +public class VideoTypeController { + + @Autowired + VideoTypeService videoTypeService; + + @ApiOperation("获取全部视频分类") + @GetMapping("/api/getAllVideoType") + public Result getAll(){ + return ResultFactory.buildSuccessResult(videoTypeService.getAllVideoType()); + } + + + @ApiOperation("根据Id获取视频分类") + @GetMapping("/api/getVideoTypeById/{id}") + public Result getById(@PathVariable Integer id){ + return ResultFactory.buildSuccessResult(videoTypeService.getAllVideoTypeById(id)); + } + + + @ApiOperation("增加视频分类") + @PostMapping("/api/addVideoType") + public Result addVideoType(@RequestBody VideoType videoType){ + videoTypeService.addVideoType(videoType); + return ResultFactory.buildSuccessResult("增加视频分类成功"); + } + + + @ApiOperation("删除视频分类") + @GetMapping("/api/deleteVideoType/{id}") + public Result deleteVideoType(@PathVariable Integer id){ + videoTypeService.deleteVideoTypeById(id); + return ResultFactory.buildSuccessResult("删除视频分类成功"); + } + + @ApiOperation("修改视频分类") + @PostMapping("/api/updateVideoType") + public Result updateVideoType(@RequestBody VideoType videoType){ + videoTypeService.updateVideoType(videoType); + return ResultFactory.buildSuccessResult("修改视频分类成功"); + } +} diff --git a/src/main/java/com/zgn/fazhi/controller/VisitContentController.java b/src/main/java/com/zgn/fazhi/controller/VisitContentController.java index 03e779e..4d9249e 100644 --- a/src/main/java/com/zgn/fazhi/controller/VisitContentController.java +++ b/src/main/java/com/zgn/fazhi/controller/VisitContentController.java @@ -6,10 +6,7 @@ import com.zgn.fazhi.result.Result; import com.zgn.fazhi.service.VisitContentService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 参观地点 @@ -34,7 +31,7 @@ public class VisitContentController { } @ApiOperation("增加参观地点") - @GetMapping("/api/addVisitContent") + @PostMapping("/api/addVisitContent") public Result addVisit(@RequestBody VisitContent visitContent){ visitContentService.addVisitContent(visitContent); return ResultFactory.buildSuccessResult("增加地点成功"); @@ -48,7 +45,7 @@ public class VisitContentController { } @ApiOperation("修改参观地点") - @GetMapping("/api/updateVisitContent") + @PostMapping("/api/updateVisitContent") public Result updateVisit(@RequestBody VisitContent visitContent){ visitContentService.updateVisitContent(visitContent); return ResultFactory.buildSuccessResult("修改地点成功"); diff --git a/src/main/java/com/zgn/fazhi/service/FileTypeService.java b/src/main/java/com/zgn/fazhi/service/FileTypeService.java index 5acc92d..a153714 100644 --- a/src/main/java/com/zgn/fazhi/service/FileTypeService.java +++ b/src/main/java/com/zgn/fazhi/service/FileTypeService.java @@ -3,9 +3,42 @@ package com.zgn.fazhi.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zgn.fazhi.pojo.po.File; import com.zgn.fazhi.pojo.po.FileType; +import com.zgn.fazhi.pojo.po.VisitContent; + +import java.util.List; /** * @author ydw */ public interface FileTypeService extends IService { + + /** + * 获取全部文档类型 + * + */ + List getAllFileType(); + + /** + * 根据id获取文档类型 + * + */ + FileType getAllFileTypeById(Integer id); + + /** + * 增加文档类型 + * + */ + Integer addFileType(FileType fileType); + + /** + * 根据id删除文档类型 + * + */ + Integer deleteFileTypeById(Integer id); + + /** + * 修改文档类型 + * + */ + Integer updateFileType(FileType fileType); } diff --git a/src/main/java/com/zgn/fazhi/service/GradeService.java b/src/main/java/com/zgn/fazhi/service/GradeService.java index 267e36a..79c82cc 100644 --- a/src/main/java/com/zgn/fazhi/service/GradeService.java +++ b/src/main/java/com/zgn/fazhi/service/GradeService.java @@ -2,6 +2,7 @@ package com.zgn.fazhi.service; import com.zgn.fazhi.pojo.po.Grade; import com.baomidou.mybatisplus.extension.service.IService; +import com.zgn.fazhi.pojo.po.VideoType; import java.util.List; @@ -21,4 +22,28 @@ public interface GradeService extends IService { */ List getAllGrade(); + /** + * 根据id获取等级 + * + */ + Grade getAllGradeById(Integer id); + + /** + * 增加等级 + * + */ + Integer addGrade(Grade grade); + + /** + * 根据id删除等级 + * + */ + Integer deleteGradeById(Integer id); + + /** + * 修改等级 + * + */ + Integer updateGrade(Grade grade); + } diff --git a/src/main/java/com/zgn/fazhi/service/IntervalInfoService.java b/src/main/java/com/zgn/fazhi/service/IntervalInfoService.java index ff9aeb7..4f8848e 100644 --- a/src/main/java/com/zgn/fazhi/service/IntervalInfoService.java +++ b/src/main/java/com/zgn/fazhi/service/IntervalInfoService.java @@ -22,17 +22,26 @@ public interface IntervalInfoService extends IService { /** * 通过id获取数据 - * @return + * */ IntervalInfo getIntervalInfoById(Integer id); - + /** + * 增加预约时间段 + * + */ Integer addIntervalInfo(IntervalInfo intervalInfo); - + /** + * 通过id删除预约时间段 + * + */ Integer deleteIntervalInfoById(Integer id); - + /** + * 修改预约时间段 + * + */ Integer updateIntervalInfo(IntervalInfo intervalInfo); } diff --git a/src/main/java/com/zgn/fazhi/service/PictureTypeService.java b/src/main/java/com/zgn/fazhi/service/PictureTypeService.java index d7b06fc..f64d0f7 100644 --- a/src/main/java/com/zgn/fazhi/service/PictureTypeService.java +++ b/src/main/java/com/zgn/fazhi/service/PictureTypeService.java @@ -1,5 +1,6 @@ package com.zgn.fazhi.service; +import com.zgn.fazhi.pojo.po.FileType; import com.zgn.fazhi.pojo.po.PictureType; import com.baomidou.mybatisplus.extension.service.IService; @@ -15,6 +16,35 @@ import java.util.List; */ public interface PictureTypeService extends IService { + /** + * 获取全部图片类型 + * + */ + List getAllPictureType(); + + /** + * 根据id获取图片类型 + * + */ + PictureType getAllPictureTypeById(Integer id); + + /** + * 增加图片类型 + * + */ + Integer addPictureType(PictureType pictureType); + + /** + * 根据id删除图片类型 + * + */ + Integer deletePictureTypeById(Integer id); + + /** + * 修改图片类型 + * + */ + Integer updatePictureType(PictureType pictureType); } diff --git a/src/main/java/com/zgn/fazhi/service/VideoTypeService.java b/src/main/java/com/zgn/fazhi/service/VideoTypeService.java index a368c80..2d476d0 100644 --- a/src/main/java/com/zgn/fazhi/service/VideoTypeService.java +++ b/src/main/java/com/zgn/fazhi/service/VideoTypeService.java @@ -1,8 +1,11 @@ package com.zgn.fazhi.service; +import com.zgn.fazhi.pojo.po.PictureType; import com.zgn.fazhi.pojo.po.VideoType; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** *

* 服务类 @@ -13,4 +16,36 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface VideoTypeService extends IService { + /** + * 获取全部视频类型 + * + */ + List getAllVideoType(); + + /** + * 根据id获取视频类型 + * + */ + VideoType getAllVideoTypeById(Integer id); + + /** + * 增加视频类型 + * + */ + Integer addVideoType(VideoType videoType); + + /** + * 根据id删除视频类型 + * + */ + Integer deleteVideoTypeById(Integer id); + + /** + * 修改视频类型 + * + */ + Integer updateVideoType(VideoType videoType); + + + } diff --git a/src/main/java/com/zgn/fazhi/service/VisitContentService.java b/src/main/java/com/zgn/fazhi/service/VisitContentService.java index 31c0392..1d572fa 100644 --- a/src/main/java/com/zgn/fazhi/service/VisitContentService.java +++ b/src/main/java/com/zgn/fazhi/service/VisitContentService.java @@ -18,23 +18,32 @@ public interface VisitContentService extends IService { /** * 获取全部可参观地点 - * @return + * */ List getAllVisitContent(); /** * 通过id获取该数据 - * @return + * */ VisitContent getAllVisitContentById(Integer id); - + /** + * 增加可参观地点 + * + */ Integer addVisitContent(VisitContent visitContent); - + /** + * 根据id删除可参观地点 + * + */ Integer deleteVisitContentById(Integer id); - + /** + * 修改可参观地点 + * + */ Integer updateVisitContent(VisitContent visitContent); } diff --git a/src/main/java/com/zgn/fazhi/service/impl/FileTypeServiceImpl.java b/src/main/java/com/zgn/fazhi/service/impl/FileTypeServiceImpl.java index 00993ef..d7901eb 100644 --- a/src/main/java/com/zgn/fazhi/service/impl/FileTypeServiceImpl.java +++ b/src/main/java/com/zgn/fazhi/service/impl/FileTypeServiceImpl.java @@ -2,13 +2,46 @@ package com.zgn.fazhi.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zgn.fazhi.mapper.FileTypeMapper; +import com.zgn.fazhi.mapper.VisitContentMapper; import com.zgn.fazhi.pojo.po.FileType; +import com.zgn.fazhi.pojo.po.VisitContent; import com.zgn.fazhi.service.FileTypeService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * @author ydw */ @Service public class FileTypeServiceImpl extends ServiceImpl implements FileTypeService { + + @Autowired + private FileTypeMapper fileTypeMapper; + + @Override + public List getAllFileType() { + return fileTypeMapper.selectList(null); + } + + @Override + public FileType getAllFileTypeById(Integer id) { + return fileTypeMapper.selectById(id); + } + + @Override + public Integer addFileType(FileType fileType) { + return fileTypeMapper.insert(fileType); + } + + @Override + public Integer deleteFileTypeById(Integer id) { + return fileTypeMapper.deleteById(id); + } + + @Override + public Integer updateFileType(FileType fileType) { + return fileTypeMapper.updateById(fileType); + } } diff --git a/src/main/java/com/zgn/fazhi/service/impl/GradeServiceImpl.java b/src/main/java/com/zgn/fazhi/service/impl/GradeServiceImpl.java index dc91ec0..7c13069 100644 --- a/src/main/java/com/zgn/fazhi/service/impl/GradeServiceImpl.java +++ b/src/main/java/com/zgn/fazhi/service/impl/GradeServiceImpl.java @@ -2,6 +2,7 @@ package com.zgn.fazhi.service.impl; import com.zgn.fazhi.pojo.po.Grade; import com.zgn.fazhi.mapper.GradeMapper; +import com.zgn.fazhi.pojo.po.VideoType; import com.zgn.fazhi.service.GradeService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; @@ -28,8 +29,26 @@ public class GradeServiceImpl extends ServiceImpl implement */ @Override public List getAllGrade() { - List grades = gradeMapper.selectList(null); + return gradeMapper.selectList(null); + } + + @Override + public Grade getAllGradeById(Integer id) { + return gradeMapper.selectById(id); + } - return grades; + @Override + public Integer addGrade(Grade grade) { + return gradeMapper.insert(grade); + } + + @Override + public Integer deleteGradeById(Integer id) { + return gradeMapper.deleteById(id); + } + + @Override + public Integer updateGrade(Grade grade) { + return gradeMapper.updateById(grade); } } diff --git a/src/main/java/com/zgn/fazhi/service/impl/PictureTypeServiceImpl.java b/src/main/java/com/zgn/fazhi/service/impl/PictureTypeServiceImpl.java index 81f122c..f4672a8 100644 --- a/src/main/java/com/zgn/fazhi/service/impl/PictureTypeServiceImpl.java +++ b/src/main/java/com/zgn/fazhi/service/impl/PictureTypeServiceImpl.java @@ -1,5 +1,7 @@ package com.zgn.fazhi.service.impl; +import com.zgn.fazhi.mapper.FileTypeMapper; +import com.zgn.fazhi.pojo.po.FileType; import com.zgn.fazhi.pojo.po.PictureType; import com.zgn.fazhi.mapper.PictureTypeMapper; import com.zgn.fazhi.service.PictureTypeService; @@ -20,6 +22,32 @@ import java.util.List; @Service public class PictureTypeServiceImpl extends ServiceImpl implements PictureTypeService { + @Autowired + private PictureTypeMapper pictureTypeMapper; + @Override + public List getAllPictureType() { + return pictureTypeMapper.selectList(null); + } + + @Override + public PictureType getAllPictureTypeById(Integer id) { + return pictureTypeMapper.selectById(id); + } + + @Override + public Integer addPictureType(PictureType pictureType) { + return pictureTypeMapper.insert(pictureType); + } + + @Override + public Integer deletePictureTypeById(Integer id) { + return pictureTypeMapper.deleteById(id); + } + + @Override + public Integer updatePictureType(PictureType pictureType) { + return pictureTypeMapper.updateById(pictureType); + } } diff --git a/src/main/java/com/zgn/fazhi/service/impl/VideoTypeServiceImpl.java b/src/main/java/com/zgn/fazhi/service/impl/VideoTypeServiceImpl.java index 4714048..09140fd 100644 --- a/src/main/java/com/zgn/fazhi/service/impl/VideoTypeServiceImpl.java +++ b/src/main/java/com/zgn/fazhi/service/impl/VideoTypeServiceImpl.java @@ -1,11 +1,16 @@ package com.zgn.fazhi.service.impl; +import com.zgn.fazhi.mapper.PictureTypeMapper; +import com.zgn.fazhi.pojo.po.PictureType; import com.zgn.fazhi.pojo.po.VideoType; import com.zgn.fazhi.mapper.VideoTypeMapper; import com.zgn.fazhi.service.VideoTypeService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 服务实现类 @@ -17,4 +22,32 @@ import org.springframework.stereotype.Service; @Service public class VideoTypeServiceImpl extends ServiceImpl implements VideoTypeService { + @Autowired + private VideoTypeMapper videoTypeMapper; + + @Override + public List getAllVideoType() { + return videoTypeMapper.selectList(null); + } + + @Override + public VideoType getAllVideoTypeById(Integer id) { + return videoTypeMapper.selectById(id); + } + + @Override + public Integer addVideoType(VideoType videoType) { + return videoTypeMapper.insert(videoType); + } + + @Override + public Integer deleteVideoTypeById(Integer id) { + return videoTypeMapper.deleteById(id); + } + + @Override + public Integer updateVideoType(VideoType videoType) { + return videoTypeMapper.updateById(videoType); + } + } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 081af66..c9fdf68 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,6 +1,6 @@ -server.port=8082 +server.port=8090 # ���ݿ����ӵ�ַ spring.datasource.url=jdbc:mysql://localhost:3306/fazhi?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT # ���ݿ��û���&���룺 spring.datasource.username=root -spring.datasource.password=zgn12.21 +spring.datasource.password=root -- Gitee