src/main/java/com/whyc/controller/MailUserController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/pojo/MailUser.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/MailUserService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/MailUserController.java
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RequestMapping("mailUser") @@ -19,7 +20,7 @@ @GetMapping @ApiOperation("查询所有用户") public Response getAll(){ return service.getAll(); public Response getAll(@RequestParam int type){ return service.getAll(type); } } src/main/java/com/whyc/pojo/MailUser.java
@@ -8,6 +8,9 @@ private Integer id; private String user; //1-软件发布,2-sop private Integer type; public Integer getId() { return id; } @@ -23,4 +26,12 @@ public void setUser(String user) { this.user = user; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } } src/main/java/com/whyc/service/MailUserService.java
@@ -1,5 +1,7 @@ package com.whyc.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.whyc.dto.Response; import com.whyc.mapper.MailUserMapper; import com.whyc.pojo.MailUser; @@ -14,8 +16,10 @@ @Resource private MailUserMapper mapper; public Response getAll() { List<MailUser> mailUsers = mapper.selectList(null); public Response getAll(int type) { QueryWrapper<MailUser> query = Wrappers.query(); query.eq("type",type); List<MailUser> mailUsers = mapper.selectList(query); return new Response().set(1,mailUsers); } }