diff --git a/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java b/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java index 8dcbf13ca..98984d28d 100644 --- a/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java +++ b/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java @@ -18,10 +18,12 @@ import com.github.pagehelper.PageInfo; import com.simple.common.ResultData; import com.simple.domain.dto.WxCuerBasicInfoDto; import com.simple.domain.po.WxCUser; +import com.simple.domain.po.WxUserChannel; import com.simple.domain.vo.UserStructureVo; import com.simple.enums.EnumAgeInfo; import com.simple.service.WxCUserBasicInfoService; import com.simple.service.WxCUserService; +import com.simple.service.WxUserChannelService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -38,6 +40,8 @@ public class WxUserStructureController { @Autowired private WxCUserService wxCUserService; + @Autowired + private WxUserChannelService wxUserChannelService; @ApiOperation("查询会员性别结构") @GetMapping("/findUserSexStructure") @@ -163,10 +167,21 @@ public class WxUserStructureController { @ApiImplicitParams({ @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) - private ResultData findUserByChannel(String channelName,Integer pageNum, Integer pageSize) { + public ResultData findUserByChannel(String channelName,Integer pageNum, Integer pageSize) { PageInfo list = wxCUserService.listByChannel(null, pageNum, pageSize); return new ResultData(list); } + + @ApiOperation("获取用户所有渠道") + @GetMapping("/findAllUserChannel") + public ResultData findAllUserChannel() { + List channels=wxUserChannelService.findDistinctChannel(); + List vos = new ArrayList<>(); + for(WxUserChannel w:channels) { + vos.add(w.getChannelName()); + } + return new ResultData(vos); + } private long getCountByAge(EnumAgeInfo a,Calendar c, WxCuerBasicInfoDto dto ) {