| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.exception.AuthException; |
| | | import com.yuanchu.limslaboratory.mapper.MenuMapper; |
| | | import com.yuanchu.limslaboratory.mapper.RoleManageMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Menu; |
| | |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | | import com.yuanchu.limslaboratory.utils.JsonUtil; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | * @Date 2023/8/23 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class RoleManagerServiceImpl implements RoleManagerService { |
| | | |
| | | @Resource |
| | |
| | | ,createTime |
| | | )); |
| | | }); |
| | | if(roleMenuList.size()<1){ |
| | | roleMenuList.add(new RoleMenu(null,nextId,39L,true,false,false,false,createTime)); |
| | | } |
| | | //roleMenuAddList.forEach(System.out::println); |
| | | int i = roleManageMapper.insertBatchRoleMenu(roleMenuList); |
| | | return insert>0&&i>0; |
| | |
| | | public Map<String, Object> getUrlType(String url) { |
| | | String type=null; |
| | | Map<String, Object> stringIntegerMap = roleManageMapper.selctInterFaceType(url); |
| | | if(Objects.isNull(stringIntegerMap)){ |
| | | log.warn("没有====》"+url+"请求资源"); |
| | | throw new AuthException("403","没有该资源"); |
| | | } |
| | | String of = String.valueOf(stringIntegerMap.get("type")); |
| | | switch (of) { |
| | | case "0": |
| | |
| | | break; |
| | | } |
| | | stringIntegerMap.put("type",type); |
| | | System.out.println(type); |
| | | return stringIntegerMap; |
| | | } |
| | | |