class UserRoleFeignController implements UserRoleFeignClient {

	private static final Logger logger = LoggerFactory.getLogger(UserRoleFeignController.class);

	@Autowired
	private UserRoleMapper userRoleMapper;

	@Override
	@Transactional(rollbackFor = Exception.class)
	@CacheEvict(cacheNames = CacheNames.MENU_ID_LIST_KEY, key = "#userRoleDTO.userId")
	public ServerResponseEntity<Void> saveByUserIdAndSysType(UserRoleDTO userRoleDTO) {

		if(CollUtil.isEmpty(userRoleDTO.getRoleIds())){
			return ServerResponseEntity.success();
		}
		//保存用户与角色关系
		userRoleMapper.insertUserAndUserRole(userRoleDTO.getUserId(), userRoleDTO.getRoleIds());
		return ServerResponseEntity.success();
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	@CacheEvict(cacheNames = CacheNames.MENU_ID_LIST_KEY, key = "#userRoleDTO.userId")
	public ServerResponseEntity<Void> updateByUserIdAndSysType(UserRoleDTO userRoleDTO) {<FILL_FUNCTION_BODY>}

	@Override
	@Transactional(rollbackFor = Exception.class)
	@CacheEvict(cacheNames = CacheNames.MENU_ID_LIST_KEY, key = "#userId")
	public ServerResponseEntity<Void> deleteByUserIdAndSysType(Long userId) {
		userRoleMapper.deleteByUserId(userId);
		return ServerResponseEntity.success();
	}

	@Override
	public ServerResponseEntity<List<Long>> getRoleIds(Long userId) {
		return ServerResponseEntity.success(userRoleMapper.getRoleIds(userId));
	}
}

		//先删除用户与角色关系
		userRoleMapper.deleteByUserId(userRoleDTO.getUserId());

		if(CollUtil.isEmpty(userRoleDTO.getRoleIds())){
			return ServerResponseEntity.success();
		}
		//保存用户与角色关系
		userRoleMapper.insertUserAndUserRole(userRoleDTO.getUserId(), userRoleDTO.getRoleIds());
		return ServerResponseEntity.success();
	
<no_super_class>