| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void switchState(Long id) throws SpecialException {
|
| | | if (id == null) {
|
| | | throw new SpecialException(1, "请传递正确参数");
|
| | | }
|
| | | |
| | | Special resultObj = specialMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new SpecialException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Long state = resultObj.getState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1L;
|
| | | } else {
|
| | | state = 0L;
|
| | | }
|
| | | |
| | | Special updateObj = new Special();
|
| | | updateObj.setId(id);
|
| | | updateObj.setState(state);
|
| | | specialMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | | |
| | | }
|