From bde8f15d63623419b483d316d97bcea868849947 Mon Sep 17 00:00:00 2001 From: whb <17803890193@163.com> Date: Fri, 18 Aug 2023 18:03:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=BD=92=E5=B1=9E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invite/service/impl/InviteServieImpl.java | 95 +++++++++---------- .../templates/layui-v2.6.8/index.html | 5 +- .../templates/layui-v2.6.8/inviteList.html | 20 ++-- .../templates/layui-v2.6.8/password.html | 13 +++ 4 files changed, 66 insertions(+), 67 deletions(-) create mode 100644 src/main/resources/templates/layui-v2.6.8/password.html 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 8322f33..4ee4f06 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 @@ -39,12 +39,11 @@ public class InviteServieImpl extends ServiceImpl implemen @Override public PageVO queryInvite(Integer page, Integer limit) { - PageHelper.startPage(page,limit); + PageHelper.startPage(page, limit); //查询所有课程 - List inviteVoList = inviteMapper.queryInvite(); - if (inviteVoList.isEmpty()) - { - throw new ServiceException("400","课程数据为空"); + List inviteVoList = inviteMapper.queryInvite(); + if (inviteVoList.isEmpty()) { + throw new ServiceException("400", "课程数据为空"); } PageInfo pageInfo = new PageInfo(inviteVoList); PageVO inviteVoPageVO = new PageVO<>(); @@ -58,6 +57,7 @@ public class InviteServieImpl extends ServiceImpl implemen return inviteVoPageVO; } + /* * 根据id查询就业 * */ @@ -69,7 +69,7 @@ public class InviteServieImpl extends ServiceImpl implemen Directory directory = directoryMapper.selectById(invite.getDirId()); InviteVo inviteVo = new InviteVo(); //复制给vo - BeanUtils.copyProperties(invite,inviteVo); + BeanUtils.copyProperties(invite, inviteVo); inviteVo.setDirName(directory.getDirName()); return inviteVo; } @@ -80,54 +80,48 @@ public class InviteServieImpl extends ServiceImpl implemen @Override public int addInvite(InviteVo vo) { /*判断目录名是否为空*/ - if (vo.getInviteName().isEmpty()) - { - throw new ServiceException("400","就业名不能为空"); + if (vo.getInviteName().isEmpty()) { + throw new ServiceException("400", "就业名不能为空"); } //查询就业名称是否已经存在 - int count = inviteMapper.selectByName(vo.getInviteName()); - if (count>0) - { - throw new ServiceException("403","就业名已存在"); + int count = inviteMapper.selectByName(vo.getInviteName()); + if (count > 0) { + throw new ServiceException("403", "就业名已存在"); } //将vo值传给就业 Invite invite = new Invite(); - BeanUtils.copyProperties(vo,invite); + BeanUtils.copyProperties(vo, invite); //查询归属目录id - Integer dirId = directoryMapper.selectByName(vo.getDirName(),"8"); - if (dirId==null){ - throw new ServiceException("400","目录不存在"); + Integer dirId = directoryMapper.selectByName(vo.getDirName(), "8"); + if (dirId == null) { + throw new ServiceException("400", "目录不存在"); } invite.setDirId(dirId); invite.setInviteUpdatetime(new Date()); //添加就业 int insert = inviteMapper.insert(invite); - if (insert>0) - { + if (insert > 0) { return insert; - }else - { - throw new ServiceException("400","添加就业失败"); + } else { + throw new ServiceException("400", "添加就业失败"); } } + /* * 根据id删除数据 * */ @Override public int delInviteById(Integer id) { - if (id == null) - { - throw new ServiceException("400","查询id值为空"); + if (id == null) { + throw new ServiceException("400", "查询id值为空"); } //根据id删除 int count = inviteMapper.deleteById(id); - if (count>0) - { + if (count > 0) { return count; - }else - { - throw new ServiceException("400","删除失败"); + } else { + throw new ServiceException("400", "删除失败"); } } @@ -145,48 +139,45 @@ public class InviteServieImpl extends ServiceImpl implemen //将vo值传给download Invite invite = new Invite(); - BeanUtils.copyProperties(vo,invite); + BeanUtils.copyProperties(vo, invite); //查询归属目录id - Integer dirId = directoryMapper.selectByName(vo.getDirName(),"8"); + Integer dirId = directoryMapper.selectByName(vo.getDirName(), "8"); invite.setDirId(dirId); invite.setInviteUpdatetime(new Date()); //添加download int updated = inviteMapper.updateDownloadById(invite); - if (updated>0) - { + if (updated > 0) { return updated; - }else - { - throw new ServiceException("400","更新失败"); + } else { + throw new ServiceException("400", "更新失败"); } } -/*添加目录*/ + + /*添加目录*/ @Override public void addInviteDirectory(Directory directory) { - if (directory.getDirName().isEmpty()) - { - throw new ServiceException("400","目录名称不能为空"); + if (directory.getDirName().isEmpty()) { + throw new ServiceException("400", "目录名称不能为空"); } - if (directory.getDirImg().isEmpty()) - { - throw new ServiceException("400","请选择一个icon"); + if (directory.getDirImg().isEmpty()) { + throw new ServiceException("400", "请选择一个icon"); } - Integer count = directoryMapper.selectByName(directory.getDirName(),"8"); - if (count!=null) - { - throw new ServiceException("400","目录已存在"); + Integer count = directoryMapper.selectByName(directory.getDirName(), "8"); + if (count != null) { + throw new ServiceException("400", "目录已存在"); } - int uuid= UUID.randomUUID().hashCode(); - if(uuid<0){ - uuid=-uuid; + int uuid = UUID.randomUUID().hashCode(); + if (uuid < 0) { + uuid = -uuid; } directory.setDirAddtime(new Date()); directory.setId(uuid); directoryMapper.addInviteDirectory(directory); } -/*查询目录*/ + + /*查询目录*/ @Override public List queryInviteDirectory() { diff --git a/src/main/resources/templates/layui-v2.6.8/index.html b/src/main/resources/templates/layui-v2.6.8/index.html index 4f275bd..bdd9e6d 100644 --- a/src/main/resources/templates/layui-v2.6.8/index.html +++ b/src/main/resources/templates/layui-v2.6.8/index.html @@ -17,9 +17,8 @@ tester
-
Your Profile
-
Settings
-
Sign out
+
修改密码
+
退出登录
  • diff --git a/src/main/resources/templates/layui-v2.6.8/inviteList.html b/src/main/resources/templates/layui-v2.6.8/inviteList.html index 03b12d1..d75dcca 100644 --- a/src/main/resources/templates/layui-v2.6.8/inviteList.html +++ b/src/main/resources/templates/layui-v2.6.8/inviteList.html @@ -8,7 +8,7 @@ - + - -
    - + @@ -124,16 +122,16 @@ //获取要删除的服务的id var deleteDownloadId = data.id $.get("http://localhost:8080/api/invite/delInviteById", { "id": deleteDownloadId }, function (result) { - if (result.code == 200) { + if (result.code==200){ // 删除成功之后 弹出msg - layer.msg(result.msg) + layer.msg(result.msg); // 重点:继续显示当前页 - $(".layui-laypage-btn").click() + $(".layui-laypage-btn").click(); } else { - layer.msg(result.msg, { icon: 2 }) - layer.close(index) + layer.msg(result.msg, {icon: 2}); + layer.close(index); } - }) + }); }) } else if (obj.event === 'edit') { @@ -294,7 +292,6 @@ - -