class SmsServiceImpl implements SmsService {

    @Override
    @Transactional
    public void updateSign(Integer id, String newSign, Integer platform) {
        // 避免重复
        SmsSignDO smsSignDO = smsSignMapper.selectOne(
                new QueryWrapper<SmsSignDO>()
                        .eq("sign", newSign)
                        .eq("platform", platform));

        if (smsSignDO != null) {
            throw new ServiceException(AdminErrorCodeEnum.SMS_SIGN_IS_EXISTENT.getCode(),
                    AdminErrorCodeEnum.SMS_SIGN_IS_EXISTENT.getMessage());
        }

        // 更新
        smsSignMapper.update(
                (SmsSignDO) new SmsSignDO()
                        .setSign(newSign)
                        .setPlatform(platform)
                        .setUpdateTime(new Date()),
                new QueryWrapper<SmsSignDO>().eq("id", id)
        );
    }

}