| | |
| | | |
| | | @Autowired |
| | | private LabelsMapper labelsMapper; |
| | | |
| | | @Override |
| | | public Integer create(Labels labels) { |
| | | LoginUserInfo user= (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | || StringUtils.isEmpty(labels.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(labelsMapper.selectCount(new QueryWrapper<Labels>().lambda().eq(Labels::getIsdeleted,Constants.ZERO).eq(Labels::getStatus,Constants.ZERO))>=5){ |
| | | if(labelsMapper.selectCount(new QueryWrapper<Labels>().lambda().eq(Labels::getIsdeleted,Constants.ZERO).eq(Labels::getStatus,Constants.ZERO))>=50){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,最多配置50个标签~"); |
| | | } |
| | | labelsMapper.delete(new QueryWrapper<Labels>().lambda().eq(Labels::getName,labels.getName())); |