feat(sj_1.0.0): 完成通知更新

This commit is contained in:
opensnail 2024-04-21 09:48:05 +08:00
parent 49daf08655
commit 535fe09741

View File

@ -8,6 +8,7 @@ import com.aizuda.snailjob.server.web.model.response.CommonLabelValueResponseVO;
import com.aizuda.snailjob.server.web.model.response.NotifyRecipientResponseVO;
import com.aizuda.snailjob.server.web.service.NotifyRecipientService;
import com.aizuda.snailjob.server.web.service.convert.NotifyRecipientConverter;
import com.aizuda.snailjob.server.web.util.UserSessionUtils;
import com.aizuda.snailjob.template.datasource.persistence.mapper.NotifyRecipientMapper;
import com.aizuda.snailjob.template.datasource.persistence.po.NotifyRecipient;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -48,12 +49,18 @@ public class NotifyRecipientServiceImpl implements NotifyRecipientService {
@Override
public Boolean saveNotifyRecipient(NotifyRecipientRequestVO requestVO) {
return 1 == notifyRecipientMapper.insert(NotifyRecipientConverter.INSTANCE.toNotifyRecipient(requestVO));
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
NotifyRecipient notifyRecipient = NotifyRecipientConverter.INSTANCE.toNotifyRecipient(requestVO);
notifyRecipient.setNamespaceId(namespaceId);
return 1 == notifyRecipientMapper.insert(notifyRecipient);
}
@Override
public Boolean updateNotifyRecipient(NotifyRecipientRequestVO requestVO) {
return 1 == notifyRecipientMapper.updateById(NotifyRecipientConverter.INSTANCE.toNotifyRecipient(requestVO));
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
NotifyRecipient notifyRecipient = NotifyRecipientConverter.INSTANCE.toNotifyRecipient(requestVO);
notifyRecipient.setNamespaceId(namespaceId);
return 1 == notifyRecipientMapper.updateById(notifyRecipient);
}
@Override