| | |
| | |
|
| | |
|
| | | @Override
|
| | | public void switchState(Long id) throws BrandClassException {
|
| | | if (id == null) {
|
| | | throw new BrandClassException(1, "请传递正确参数");
|
| | | }
|
| | | BrandClass resultObj = brandClassMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new BrandClassException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Integer state = resultObj.getState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1;
|
| | | } else {
|
| | | state = 0;
|
| | | }
|
| | | |
| | | BrandClass updateObj = new BrandClass();
|
| | | updateObj.setId(id);
|
| | | updateObj.setState(state);
|
| | | brandClassMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public void updateOrder(Long id, Integer moveType) throws BrandClassException, Exception{
|
| | | if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1)))
|
| | | throw new BrandClassException(1, "传递的类型不正确");
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | |
| | | |
| | | }
|