diff --git a/pom.xml b/pom.xml
index b2100c2..b5329a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,6 +16,7 @@
8
+ jar
org.springframework.boot
@@ -62,12 +63,20 @@
3.5.2
+
+
+
+
+
+
+
mysql
mysql-connector-java
5.0.7
+
org.springframework.boot
diff --git a/src/main/java/com/zhiyun/zhiyun03/academic/mapper/AcademicMapper.java b/src/main/java/com/zhiyun/zhiyun03/academic/mapper/AcademicMapper.java
index 7c6b2d4..4926195 100644
--- a/src/main/java/com/zhiyun/zhiyun03/academic/mapper/AcademicMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/academic/mapper/AcademicMapper.java
@@ -4,10 +4,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.academic.entity.Academic;
import com.zhiyun.zhiyun03.academic.vo.AcademicVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface AcademicMapper extends BaseMapper {
List queryAcademic();
+
+ int updateByIdInfo(Academic academic);
+
+ int findByNameAndId(@Param("id") Integer id,@Param("academicName") String academicName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/academic/service/impl/AcademicServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/academic/service/impl/AcademicServiceImpl.java
index 5f6b7bb..12030b1 100644
--- a/src/main/java/com/zhiyun/zhiyun03/academic/service/impl/AcademicServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/academic/service/impl/AcademicServiceImpl.java
@@ -132,8 +132,11 @@ public class AcademicServiceImpl extends ServiceImpl i
if (academicVo.getDirName().isEmpty()){
throw new ServiceException("400","归属目录不能为空");
}
- if (academicVo.getAcademicImg().isEmpty()){
- throw new ServiceException("400","学术图片不能为空");
+ // 校验名称是否重复
+ int sum = academicMapper.findByNameAndId(academicVo.getId(),academicVo.getAcademicName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
}
//将vo类转换为实体类
ConvertUtil convertUtil=new ConvertUtil();
@@ -145,7 +148,7 @@ public class AcademicServiceImpl extends ServiceImpl i
//将目录id封装到实体类
academic.setDirId(directory.getId());
academic.setAcademicUpdatetime(new Date());
- int update = academicMapper.updateById(academic);
+ int update = academicMapper.updateByIdInfo(academic);
return update;
}
@@ -186,6 +189,10 @@ public class AcademicServiceImpl extends ServiceImpl i
if (directory.getDirName().isEmpty()){
throw new ServiceException("400","目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()){
throw new ServiceException("400","图片不能为空");
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/application/mapper/ApplicationMapper.java b/src/main/java/com/zhiyun/zhiyun03/application/mapper/ApplicationMapper.java
index dcdb551..3433f81 100644
--- a/src/main/java/com/zhiyun/zhiyun03/application/mapper/ApplicationMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/application/mapper/ApplicationMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.application.entity.Application;
import com.zhiyun.zhiyun03.application.vo.ApplicationVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -11,4 +12,6 @@ import java.util.List;
@Mapper
public interface ApplicationMapper extends BaseMapper {
List queryApplication();
+
+ int findByNameAndId(@Param("id") Integer id,@Param("appName") String appName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/application/service/impl/ApplicationServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/application/service/impl/ApplicationServiceImpl.java
index 826f11a..d68977c 100644
--- a/src/main/java/com/zhiyun/zhiyun03/application/service/impl/ApplicationServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/application/service/impl/ApplicationServiceImpl.java
@@ -114,6 +114,13 @@ public class ApplicationServiceImpl extends ServiceImpl0)
+ {
+ throw new ServiceException("300","课程名已存在");
+ }
+
ConvertUtil convertUtil=new ConvertUtil();
Application application = convertUtil.VoToEntity(applicationVo, Application.class);
QueryWrapper qwd=new QueryWrapper<>();
@@ -147,6 +154,10 @@ public class ApplicationServiceImpl extends ServiceImpl6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()){
throw new ServiceException("400","图片不能为空");
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/course/controller/CourseController.java b/src/main/java/com/zhiyun/zhiyun03/course/controller/CourseController.java
index 3e96c57..5b729a6 100644
--- a/src/main/java/com/zhiyun/zhiyun03/course/controller/CourseController.java
+++ b/src/main/java/com/zhiyun/zhiyun03/course/controller/CourseController.java
@@ -116,11 +116,9 @@ public class CourseController {
@GetMapping("/addCourseDirectory")
public JsonResult addCourseDirectory(Directory directory){
courseService.addCourseDirectory(directory);
-
return JsonResult.success();
}
-
@ApiOperation("查询目录")
@GetMapping("/queryCourseDirectory")
public JsonResult queryCourseDirectory(){
@@ -130,5 +128,4 @@ public class CourseController {
}
-
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/course/mapper/CourseMapper.java b/src/main/java/com/zhiyun/zhiyun03/course/mapper/CourseMapper.java
index 83c4a89..715e18f 100644
--- a/src/main/java/com/zhiyun/zhiyun03/course/mapper/CourseMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/course/mapper/CourseMapper.java
@@ -6,6 +6,7 @@ import com.zhiyun.zhiyun03.course.vo.ClientCourseVo;
import com.zhiyun.zhiyun03.course.vo.CourseVo;
import com.zhiyun.zhiyun03.course.vo.PageVO;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@@ -35,4 +36,5 @@ public interface CourseMapper extends BaseMapper {
int selectByName(String courseName);
+ int findByNameAndId(@Param("id") Integer id, @Param("courseName") String courseName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/course/service/impl/CourseServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/course/service/impl/CourseServiceImpl.java
index 3204225..a268de6 100644
--- a/src/main/java/com/zhiyun/zhiyun03/course/service/impl/CourseServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/course/service/impl/CourseServiceImpl.java
@@ -138,12 +138,23 @@ public class CourseServiceImpl extends ServiceImpl implemen
{
throw new ServiceException("400","课程名称不能为空");
}
+ // 校验名称是否重复
+ int sum = courseMapper.findByNameAndId(courseVo.getId(),courseVo.getCourseName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
+ }
+// QueryWrapper qwc=new QueryWrapper<>();
+// qwc.select("course_name").lambda().eq(Course::getCourseName,courseVo.getCourseName());
+// List courses = courseMapper.selectList(qwc);
+// if(courses.size()!=0){
+// throw new ServiceException("403","课程名称已存在");
+// }
//将vo值赋给course
Course course = new Course();
BeanUtils.copyProperties(courseVo,course);
//查询归属目录
String dirName = courseVo.getDirName();
-
if (dirName.isEmpty())
{
throw new ServiceException("403","归属目录不能为空");
@@ -194,6 +205,10 @@ public class CourseServiceImpl extends ServiceImpl implemen
{
throw new ServiceException("400","目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
/*判断目录图标是否为空*/
if (directory.getDirIcon().isEmpty())
{
diff --git a/src/main/java/com/zhiyun/zhiyun03/download/mapper/DownloadMapper.java b/src/main/java/com/zhiyun/zhiyun03/download/mapper/DownloadMapper.java
index 25f2c1f..c204c7c 100644
--- a/src/main/java/com/zhiyun/zhiyun03/download/mapper/DownloadMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/download/mapper/DownloadMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.download.entity.Download;
import com.zhiyun.zhiyun03.download.vo.DownloadVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -14,4 +15,6 @@ public interface DownloadMapper extends BaseMapper {
int selectByName(String downloadName);
int updateDownloadById(Download download);
+
+ int findByNameAndId(@Param("id") Integer id,@Param("downloadName") String downloadName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java
index 67063cf..882d60a 100644
--- a/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java
@@ -140,6 +140,14 @@ public class DownloadServiceImpl extends ServiceImpl i
if (vo.getDownloadName().isEmpty()) {
throw new ServiceException("400", "下载名不能为空失败");
}
+ // 校验名称是否重复
+ int sum = downloadMapper.findByNameAndId(vo.getId(),vo.getDownloadName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
+ }
+
+
//将vo值传给download
Download download = new Download();
BeanUtils.copyProperties(vo, download);
@@ -166,6 +174,10 @@ public class DownloadServiceImpl extends ServiceImpl i
if (directory.getDirName().isEmpty()) {
throw new ServiceException("400", "目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()) {
throw new ServiceException("400", "请选择一个icon");
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java b/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java
index c4609b2..42673b0 100644
--- a/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java
+++ b/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java
@@ -59,7 +59,7 @@ public class Game {
@TableField(value = "start_time")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
- private String startTime;
+ private Date startTime;
/**
* 结束时间
@@ -67,7 +67,7 @@ public class Game {
@TableField(value = "end_time")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
- private String endTime;
+ private Date endTime;
/**
diff --git a/src/main/java/com/zhiyun/zhiyun03/game/mapper/GameMapper.java b/src/main/java/com/zhiyun/zhiyun03/game/mapper/GameMapper.java
index 736bd10..6327348 100644
--- a/src/main/java/com/zhiyun/zhiyun03/game/mapper/GameMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/game/mapper/GameMapper.java
@@ -4,10 +4,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.game.entity.Game;
import com.zhiyun.zhiyun03.game.vo.GameVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface GameMapper extends BaseMapper {
List queryGame();
+
+ int updateByIdInfo(Game game);
+
+ int findByNameAndId(@Param("id") Integer id, @Param("gameName")String gameName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/game/service/impl/GameServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/game/service/impl/GameServiceImpl.java
index 986765a..c7718d7 100644
--- a/src/main/java/com/zhiyun/zhiyun03/game/service/impl/GameServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/game/service/impl/GameServiceImpl.java
@@ -137,9 +137,14 @@ public class GameServiceImpl extends ServiceImpl implements Ga
if (gameVo.getDirName().isEmpty()){
throw new ServiceException("400","归属目录不能为空");
}
- if (gameVo.getGameImg().isEmpty()){
- throw new ServiceException("400","大赛图片不能为空");
+
+ // 校验名称是否重复
+ int sum = gameMapper.findByNameAndId(gameVo.getId(),gameVo.getGameName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
}
+
//将vo类转换为实体类
ConvertUtil convertUtil=new ConvertUtil();
Game game = convertUtil.VoToEntity(gameVo, Game.class);
@@ -150,7 +155,7 @@ public class GameServiceImpl extends ServiceImpl implements Ga
//将目录id封装到实体类
game.setDirId(directory.getId());
game.setGameUpdatetime(new Date());
- int update = gameMapper.updateById(game);
+ int update = gameMapper.updateByIdInfo(game);
return update;
}
@@ -182,6 +187,10 @@ public class GameServiceImpl extends ServiceImpl implements Ga
if (directory.getDirName().isEmpty()){
throw new ServiceException("400","目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()){
throw new ServiceException("400","图片不能为空");
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/invite/mapper/InviteMapper.java b/src/main/java/com/zhiyun/zhiyun03/invite/mapper/InviteMapper.java
index cb15c72..0aadbfc 100644
--- a/src/main/java/com/zhiyun/zhiyun03/invite/mapper/InviteMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/invite/mapper/InviteMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.invite.entity.Invite;
import com.zhiyun.zhiyun03.invite.vo.InviteVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -14,4 +15,6 @@ public interface InviteMapper extends BaseMapper {
int selectByName(String inviteName);
int updateDownloadById(Invite invite);
+
+ int findByNameAndId(@Param("id") Integer id,@Param("inviteName") String inviteName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java b/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java
index 215ac6c..3abb5c7 100644
--- a/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java
@@ -131,12 +131,17 @@ public class InviteServieImpl extends ServiceImpl implemen
* */
@Override
public int updateById(InviteVo vo) {
- //查询更新的下载名是否存在
-// int sum = inviteMapper.selectByName(vo.getInviteName());
-// if (sum>0)
-// {
-// throw new ServiceException("403","下载已存在");
-// }
+
+ if (vo.getInviteName().isEmpty())
+ {
+ throw new ServiceException("400","就业名称不能为空");
+ }
+ // 校验名称是否重复
+ int sum = inviteMapper.findByNameAndId(vo.getId(),vo.getInviteName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
+ }
//将vo值传给download
Invite invite = new Invite();
@@ -160,6 +165,10 @@ public class InviteServieImpl extends ServiceImpl implemen
if (directory.getDirName().isEmpty()) {
throw new ServiceException("400", "目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()) {
throw new ServiceException("400", "请选择一个icon");
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/knowledge/mapper/KnowledgeMapper.java b/src/main/java/com/zhiyun/zhiyun03/knowledge/mapper/KnowledgeMapper.java
index 4a4f040..31c49ea 100644
--- a/src/main/java/com/zhiyun/zhiyun03/knowledge/mapper/KnowledgeMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/knowledge/mapper/KnowledgeMapper.java
@@ -4,10 +4,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.knowledge.entity.Knowledge;
import com.zhiyun.zhiyun03.knowledge.vo.KnowledgeVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface KnowledgeMapper extends BaseMapper {
List queryKnowledge();
+
+ int updateByIdInfo(Knowledge knowledge);
+
+ int findByNameAndId(@Param("id") Integer id,@Param("knowledgeName") String knowledgeName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/knowledge/service/impl/KnowledgeServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/knowledge/service/impl/KnowledgeServiceImpl.java
index db36cea..00c8602 100644
--- a/src/main/java/com/zhiyun/zhiyun03/knowledge/service/impl/KnowledgeServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/knowledge/service/impl/KnowledgeServiceImpl.java
@@ -137,9 +137,14 @@ public class KnowledgeServiceImpl extends ServiceImpl
if (knowledgeVo.getDirName().isEmpty()){
throw new ServiceException("400","归属目录不能为空");
}
- if (knowledgeVo.getKnowledgeImg().isEmpty()){
- throw new ServiceException("400","知识图片不能为空");
+ // 校验名称是否重复
+ int sum = knowledgeMapper.findByNameAndId(knowledgeVo.getId(),knowledgeVo.getKnowledgeName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
}
+
+
//将vo类转换为实体类
ConvertUtil convertUtil=new ConvertUtil();
Knowledge knowledge = convertUtil.VoToEntity(knowledgeVo, Knowledge.class);
@@ -150,7 +155,7 @@ public class KnowledgeServiceImpl extends ServiceImpl
//将目录id封装到实体类
knowledge.setDirId(directory.getId());
knowledge.setKnowledgeUpdatetime(new Date());
- int update = knowledgeMapper.updateById(knowledge);
+ int update = knowledgeMapper.updateByIdInfo(knowledge);
return update;
}
@@ -177,6 +182,10 @@ public class KnowledgeServiceImpl extends ServiceImpl
if (directory.getDirName().isEmpty()){
throw new ServiceException("400","目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()){
throw new ServiceException("400","图片不能为空");
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/serve/mapper/ServeMapper.java b/src/main/java/com/zhiyun/zhiyun03/serve/mapper/ServeMapper.java
index bdfc7cb..1239f15 100644
--- a/src/main/java/com/zhiyun/zhiyun03/serve/mapper/ServeMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/serve/mapper/ServeMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.serve.entity.Serve;
import com.zhiyun.zhiyun03.serve.vo.ServeVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -14,4 +15,6 @@ public interface ServeMapper extends BaseMapper {
int selectByName(String serveName);
int updateDownloadById(Serve serve);
+
+ int findByNameAndId(@Param("id") Integer id,@Param("serveName") String serveName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java
index 73ec1f9..d720760 100644
--- a/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java
@@ -147,6 +147,12 @@ public class ServeServiceImpl extends ServiceImpl implements
{
throw new ServiceException("400","服务名不能为空");
}
+ // 校验名称是否重复
+ int sum = serveMapper.findByNameAndId(vo.getId(),vo.getServeName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
+ }
//将vo值传给download
Serve serve = new Serve();
@@ -174,6 +180,10 @@ public class ServeServiceImpl extends ServiceImpl implements
{
throw new ServiceException("400","目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty())
{
throw new ServiceException("400","请选择一个icon");
diff --git a/src/main/java/com/zhiyun/zhiyun03/textual/mapper/TextualMapper.java b/src/main/java/com/zhiyun/zhiyun03/textual/mapper/TextualMapper.java
index 284e9fe..2896580 100644
--- a/src/main/java/com/zhiyun/zhiyun03/textual/mapper/TextualMapper.java
+++ b/src/main/java/com/zhiyun/zhiyun03/textual/mapper/TextualMapper.java
@@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyun.zhiyun03.textual.entity.Textual;
import com.zhiyun.zhiyun03.textual.vo.TextualVo;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TextualMapper extends BaseMapper {
List queryTextual();
+
+ int findByNameAndId(@Param("id") Integer id, @Param("textualName") String textualName);
}
diff --git a/src/main/java/com/zhiyun/zhiyun03/textual/service/impl/TextualServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/textual/service/impl/TextualServiceImpl.java
index 1a55c49..3f521d3 100644
--- a/src/main/java/com/zhiyun/zhiyun03/textual/service/impl/TextualServiceImpl.java
+++ b/src/main/java/com/zhiyun/zhiyun03/textual/service/impl/TextualServiceImpl.java
@@ -131,8 +131,11 @@ public class TextualServiceImpl extends ServiceImpl impl
if (textualVo.getDirName().isEmpty()){
throw new ServiceException("400","归属目录不能为空");
}
- if (textualVo.getTextualImg().isEmpty()){
- throw new ServiceException("400","学术图片不能为空");
+ // 校验名称是否重复
+ int sum = textualMapper.findByNameAndId(textualVo.getId(),textualVo.getTextualName());
+ if (sum>0)
+ {
+ throw new ServiceException("300","课程名已存在");
}
//将vo类转换为实体类
ConvertUtil convertUtil=new ConvertUtil();
@@ -180,6 +183,10 @@ public class TextualServiceImpl extends ServiceImpl impl
if (directory.getDirName().isEmpty()){
throw new ServiceException("400","目录名称不能为空");
}
+ if (directory.getDirName().length()>6)
+ {
+ throw new ServiceException("400","目录名超出限制长度");
+ }
if (directory.getDirIcon().isEmpty()){
throw new ServiceException("400","图片不能为空");
}
diff --git a/src/main/resources/mapper/AcademicMapper.xml b/src/main/resources/mapper/AcademicMapper.xml
index 3c6aaf9..140af7b 100644
--- a/src/main/resources/mapper/AcademicMapper.xml
+++ b/src/main/resources/mapper/AcademicMapper.xml
@@ -1,6 +1,38 @@
+
+ update academic
+
+
+ academic_name = #{academicName},
+
+
+ academic_brief = #{academicBrief},
+
+
+ academic_url = #{academicUrl},
+
+
+ dir_id = #{dirId},
+
+
+ academic_img = #{academicImg},
+
+
+ academic_addtime = #{academicAddtime},
+
+
+ academic_updatetime = #{academicUpdatetime},
+
+
+
+
+ id = #{id}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/ApplicationMapper.xml b/src/main/resources/mapper/ApplicationMapper.xml
index 6511217..0a37091 100644
--- a/src/main/resources/mapper/ApplicationMapper.xml
+++ b/src/main/resources/mapper/ApplicationMapper.xml
@@ -16,4 +16,7 @@
(select * from directory) as d
on c.dir_id = d.id
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/CourseMapper.xml b/src/main/resources/mapper/CourseMapper.xml
index 42f0718..509b1c2 100644
--- a/src/main/resources/mapper/CourseMapper.xml
+++ b/src/main/resources/mapper/CourseMapper.xml
@@ -82,5 +82,9 @@
where course_name = #{courseName}
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/DownloadMapper.xml b/src/main/resources/mapper/DownloadMapper.xml
index ac27d56..bd39b88 100644
--- a/src/main/resources/mapper/DownloadMapper.xml
+++ b/src/main/resources/mapper/DownloadMapper.xml
@@ -16,7 +16,7 @@
dir_id=#{dirId},
-
+
download_img=#{downloadImg}
@@ -43,4 +43,7 @@
select count(1) from download where download_name =#{downloadName}
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/GameMapper.xml b/src/main/resources/mapper/GameMapper.xml
index 3374eee..27a88b4 100644
--- a/src/main/resources/mapper/GameMapper.xml
+++ b/src/main/resources/mapper/GameMapper.xml
@@ -1,6 +1,43 @@
+
+ update game
+
+
+ game_name = #{gameName},
+
+
+ game_brief = #{gameBrief},
+
+
+ game_url = #{gameUrl},
+
+
+ dir_id = #{dirId},
+
+
+ game_img = #{gameImg},
+
+
+ start_time = #{startTime},
+
+
+ end_time = #{endTime},
+
+
+ game_addtime = #{gameAddtime},
+
+
+ game_updatetime = #{gameUpdatetime},
+
+
+
+
+ id = #{id}
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/InviteMapper.xml b/src/main/resources/mapper/InviteMapper.xml
index 790fe6f..47f83bb 100644
--- a/src/main/resources/mapper/InviteMapper.xml
+++ b/src/main/resources/mapper/InviteMapper.xml
@@ -34,4 +34,7 @@
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/KnowledgeMapper.xml b/src/main/resources/mapper/KnowledgeMapper.xml
index d6dac1b..d21bf1b 100644
--- a/src/main/resources/mapper/KnowledgeMapper.xml
+++ b/src/main/resources/mapper/KnowledgeMapper.xml
@@ -1,6 +1,44 @@
+
+ update knowledge
+
+
+ knowledge_name = #{knowledgeName},
+
+
+ knowledge_brief = #{knowledgeBrief},
+
+
+ knowledge_url = #{knowledgeUrl},
+
+
+ dir_id = #{dirId},
+
+
+ knowledge_img = #{knowledgeImg},
+
+
+ knowledge_addtime = #{knowledgeAddtime},
+
+
+ knowledge_updatetime = #{knowledgeUpdatetime},
+
+
+
+
+
+ id = #{id}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/mapper/ServeMapper.xml b/src/main/resources/mapper/ServeMapper.xml
index dca1f1f..5aca0fc 100644
--- a/src/main/resources/mapper/ServeMapper.xml
+++ b/src/main/resources/mapper/ServeMapper.xml
@@ -17,7 +17,7 @@
dir_id=#{dirId},
-
+
serve_img=#{serveImg}
@@ -26,8 +26,6 @@
id = #{id}
-
-
+
+ select count(1) from textual where textual_name =#{textualName} and id != #{id}
+
\ No newline at end of file
diff --git a/src/main/resources/static/layui-v2.6.8/academicList.html b/src/main/resources/static/layui-v2.6.8/academicList.html
index b7f17b3..a065d76 100644
--- a/src/main/resources/static/layui-v2.6.8/academicList.html
+++ b/src/main/resources/static/layui-v2.6.8/academicList.html
@@ -134,6 +134,7 @@
$("#academicUrl").val(data.academicUrl);
$("#dirName").val(data.dirName);
$("#academicImg").val(data.academicImg);
+
//渲染页面
layui.form.render();
},
@@ -372,43 +373,43 @@
-

-
-
-

+
-

+
-

+
-

+
-

+
-

+
-

+
-

+
-

+
-

+
+
+
+
-

+
-

+
@@ -591,6 +592,7 @@
+
-