diff --git a/src/main/java/com/sincere/wechatbusiness/controller/ChannelController.java b/src/main/java/com/sincere/wechatbusiness/controller/ChannelController.java index e0dff35..f3ccf34 100644 --- a/src/main/java/com/sincere/wechatbusiness/controller/ChannelController.java +++ b/src/main/java/com/sincere/wechatbusiness/controller/ChannelController.java @@ -66,6 +66,22 @@ public class ChannelController { return result; } + @RequestMapping(value="GetAreaList",method = RequestMethod.POST) + @ApiOperation(value = "获取省市") + public BaseDto> GetAreaList(){ + BaseDto> result=new BaseDto<>(); + result.setData(channelService.getAreaList()); + return result; + } + + @RequestMapping(value = "GetTemplateList",method = RequestMethod.POST) + @ApiOperation(value = "获取模板库列表") + public BaseDto> GetTemplateList(){ + BaseDto> result=new BaseDto<>(); + result.setData(channelService.getTemplateList()); + return result; + } + @RequestMapping(value = "AddChannel",method = RequestMethod.POST) @ApiOperation(value = "新增渠道商") public BaseDto AddChannel(@RequestBody Channel channel){ @@ -79,6 +95,14 @@ public class ChannelController { return new BaseDto(); } + @RequestMapping(value = "GetChannelProductList",method = RequestMethod.GET) + @ApiOperation(value = "获取渠道商代理商品列表") + public BaseDto> GetChannelProductList(int id){ + BaseDto> result=new BaseDto<>(); + result.setData(channelProductService.getList(id)); + return result; + } + @RequestMapping(value = "GetChannelDetail",method = RequestMethod.GET) @ApiOperation(value = "获取渠道商详情") public BaseDto GetChannelDetail(int id){ @@ -240,7 +264,7 @@ public class ChannelController { } // 定义 BufferedReader输入流来读取URL的响应 in = new BufferedReader(new InputStreamReader( - connection.getInputStream())); + connection.getInputStream(),"UTF-8")); String line; while ((line = in.readLine()) != null) { result += line; diff --git a/src/main/java/com/sincere/wechatbusiness/mapper/ChannelMapper.java b/src/main/java/com/sincere/wechatbusiness/mapper/ChannelMapper.java index 3d4c54e..449379d 100644 --- a/src/main/java/com/sincere/wechatbusiness/mapper/ChannelMapper.java +++ b/src/main/java/com/sincere/wechatbusiness/mapper/ChannelMapper.java @@ -1,6 +1,8 @@ package com.sincere.wechatbusiness.mapper; +import com.sincere.wechatbusiness.model.Area; import com.sincere.wechatbusiness.model.Channel; +import com.sincere.wechatbusiness.model.Template; import java.util.List; @@ -16,4 +18,12 @@ public interface ChannelMapper { int update(Channel channel); int deleteChannel(int id); + + List getProvince(); + + List getCity(String areaCode); + + List getArea(String areaCode); + + List