diff --git a/len-core/len-core.iml b/len-core/len-core.iml index eebaf7e..e2f66ba 100644 --- a/len-core/len-core.iml +++ b/len-core/len-core.iml @@ -15,29 +15,27 @@ - - - - - - + + + + - + - - - - + + + + - - + + @@ -45,28 +43,29 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + @@ -82,13 +81,13 @@ - + - + @@ -101,17 +100,17 @@ - - - - + + + + - + @@ -122,12 +121,12 @@ - - - - + + + + - + @@ -138,15 +137,15 @@ - + - + - - + + diff --git a/len-core/src/main/java/com/len/base/BaseController.java b/len-core/src/main/java/com/len/base/BaseController.java index d3334e6..a868b55 100644 --- a/len-core/src/main/java/com/len/base/BaseController.java +++ b/len-core/src/main/java/com/len/base/BaseController.java @@ -1,5 +1,6 @@ package com.len.base; +import com.len.util.JsonUtil; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.text.SimpleDateFormat; @@ -58,5 +59,4 @@ public abstract class BaseController { } - } diff --git a/len-core/src/main/java/com/len/util/CommonUtil.java b/len-core/src/main/java/com/len/util/CommonUtil.java index 8e8c004..5460aa7 100644 --- a/len-core/src/main/java/com/len/util/CommonUtil.java +++ b/len-core/src/main/java/com/len/util/CommonUtil.java @@ -1,6 +1,10 @@ package com.len.util; +import com.len.base.CurrentUser; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.session.Session; + /** * @author zhuxiaomeng * @date 2017/12/4. @@ -12,13 +16,13 @@ public class CommonUtil { /** * 获取当前用户 - * @return */ - /*public static CurrentUser getUser(){ - Subject subject= SecurityUtils.getSubject(); - Session session=subject.getSession(); - return (CurrentUser)session.getAttribute("sys_user"); - }*/ + public static CurrentUser getUser() { + org.apache.shiro.subject.Subject subject = SecurityUtils.getSubject(); + Session session = subject.getSession(); + return (CurrentUser) session.getAttribute("curentUser"); + } +} /** * 获取权限 @@ -29,6 +33,7 @@ public class CommonUtil { if(user!=null){ } - }*/ + } } +*/ \ No newline at end of file diff --git a/len-core/src/main/java/com/len/util/JsonUtil.java b/len-core/src/main/java/com/len/util/JsonUtil.java index 3746289..fadf96d 100644 --- a/len-core/src/main/java/com/len/util/JsonUtil.java +++ b/len-core/src/main/java/com/len/util/JsonUtil.java @@ -2,6 +2,7 @@ package com.len.util; import com.alibaba.fastjson.JSONObject; +import net.minidev.json.JSONUtil; /** * @author zhuxiaomeng @@ -39,4 +40,20 @@ public class JsonUtil { public void setJosnObj(JSONObject josnObj) { this.josnObj = josnObj; } + + public JsonUtil() { + } + + public JsonUtil(boolean flag, String msg) { + this.flag = flag; + this.msg = msg; + } + + /**restful 返回*/ + public static JsonUtil error(String msg){ + return new JsonUtil(false,msg); + } + public static JsonUtil sucess(String msg){ + return new JsonUtil(true,msg); + } } diff --git a/len-sys/len-sys.iml b/len-sys/len-sys.iml index c4869a0..c09eee8 100644 --- a/len-sys/len-sys.iml +++ b/len-sys/len-sys.iml @@ -16,103 +16,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - - - - + + + + - - + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -128,13 +83,13 @@ - + - + @@ -147,32 +102,33 @@ - - - - + + + + - + + - - - - + + + + - + @@ -183,15 +139,15 @@ - + - + - - + + diff --git a/len-sys/pom.xml b/len-sys/pom.xml index fea9c66..978a0ad 100644 --- a/len-sys/pom.xml +++ b/len-sys/pom.xml @@ -23,12 +23,6 @@ com.len len-core - - junit junit diff --git a/len-sys/src/main/java/com/len/controller/JobController.java b/len-sys/src/main/java/com/len/controller/JobController.java index c80cb52..69e6549 100644 --- a/len-sys/src/main/java/com/len/controller/JobController.java +++ b/len-sys/src/main/java/com/len/controller/JobController.java @@ -120,6 +120,7 @@ public class JobController extends BaseController { @ApiOperation(value = "/del", httpMethod = "POST", notes = "删除任务") @PostMapping(value = "del") @ResponseBody + @RequiresPermissions("job:del") public JsonUtil del(String id){ JsonUtil j=new JsonUtil(); j.setFlag(false); @@ -152,6 +153,7 @@ public class JobController extends BaseController { @Log(desc = "启动任务") @PostMapping(value = "startJob") @ResponseBody + @RequiresPermissions("job:start") public JsonUtil startJob(String id){ JsonUtil j=new JsonUtil(); String msg=null; @@ -176,6 +178,7 @@ public class JobController extends BaseController { @Log(desc = "停止任务") @PostMapping(value = "endJob") @ResponseBody + @RequiresPermissions("job:end") public JsonUtil endJob(String id){ JsonUtil j=new JsonUtil(); String msg=null; diff --git a/len-sys/src/main/java/com/len/controller/RoleController.java b/len-sys/src/main/java/com/len/controller/RoleController.java index 17bd873..dd49a6e 100644 --- a/len-sys/src/main/java/com/len/controller/RoleController.java +++ b/len-sys/src/main/java/com/len/controller/RoleController.java @@ -145,6 +145,7 @@ public class RoleController extends BaseController { @Log(desc = "删除角色",type = LOG_TYPE.DEL) @PostMapping(value = "del") @ResponseBody + @RequiresPermissions("role:del") public String del(String id) { if (StringUtils.isEmpty(id)) { return "获取数据失败"; diff --git a/len-sys/src/main/java/com/len/controller/UserController.java b/len-sys/src/main/java/com/len/controller/UserController.java index 7cfffc0..75cb7b3 100644 --- a/len-sys/src/main/java/com/len/controller/UserController.java +++ b/len-sys/src/main/java/com/len/controller/UserController.java @@ -169,6 +169,7 @@ public class UserController extends BaseController{ @ApiOperation(value = "/del", httpMethod = "POST", notes = "删除用户") @PostMapping(value = "/del") @ResponseBody + @RequiresPermissions("user:del") public String del(String id, boolean flag) { if (StringUtils.isEmpty(id)) { return "获取数据失败"; @@ -219,6 +220,7 @@ public class UserController extends BaseController{ @Log(desc = "修改密码",type = LOG_TYPE.UPDATE) @PostMapping(value = "rePass") @ResponseBody + @RequiresPermissions("user:repass") public JsonUtil rePass(String id,String pass,String newPwd){ boolean flag=StringUtils.isEmpty(id)||StringUtils.isEmpty(pass)||StringUtils.isEmpty(newPwd); JsonUtil j=new JsonUtil(); diff --git a/len-sys/src/main/java/com/len/service/RoleUserService.java b/len-sys/src/main/java/com/len/service/RoleUserService.java index 8f9de8b..c7bc0ef 100644 --- a/len-sys/src/main/java/com/len/service/RoleUserService.java +++ b/len-sys/src/main/java/com/len/service/RoleUserService.java @@ -2,6 +2,7 @@ package com.len.service; import com.len.base.BaseService; import com.len.entity.SysRoleUser; +import java.util.List; /** * @author zhuxiaomeng @@ -16,4 +17,5 @@ public interface RoleUserService extends BaseService{ int selectCountByCondition(SysRoleUser sysRoleUser); + List selectByCondition(SysRoleUser sysRoleUser); } diff --git a/len-sys/src/main/java/com/len/service/impl/RoleUserServiceImpl.java b/len-sys/src/main/java/com/len/service/impl/RoleUserServiceImpl.java index c860b14..c774865 100644 --- a/len-sys/src/main/java/com/len/service/impl/RoleUserServiceImpl.java +++ b/len-sys/src/main/java/com/len/service/impl/RoleUserServiceImpl.java @@ -5,6 +5,7 @@ import com.len.base.impl.BaseServiceImpl; import com.len.entity.SysRoleUser; import com.len.mapper.SysRoleUserMapper; import com.len.service.RoleUserService; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,4 +35,9 @@ public class RoleUserServiceImpl extends BaseServiceImpl imp public int selectCountByCondition(SysRoleUser sysRoleUser) { return sysRoleUserMapper.selectCountByCondition(sysRoleUser); } + + @Override + public List selectByCondition(SysRoleUser sysRoleUser) { + return sysRoleUserMapper.selectByCondition(sysRoleUser); + } } diff --git a/len-sys/src/main/resources/ftl/main/main.ftl b/len-sys/src/main/resources/ftl/main/main.ftl index 3f6dd0f..13d9666 100644 --- a/len-sys/src/main/resources/ftl/main/main.ftl +++ b/len-sys/src/main/resources/ftl/main/main.ftl @@ -9,6 +9,11 @@ + @@ -16,6 +21,7 @@
+
+