diff --git a/src/main/java/com/teaching/backend/controller/FavourInformation/FavourInformationController.java b/src/main/java/com/teaching/backend/controller/FavourInformation/FavourInformationController.java index 74469a3..3e174c5 100644 --- a/src/main/java/com/teaching/backend/controller/FavourInformation/FavourInformationController.java +++ b/src/main/java/com/teaching/backend/controller/FavourInformation/FavourInformationController.java @@ -21,6 +21,7 @@ import java.util.List; * @Version 1.0 */ @RestController +@RequestMapping ("/api") public class FavourInformationController{ diff --git a/src/main/java/com/teaching/backend/controller/courseResource/CourseResourceController.java b/src/main/java/com/teaching/backend/controller/courseResource/CourseResourceController.java index 4b26e88..1b79d98 100644 --- a/src/main/java/com/teaching/backend/controller/courseResource/CourseResourceController.java +++ b/src/main/java/com/teaching/backend/controller/courseResource/CourseResourceController.java @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.List; @RestController -@RequestMapping("/courses") +@RequestMapping("/api/courses") public class CourseResourceController { @Autowired private CourseResourcesServiceImpl courseResourcesService; diff --git a/src/main/java/com/teaching/backend/controller/courses/CourseObjectivesController.java b/src/main/java/com/teaching/backend/controller/courses/CourseObjectivesController.java index acc3cf7..c6ca203 100644 --- a/src/main/java/com/teaching/backend/controller/courses/CourseObjectivesController.java +++ b/src/main/java/com/teaching/backend/controller/courses/CourseObjectivesController.java @@ -27,7 +27,7 @@ import java.util.List; */ @Api(tags = "课程目标管理接口") @RestController -@RequestMapping("/course_objectives") +@RequestMapping("/api/course_objectives") public class CourseObjectivesController { diff --git a/src/main/java/com/teaching/backend/controller/courses/CoursesController.java b/src/main/java/com/teaching/backend/controller/courses/CoursesController.java index 3d4cb48..993eb4b 100644 --- a/src/main/java/com/teaching/backend/controller/courses/CoursesController.java +++ b/src/main/java/com/teaching/backend/controller/courses/CoursesController.java @@ -33,7 +33,7 @@ import java.util.*; */ @Api(tags = "课程管理接口") @RestController -@RequestMapping("/coursesteacher") +@RequestMapping("/api/coursesteacher") public class CoursesController { @Autowired diff --git a/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentKnowController.java b/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentKnowController.java index 628dec6..8986e15 100644 --- a/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentKnowController.java +++ b/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentKnowController.java @@ -25,7 +25,7 @@ import org.springframework.stereotype.Controller; */ @Api(tags = "目标-内容 关联的知识点接口") @RestController -@RequestMapping("/objective_content_know") +@RequestMapping("/api/objective_content_know") public class ObjectiveContentKnowController { @Autowired IObjectiveContentKnowService objectiveContentKnowService; diff --git a/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentsController.java b/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentsController.java index 4dbabf0..17a9462 100644 --- a/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentsController.java +++ b/src/main/java/com/teaching/backend/controller/courses/ObjectiveContentsController.java @@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*; * @since 2024-06-05 */ @RestController -@RequestMapping("/objective_contents") +@RequestMapping("/api/objective_contents") @Api(tags = "目标内容接口") public class ObjectiveContentsController { diff --git a/src/main/java/com/teaching/backend/controller/courses/ObjectivesTypeController.java b/src/main/java/com/teaching/backend/controller/courses/ObjectivesTypeController.java index a44ccd0..87847f0 100644 --- a/src/main/java/com/teaching/backend/controller/courses/ObjectivesTypeController.java +++ b/src/main/java/com/teaching/backend/controller/courses/ObjectivesTypeController.java @@ -21,7 +21,7 @@ import java.util.List; * @since 2024-06-05 */ @RestController -@RequestMapping("/objectives_type") +@RequestMapping("/api/objectives_type") @Api(tags = "项目目标类型管理接口") public class ObjectivesTypeController { diff --git a/src/main/java/com/teaching/backend/controller/courses/StudentCoursesController.java b/src/main/java/com/teaching/backend/controller/courses/StudentCoursesController.java index 92e9d5c..f0433f9 100644 --- a/src/main/java/com/teaching/backend/controller/courses/StudentCoursesController.java +++ b/src/main/java/com/teaching/backend/controller/courses/StudentCoursesController.java @@ -26,7 +26,7 @@ import org.springframework.stereotype.Controller; */ @Api(tags = "学生课程接口") @RestController -@RequestMapping("/student_courses") +@RequestMapping("/api/student_courses") public class StudentCoursesController { @Autowired diff --git a/src/main/java/com/teaching/backend/controller/favour/SeCourseFavourController.java b/src/main/java/com/teaching/backend/controller/favour/SeCourseFavourController.java index fd30fe1..60e81b6 100644 --- a/src/main/java/com/teaching/backend/controller/favour/SeCourseFavourController.java +++ b/src/main/java/com/teaching/backend/controller/favour/SeCourseFavourController.java @@ -28,7 +28,7 @@ import java.util.List; * @Description: */ @RestController -@RequestMapping("/course_favour") +@RequestMapping("/api/course_favour") @Slf4j public class SeCourseFavourController { diff --git a/src/main/java/com/teaching/backend/controller/favour/SeKnowFavourController.java b/src/main/java/com/teaching/backend/controller/favour/SeKnowFavourController.java index 651e5f6..533e684 100644 --- a/src/main/java/com/teaching/backend/controller/favour/SeKnowFavourController.java +++ b/src/main/java/com/teaching/backend/controller/favour/SeKnowFavourController.java @@ -20,7 +20,7 @@ import javax.annotation.Resource; * @Description: */ @RestController -@RequestMapping("/know_favour") +@RequestMapping("/api/know_favour") @Slf4j public class SeKnowFavourController { diff --git a/src/main/java/com/teaching/backend/controller/favour/SeResourceFavourController.java b/src/main/java/com/teaching/backend/controller/favour/SeResourceFavourController.java index 8a1c8a4..7d1201e 100644 --- a/src/main/java/com/teaching/backend/controller/favour/SeResourceFavourController.java +++ b/src/main/java/com/teaching/backend/controller/favour/SeResourceFavourController.java @@ -24,7 +24,7 @@ import javax.annotation.Resource; * @Description: */ @RestController -@RequestMapping("/resource_favour") +@RequestMapping("/api/resource_favour") @Slf4j public class SeResourceFavourController { diff --git a/src/main/java/com/teaching/backend/controller/know/KnowController.java b/src/main/java/com/teaching/backend/controller/know/KnowController.java new file mode 100644 index 0000000..2bb3859 --- /dev/null +++ b/src/main/java/com/teaching/backend/controller/know/KnowController.java @@ -0,0 +1,40 @@ +package com.teaching.backend.controller.know; + +import com.teaching.backend.model.dto.know.KnowQueryRequest; +import com.teaching.backend.model.dto.know.KnowRequest; +import com.teaching.backend.model.dto.know.KnowupdateRequest; +import com.teaching.backend.model.entity.know.Know; +import com.teaching.backend.service.know.KnowService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @Author:youhang + * @Date:2024-06-21-10:26 + * @Description: + */ +@RestController +@RequestMapping("/api/know") +public class KnowController { + + @Autowired + private KnowService knowService; + @PostMapping("/add") + public Boolean add(@RequestBody KnowRequest knowAddRequest) { + return knowService.add(knowAddRequest); + } + @PostMapping("/update") + public Boolean update(@RequestBody KnowupdateRequest knowAddRequest){ + return knowService.update(knowAddRequest); + } + @PostMapping("/delete") + public Integer deleteKnow(@RequestBody List ids){ + return knowService.deleteKnow(ids); + } + @PostMapping("/query") + public List query(@RequestBody KnowQueryRequest knowQueryRequest){ + return knowService.query(knowQueryRequest); + } +} diff --git a/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java b/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java index 0dc4fc0..0fe61ea 100644 --- a/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java +++ b/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java @@ -16,7 +16,7 @@ import java.util.ArrayList; import java.util.List; @RestController -@RequestMapping("/learningrecords") +@RequestMapping("/api/learningrecords") public class LearningRecordsController { @Autowired diff --git a/src/main/java/com/teaching/backend/controller/thumb/SeCourseThumbController.java b/src/main/java/com/teaching/backend/controller/thumb/SeCourseThumbController.java index 65e0b5f..414d475 100644 --- a/src/main/java/com/teaching/backend/controller/thumb/SeCourseThumbController.java +++ b/src/main/java/com/teaching/backend/controller/thumb/SeCourseThumbController.java @@ -21,7 +21,7 @@ import javax.annotation.Resource; * @Description: */ @RestController -@RequestMapping("/course_thumb") +@RequestMapping("/api/course_thumb") @Slf4j public class SeCourseThumbController { diff --git a/src/main/java/com/teaching/backend/controller/thumb/SeKnowThumbController.java b/src/main/java/com/teaching/backend/controller/thumb/SeKnowThumbController.java index 6c75f7a..3e158bb 100644 --- a/src/main/java/com/teaching/backend/controller/thumb/SeKnowThumbController.java +++ b/src/main/java/com/teaching/backend/controller/thumb/SeKnowThumbController.java @@ -20,7 +20,7 @@ import javax.annotation.Resource; * @Description: */ @RestController -@RequestMapping("/know_thumb") +@RequestMapping("/api/know_thumb") @Slf4j public class SeKnowThumbController { diff --git a/src/main/java/com/teaching/backend/controller/thumb/SeResourceThumbController.java b/src/main/java/com/teaching/backend/controller/thumb/SeResourceThumbController.java index 17dcee8..e82ed6c 100644 --- a/src/main/java/com/teaching/backend/controller/thumb/SeResourceThumbController.java +++ b/src/main/java/com/teaching/backend/controller/thumb/SeResourceThumbController.java @@ -20,7 +20,7 @@ import javax.annotation.Resource; * @Description: */ @RestController -@RequestMapping("/resource_thumb") +@RequestMapping("/api/resource_thumb") @Slf4j public class SeResourceThumbController { diff --git a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java index 4f8d56b..97964bd 100644 --- a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java +++ b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsAdminController.java @@ -34,7 +34,7 @@ import java.util.stream.Collectors; */ @RestController @Api(tags = "UmsAdminController") -@RequestMapping("/user") +@RequestMapping("/api/user") @Slf4j public class UmsAdminController { @Value("${jwt.tokenHeader}") diff --git a/src/main/java/com/teaching/backend/model/dto/know/KnowQueryRequest.java b/src/main/java/com/teaching/backend/model/dto/know/KnowQueryRequest.java new file mode 100644 index 0000000..fb42742 --- /dev/null +++ b/src/main/java/com/teaching/backend/model/dto/know/KnowQueryRequest.java @@ -0,0 +1,19 @@ +package com.teaching.backend.model.dto.know; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 知识点请求 + */ +@Data +public class KnowQueryRequest implements Serializable { + + /** + * 知识点名称 + */ + private String name; + +} diff --git a/src/main/java/com/teaching/backend/model/dto/know/KnowAddRequest.java b/src/main/java/com/teaching/backend/model/dto/know/KnowRequest.java similarity index 91% rename from src/main/java/com/teaching/backend/model/dto/know/KnowAddRequest.java rename to src/main/java/com/teaching/backend/model/dto/know/KnowRequest.java index 9f093ee..2da09bb 100644 --- a/src/main/java/com/teaching/backend/model/dto/know/KnowAddRequest.java +++ b/src/main/java/com/teaching/backend/model/dto/know/KnowRequest.java @@ -9,7 +9,7 @@ import java.math.BigDecimal; * 知识点请求 */ @Data -public class KnowAddRequest implements Serializable { +public class KnowRequest implements Serializable { /** diff --git a/src/main/java/com/teaching/backend/model/dto/know/KnowupdateRequest.java b/src/main/java/com/teaching/backend/model/dto/know/KnowupdateRequest.java new file mode 100644 index 0000000..bc339ea --- /dev/null +++ b/src/main/java/com/teaching/backend/model/dto/know/KnowupdateRequest.java @@ -0,0 +1,54 @@ +package com.teaching.backend.model.dto.know; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 知识点请求 + */ +@Data +public class KnowupdateRequest implements Serializable { + + + /** + * 知识点id + */ + private Integer id; + + + /** + * 知识点名称 + */ + private String name; + + /** + * 简介 + */ + private String info; + + /** + * 知识点内容 + */ + private String content; + + /** + * 知识点图片 + */ + private String img; + + /** + * 知识点学时 + */ + private BigDecimal hour; + + + + /** + * 资源id 运用json + */ + private String resourceid; + + +} diff --git a/src/main/java/com/teaching/backend/model/entity/umsAdmin/UmsStudent.java b/src/main/java/com/teaching/backend/model/entity/umsAdmin/UmsStudent.java index 05bfc90..99d0e7e 100644 --- a/src/main/java/com/teaching/backend/model/entity/umsAdmin/UmsStudent.java +++ b/src/main/java/com/teaching/backend/model/entity/umsAdmin/UmsStudent.java @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; /** *

- * + * *

* * @author zjh @@ -72,7 +72,7 @@ public class UmsStudent implements Serializable { /** * 入学年份 */ - private LocalDate year; + private LocalDate yearAge; /** * 班级 diff --git a/src/main/java/com/teaching/backend/service/impl/know/KnowServiceimpl.java b/src/main/java/com/teaching/backend/service/impl/know/KnowServiceimpl.java index d3952e7..f2f924b 100644 --- a/src/main/java/com/teaching/backend/service/impl/know/KnowServiceimpl.java +++ b/src/main/java/com/teaching/backend/service/impl/know/KnowServiceimpl.java @@ -1,23 +1,50 @@ package com.teaching.backend.service.impl.know; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.teaching.backend.mapper.know.KnowMapper; -import com.teaching.backend.model.dto.favour.knowFavour.KnowFavourAddRequest; -import com.teaching.backend.model.dto.know.KnowAddRequest; +import com.teaching.backend.model.dto.know.KnowQueryRequest; +import com.teaching.backend.model.dto.know.KnowRequest; +import com.teaching.backend.model.dto.know.KnowupdateRequest; import com.teaching.backend.model.entity.know.Know; import com.teaching.backend.service.know.KnowService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class KnowServiceimpl extends ServiceImpl implements KnowService { @Autowired private KnowMapper knowMapper; @Override - public Boolean add(KnowAddRequest knowAddRequest) { + public Boolean add(KnowRequest knowAddRequest) { Know know = new Know(); BeanUtils.copyProperties(knowAddRequest,know); - return (save(know)); + return save(know); } + + @Override + public Boolean update(KnowupdateRequest knowAddRequest) { + Know know = new Know(); + BeanUtils.copyProperties(knowAddRequest,know); + return (updateById(know)); + } + + @Override + public Integer deleteKnow(List ids) { + Integer result = knowMapper.deleteBatchIds(ids); + return result; + } + + @Override + public List query(KnowQueryRequest knowQueryRequest) { + String name = knowQueryRequest.getName(); + QueryWrapper knowQueryWrapper = new QueryWrapper<>(); + knowQueryWrapper.eq("name",name); + List knows = knowMapper.selectList(knowQueryWrapper); + return knows; + } + } diff --git a/src/main/java/com/teaching/backend/service/know/KnowService.java b/src/main/java/com/teaching/backend/service/know/KnowService.java index ab07327..c40a743 100644 --- a/src/main/java/com/teaching/backend/service/know/KnowService.java +++ b/src/main/java/com/teaching/backend/service/know/KnowService.java @@ -2,11 +2,22 @@ package com.teaching.backend.service.know; import com.baomidou.mybatisplus.extension.service.IService; import com.teaching.backend.model.dto.favour.knowFavour.KnowFavourAddRequest; -import com.teaching.backend.model.dto.know.KnowAddRequest; + +import com.teaching.backend.model.dto.know.KnowQueryRequest; +import com.teaching.backend.model.dto.know.KnowRequest; +import com.teaching.backend.model.dto.know.KnowupdateRequest; import com.teaching.backend.model.entity.know.Know; +import java.util.List; + public interface KnowService extends IService { - public Boolean add(KnowAddRequest knowAddRequest); + public Boolean add(KnowRequest knowAddRequest); + + public Boolean update(KnowupdateRequest knowAddRequest); + + public Integer deleteKnow(List ids); + + public List query(KnowQueryRequest knowQueryRequest); } diff --git a/src/main/java/com/teaching/backend/utils/ParamOutAspect.java b/src/main/java/com/teaching/backend/utils/ParamOutAspect.java index 2f30748..383ce64 100644 --- a/src/main/java/com/teaching/backend/utils/ParamOutAspect.java +++ b/src/main/java/com/teaching/backend/utils/ParamOutAspect.java @@ -53,11 +53,8 @@ // final Object[] array = filteredArgs.stream().toArray(); // // for (int i = 0; i < array.length; i++) { -// System.out.println(array[i]); // String jsonStr = JSONUtil.toJsonStr(array[i]); -// System.out.println(jsonStr); -// Class myClass = array[i].getClass(); // 获取类的 Class 对象 -// System.out.println("class "+myClass); +//// Class myClass = array[i].getClass(); // 获取类的 Class 对象 // JSONObject entries = JSONUtil.parseObj(jsonStr); // System.out.println(entries); // // 遍历JSONObject的属性 @@ -70,7 +67,7 @@ // } // // } -// System.out.println(key + ": " + value); +//// System.out.println(key + ": " + value); // }); // } // }