diff --git a/src/main/java/com/lq/cms/service/SysPermissionService.java b/src/main/java/com/lq/cms/service/SysPermissionService.java new file mode 100644 index 0000000..4b3df95 --- /dev/null +++ b/src/main/java/com/lq/cms/service/SysPermissionService.java @@ -0,0 +1,12 @@ +package com.lq.cms.service; + +import com.lq.cms.vo.SysPermissionVo; +import com.lq.entity.SysPermission; + +/** + * @Author: qi + * @Description: + * @Date: Create in 11:59 PM 2019/7/22 + */ +public interface SysPermissionService extends AdminBaseService { +} diff --git a/src/main/java/com/lq/cms/service/impl/SysPermissionServiceImpl.java b/src/main/java/com/lq/cms/service/impl/SysPermissionServiceImpl.java new file mode 100644 index 0000000..1a721c5 --- /dev/null +++ b/src/main/java/com/lq/cms/service/impl/SysPermissionServiceImpl.java @@ -0,0 +1,49 @@ +package com.lq.cms.service.impl; + +import com.lq.cms.service.SysPermissionService; +import com.lq.cms.vo.SysPermissionVo; +import com.lq.code.dao.BaseDao; +import com.lq.code.service.impl.BaseServiceImpl; +import com.lq.dao.SysPermissionDao; +import com.lq.entity.SysPermission; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author: qi + * @Description: + * @Date: Create in 12:06 AM 2019/7/23 + */ +@Service +public class SysPermissionServiceImpl extends BaseServiceImpl implements SysPermissionService{ + + @Autowired + private SysPermissionDao sysPermissionDao; + + @Override + public List findListPage(SysPermissionVo vo) { + return null; + } + + @Override + public int count(SysPermissionVo vo) { + return 0; + } + + @Override + public SysPermission save(SysPermissionVo vo) throws IllegalAccessException, InstantiationException { + return null; + } + + @Override + public SysPermission update(SysPermissionVo vo) { + return null; + } + + @Override + public BaseDao getBaseDao() { + return sysPermissionDao; + } +} diff --git a/src/main/java/com/lq/cms/vo/SysPermissionVo.java b/src/main/java/com/lq/cms/vo/SysPermissionVo.java new file mode 100644 index 0000000..21e59ac --- /dev/null +++ b/src/main/java/com/lq/cms/vo/SysPermissionVo.java @@ -0,0 +1,10 @@ +package com.lq.cms.vo; + +/** + * @Author: qi + * @Description: + * @Date: Create in 11:27 PM 2019/7/22 + */ +public class SysPermissionVo extends AdminBaseVo { + +} diff --git a/src/main/java/com/lq/cms/web/sys/PermissionController.java b/src/main/java/com/lq/cms/web/sys/PermissionController.java new file mode 100644 index 0000000..f1c614f --- /dev/null +++ b/src/main/java/com/lq/cms/web/sys/PermissionController.java @@ -0,0 +1,66 @@ +package com.lq.cms.web.sys; + +import com.lq.cms.mode.AdminDataGridParam; +import com.lq.cms.service.SysPermissionService; +import com.lq.cms.vo.SysPermissionVo; +import com.lq.code.entity.AjaxResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * @Author: qi + * @Description:权限控制类 + * @Date: Create in 11:21 PM 2019/7/22 + */ +@Controller +@RequestMapping("/cms/permission") +public class PermissionController { + + @Autowired + private SysPermissionService sysPermissionService; + + @RequestMapping("/index") + public String index(){ + + return "cms/sys/permission/index"; + } + + @RequestMapping("/edit") + public String edit(){ + + return "cms/sys/permission/edit"; + } + + @RequestMapping("/list") + @ResponseBody + public Object list(SysPermissionVo vo){ + AdminDataGridParam adminDataGridParam = new AdminDataGridParam<>(); + adminDataGridParam.setRows(sysPermissionService.findListPage(vo)); + adminDataGridParam.setTotal(sysPermissionService.count(vo)); + return adminDataGridParam; + } + + @RequestMapping("/save") + @ResponseBody + public Object save(SysPermissionVo vo){ + + return new AjaxResult(); + } + + @RequestMapping("/update") + @ResponseBody + public Object update(SysPermissionVo vo){ + + return new AdminDataGridParam(); + } + + @RequestMapping("/delete") + @ResponseBody + public Object delete(SysPermissionVo vo){ + + return new AdminDataGridParam(); + } + +} diff --git a/src/main/java/com/lq/code/util/mybatisPlus/CreateMapperFileUtil.java b/src/main/java/com/lq/code/util/mybatisPlus/CreateMapperFileUtil.java index 73ff982..f34bea0 100755 --- a/src/main/java/com/lq/code/util/mybatisPlus/CreateMapperFileUtil.java +++ b/src/main/java/com/lq/code/util/mybatisPlus/CreateMapperFileUtil.java @@ -4,8 +4,10 @@ import com.lq.code.util.FileUtil; import com.lq.code.util.sql.AbstractDbBuiler; import com.lq.code.util.sql.MysqlBuilder; import com.lq.code.util.sql.SqlUtil; +import com.lq.dao.SysPermissionDao; import com.lq.dao.WechatKeywordDao; import com.lq.dao.WechatRuleMessageDao; +import com.lq.entity.SysPermission; import com.lq.entity.WechatKeyword; import com.lq.entity.WechatRuleMessage; @@ -63,7 +65,7 @@ public class CreateMapperFileUtil { public static void main(String[] args) throws IOException { AbstractDbBuiler abstractDbBuiler = new MysqlBuilder(); - createXml(WechatRuleMessageDao.class, WechatRuleMessage.class,abstractDbBuiler); + createXml(SysPermissionDao.class, SysPermission.class,abstractDbBuiler); } diff --git a/src/main/java/com/lq/dao/SysPermissionDao.java b/src/main/java/com/lq/dao/SysPermissionDao.java index a7597f4..1383fb0 100755 --- a/src/main/java/com/lq/dao/SysPermissionDao.java +++ b/src/main/java/com/lq/dao/SysPermissionDao.java @@ -1,12 +1,18 @@ package com.lq.dao; +import com.lq.cms.vo.SysPermissionVo; import com.lq.code.dao.BaseDao; import com.lq.entity.SysPermission; +import java.util.List; + /** * Created by qi on 2017-11-29. */ public interface SysPermissionDao extends BaseDao{ + List findListPage(SysPermissionVo vo); + + int count(SysPermissionVo vo); } diff --git a/src/main/resources/mybatis/mapping/SysPermissionDao.xml b/src/main/resources/mybatis/mapping/SysPermissionDao.xml index 0c5f5e2..867f1bd 100644 --- a/src/main/resources/mybatis/mapping/SysPermissionDao.xml +++ b/src/main/resources/mybatis/mapping/SysPermissionDao.xml @@ -1,29 +1,68 @@ - - - - + + - id,name,status + permission_type,permission_key,name,sys_resource_id,id,status - + SELECT + FROM sys_permission + WHERE id=#{id} AND status = 1 + + + + + - + - + SELECT LAST_INSERT_ID() INSERT INTO - sys_permission(name) + sys_permission(permission_type,permission_key,name,sys_resource_id,id,status) VALUES - ( - #{name} - ) + ( + #{permissionType},#{permissionKey},#{name},#{sysResourceId},#{id},#{status} + ) + + + + UPDATE + sys_permission + + + permission_type=#{permissionType}, + permission_key=#{permissionKey}, + name=#{name}, + sys_resource_id=#{sysResourceId}, + id=#{id}, + status=#{status}, + + WHERE + id=#{id} + + + + UPDATE + sys_permission + SET + status = 0 + WHERE + id=#{id} + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/sys/permission/edit.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/sys/permission/edit.jsp new file mode 100755 index 0000000..1d62fd7 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/jsp/cms/sys/permission/edit.jsp @@ -0,0 +1,122 @@ +<%-- + Created by IntelliJ IDEA. + User: qi_liang + Date: 2018/1/28 + Time: 下午10:03 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ include file="../../../common/import-tag.jsp"%> + + + + 编辑 + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
上级目录: + +
路径:
排序:
目录名称:
目录图标: + + +
+
+ + + diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/sys/permission/index.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/sys/permission/index.jsp new file mode 100755 index 0000000..d2d09d7 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/jsp/cms/sys/permission/index.jsp @@ -0,0 +1,167 @@ +<%-- + Created by IntelliJ IDEA. + User: qi_liang + Date: 2018/1/25 + Time: 下午10:46 + To change this template use File | Settings | File Templates. +--%> + +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ include file="../../../common/import-tag.jsp" %> + + + + + 菜单列表 + + + + + + + +
+
+ + +