Commit e5bc2125 authored by lcl's avatar lcl

逻辑添加:推送电话重复验证

parent 76748b42
package com.dsk.web.controller.system; package com.dsk.web.controller.system;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
...@@ -11,6 +12,8 @@ import com.dsk.system.service.ISysPushService; ...@@ -11,6 +12,8 @@ import com.dsk.system.service.ISysPushService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 系统推送(SysPush)表控制层 * 系统推送(SysPush)表控制层
* *
...@@ -39,6 +42,10 @@ public class SysPushController extends BaseController { ...@@ -39,6 +42,10 @@ public class SysPushController extends BaseController {
*/ */
@PostMapping @PostMapping
public R<Void> add(@RequestBody SysPush bean) { public R<Void> add(@RequestBody SysPush bean) {
List<SysPush> list = baseService.list(Wrappers.<SysPush>lambdaQuery().eq(SysPush::getContact, bean.getContact()));
if(CollectionUtils.isNotEmpty(list)){
return R.fail("当前推送电话已存在!");
}
return toAjax(baseService.save(bean)); return toAjax(baseService.save(bean));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment