|  |  |  | 
|---|
|  |  |  | package com.moral.api.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.moral.api.entity.ManageMenu; | 
|---|
|  |  |  | import com.moral.api.entity.ManageRole; | 
|---|
|  |  |  | import com.moral.api.service.ManageMenuService; | 
|---|
|  |  |  | import com.moral.api.service.ManageRoleMenuService; | 
|---|
|  |  |  | import com.moral.api.service.ManageRoleService; | 
|---|
|  |  |  | import com.moral.constant.ResultMessage; | 
|---|
|  |  |  | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.data.redis.core.RedisTemplate; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Api(tags = {"角色"}) | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/role") | 
|---|
|  |  |  | @RequestMapping("/manageRole") | 
|---|
|  |  |  | public class ManageRoleController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ManageRoleMenuService manageRoleMenuService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private RedisTemplate redisTemplate; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取所有角色", notes = "获取所有角色") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "insertOneManageRole", method = RequestMethod.POST) | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public ResultMessage insertOneManageRole(@RequestBody Map<String, Object> parameters) { | 
|---|
|  |  |  | public ResultMessage insertOneManageRole(@RequestBody Map<String, Object> parameters,HttpServletRequest request) { | 
|---|
|  |  |  | List list = new ArrayList(); | 
|---|
|  |  |  | if (parameters.get("menuIds") != null){ | 
|---|
|  |  |  | String menuIdsStr = parameters.get("menuIds").toString(); | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "getManageRoleByNameFuzzy", method = RequestMethod.GET) | 
|---|
|  |  |  | public ResultMessage getManageRoleByNameFuzzy(HttpServletRequest request) { | 
|---|
|  |  |  | Map<String, Object> parameters = getParametersStartingWith(request, null); | 
|---|
|  |  |  | List<ManageRole> re = manageRoleService.getManageRoleByNameFuzzy(parameters); | 
|---|
|  |  |  | Map<String,Object> re = manageRoleService.getManageRoleByNameFuzzy(parameters); | 
|---|
|  |  |  | return ResultMessage.ok(re); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|