|
@@ -141,16 +141,6 @@ public class BackgroundUserWebhookServiceImpl extends ServiceImpl<BackgroundUser
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void addNewWebhook(AddNewWebhookDTO addNewWebhookDTO) {
|
|
public void addNewWebhook(AddNewWebhookDTO addNewWebhookDTO) {
|
|
- // 参数校验
|
|
|
|
- LambdaQueryWrapper<BackgroundUserProject> eq = new LambdaQueryWrapper<BackgroundUserProject>()
|
|
|
|
- .eq(BackgroundUserProject::getUserId, addNewWebhookDTO.getUserId())
|
|
|
|
- .eq(BackgroundUserProject::getId, addNewWebhookDTO.getProjectId());
|
|
|
|
- BackgroundUserProject backgroundUserProject = backgroundUserProjectService.getOne(eq);
|
|
|
|
- if (null == backgroundUserProject) {
|
|
|
|
- log.error("新增webhook项目id错误:" + addNewWebhookDTO.getProjectId());
|
|
|
|
- throw new BusinessException("parameter error");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
BackgroundUserWebhook backgroundUserWebhook = new BackgroundUserWebhook();
|
|
BackgroundUserWebhook backgroundUserWebhook = new BackgroundUserWebhook();
|
|
BeanUtil.copyProperties(addNewWebhookDTO, backgroundUserWebhook);
|
|
BeanUtil.copyProperties(addNewWebhookDTO, backgroundUserWebhook);
|
|
// 设置回调token
|
|
// 设置回调token
|
|
@@ -177,16 +167,6 @@ public class BackgroundUserWebhookServiceImpl extends ServiceImpl<BackgroundUser
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void editWebhook(EditWebhookDTO editWebhookDTO) {
|
|
public void editWebhook(EditWebhookDTO editWebhookDTO) {
|
|
- // 参数校验
|
|
|
|
- LambdaQueryWrapper<BackgroundUserProject> eq = new LambdaQueryWrapper<BackgroundUserProject>()
|
|
|
|
- .eq(BackgroundUserProject::getUserId, editWebhookDTO.getUserId())
|
|
|
|
- .eq(BackgroundUserProject::getId, editWebhookDTO.getProjectId());
|
|
|
|
- BackgroundUserProject backgroundUserProject = backgroundUserProjectService.getOne(eq);
|
|
|
|
- if (null == backgroundUserProject) {
|
|
|
|
- log.error("编辑webhook项目id错误:" + editWebhookDTO.getProjectId());
|
|
|
|
- throw new BusinessException("parameter error");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
BackgroundUserWebhook backgroundUserWebhook = new BackgroundUserWebhook();
|
|
BackgroundUserWebhook backgroundUserWebhook = new BackgroundUserWebhook();
|
|
BeanUtil.copyProperties(editWebhookDTO, backgroundUserWebhook);
|
|
BeanUtil.copyProperties(editWebhookDTO, backgroundUserWebhook);
|
|
this.baseMapper.updateById(backgroundUserWebhook);
|
|
this.baseMapper.updateById(backgroundUserWebhook);
|