123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- package com.qs.mp.api;
- import java.math.BigDecimal;
- import java.util.HashMap;
- import java.util.Map;
- import org.junit.jupiter.api.Test;
- import com.alibaba.fastjson.JSON;
- import com.qs.mp.common.BaseControllerTest;
- /**
- * @auther duota
- * @create 2021 2021/9/7 6:36 下午
- * @describe
- */
- public class ChannelControllerTest extends BaseControllerTest {
- /**
- * 获取我的下级渠道列表信息,支持翻页
- * 调用场景:渠道端查询子渠道列表
- */
- @Test
- public void testGetSubChannelList() {
- Map<String, Object> map = new HashMap<String, Object>();
- int pageNum = 1;
- int pageSize = 10;
- map.put("pageNum", pageNum);
- map.put("pageSize", pageSize);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/subchannel/list?";
- System.out.println(request(url, params));
- }
- /**
- * 获取我的下级渠道详情信息
- * 调用场景:渠道端查询子渠道详情
- */
- @Test
- public void testGetChannelDetail() {
- String channelId = "4";
- String params = "{\"channelId\":\"" + channelId + "\"}";
- String url = "http://localhost:8080/api/v1/mp/channel/subchannel/detail?";
- System.out.println(request(url, params));
- }
- /**
- * 渠道端新增子渠道
- * 调用场景:渠道端新增子渠道
- */
- @Test
- public void testSubChannelAdd() {
- String mobile = "15112682431";
- String name = "西湖渠道";
- Long provinceId = 330000000000L;
- String province = "浙江省";
- Long cityId = 330100000000L;
- String city = "杭州市";
- Long areaId = 330106000000L;
- String area = "西湖区";
- BigDecimal commRate = new BigDecimal(10);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("mobile", mobile);
- map.put("name", name);
- map.put("provinceId", provinceId);
- map.put("province", province);
- map.put("cityId", cityId);
- map.put("city", city);
- map.put("areaId", areaId);
- map.put("area", area);
- map.put("commRate", commRate);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/subchannel/create?";
- System.out.println(request(url, params));
- }
- /**
- * 渠道端编辑子渠道信息
- * 调用场景:渠道端编辑子渠道信息
- */
- @Test
- public void testSubChannelEdit() {
- Long channelId = 2L;
- String mobile = "15112682435";
- String name = "西湖渠道";
- Long provinceId = 330000000000L;
- String province = "浙江省";
- Long cityId = 330100000000L;
- String city = "杭州市";
- Long areaId = 330106000000L;
- String area = "西湖区";
- BigDecimal commRate = new BigDecimal(10);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("channelId", channelId);
- map.put("mobile", mobile);
- map.put("name", name);
- map.put("provinceId", provinceId);
- map.put("province", province);
- map.put("cityId", cityId);
- map.put("city", city);
- map.put("areaId", areaId);
- map.put("area", area);
- map.put("commRate", commRate);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/subchannel/update?";
- System.out.println(request(url, params));
- }
-
-
- /**
- * 获取当前用户渠道或者某个子渠道的经营数据
- * 调用场景:渠道端首页查询当前渠道经营数据、子渠道详情页面查询经营数据
- */
- @Test
- public void testGetSubChannelOperData() {
- Long channelId = 1L;
- int days =1;
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("channelId", channelId);
- map.put("days", days);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/subchannel/operdata/query?";
- System.out.println(request(url, params));
- }
-
- /**
- * 获取子渠道的经营数据列表
- * 调用场景:渠道端首页子渠道经营数据列表
- */
- @Test
- public void testGetSubChannelOperDataList() {
- int days =1;
- int pageNum = 1;
- int pageSize = 10;
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("days", days);
- map.put("pageNum", pageNum);
- map.put("pageSize", pageSize);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/subchannel/operdata/list?";
- System.out.println(request(url, params));
- }
-
-
- /**
- * 获取我的经销商列表信息,支持翻页
- * 调用场景:渠道端查询经销商列表
- */
- @Test
- public void testGetSiteList() {
- Map<String, Object> map = new HashMap<String, Object>();
- int pageNum = 1;
- int pageSize = 10;
- String certifyStatus = "y";
- String verifyStatus = "wait";
- map.put("pageNum", pageNum);
- map.put("pageSize", pageSize);
- map.put("certifyStatus", certifyStatus);
- map.put("verifyStatus", verifyStatus);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/site/list?";
- System.out.println(request(url, params));
- }
- /**
- * 获取我的经销商详情信息
- * 调用场景:渠道端查询经销商详情
- */
- @Test
- public void testGetSiteDetail() {
- String channelId = "1";
- String params = "{\"channelId\":\"" + channelId + "\"}";
- String url = "http://localhost:8080/api/v1/mp/channel/site/detail?";
- System.out.println(request(url, params));
- }
- /**
- * 新增经销商信息
- * 调用场景:渠道端新增经销商
- */
- @Test
- public void testSiteAdd() {
- String mobile = "15112682436";
- String name = "西湖第一经销商";
- String contact = "张三";
- Long provinceId = 330000000000L;
- String province = "浙江省";
- Long cityId = 330100000000L;
- String city = "杭州市";
- Long areaId = 330106000000L;
- String area = "西湖区";
- String address = "趵突泉往前100米";
- BigDecimal commRate = new BigDecimal(10);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("mobile", mobile);
- map.put("name", name);
- map.put("contact", contact);
- map.put("provinceId", provinceId);
- map.put("province", province);
- map.put("cityId", cityId);
- map.put("city", city);
- map.put("areaId", areaId);
- map.put("area", area);
- map.put("address", address);
- map.put("commRate", commRate);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/site/create?";
- System.out.println(request(url, params));
- }
- /**
- * 渠编辑经销商信息
- * 调用场景:渠道端编辑经销商信息
- */
- @Test
- public void testSiteEdit() {
- Long channelId = 2L;
- String mobile = "15112682436";
- String name = "西湖第一经销商";
- String contact = "张三";
- Long provinceId = 330000000000L;
- String province = "浙江省";
- Long cityId = 330100000000L;
- String city = "杭州市";
- Long areaId = 330106000000L;
- String area = "西湖区";
- String address = "趵突泉往前100米";
- BigDecimal commRate = new BigDecimal(10);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("channelId", channelId);
- map.put("mobile", mobile);
- map.put("contact", contact);
- map.put("provinceId", provinceId);
- map.put("province", province);
- map.put("cityId", cityId);
- map.put("city", city);
- map.put("areaId", areaId);
- map.put("area", area);
- map.put("address", address);
- map.put("commRate", commRate);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/site/update?";
- System.out.println(request(url, params));
- }
-
-
- /**
- * 经销商认证审核
- * 调用场景:渠道端审核经销商认证
- */
- @Test
- public void testSiteVerify() {
- Long channelId = 2L;
- String verifyStatus = "accept";
- String memo = "备注,拒绝时必填";
- BigDecimal commRate = new BigDecimal(10); // 分润比例,通过时必填
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("channelId", channelId);
- map.put("verifyStatus", verifyStatus);
- map.put("memo", memo);
- map.put("commRate", commRate);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/site/verify?";
- System.out.println(request(url, params));
- }
-
-
- /**
- * 提交认证
- * 调用场景:经销商认证页面点提交
- */
- @Test
- public void testSiteVerifySubmit() {
- Long channelId = 2L;
- String contact = "张三";
- String siteType = "1";
- Long provinceId = 330000000000L;
- String province = "浙江省";
- Long cityId = 330100000000L;
- String city = "杭州市";
- Long areaId = 330106000000L;
- String area = "西湖区";
- String address = "趵突泉往前100米";
- String bizLicensePic = "111.png"; // 营业执照,多张图用逗号隔开
- String doorPic = "222.png";// 门店照片,多张图用逗号隔开
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("channelId", channelId);
- map.put("contact", contact);
- map.put("siteType", siteType);
- map.put("provinceId", provinceId);
- map.put("province", province);
- map.put("cityId", cityId);
- map.put("city", city);
- map.put("areaId", areaId);
- map.put("area", area);
- map.put("address", address);
- map.put("bizLicensePic", bizLicensePic);
- map.put("doorPic", doorPic);
- String params = JSON.toJSONString(map);
- System.out.println("params = " + params);
- String url = "http://localhost:8080/api/v1/mp/channel/site/verify/submit?";
- System.out.println(request(url, params));
- }
-
-
- /**
- * 查看我的渠道信息
- * 调用场景:渠道端我的里面点击佣金比例
- */
- @Test
- public void testGetMineDetail() {
- String params = "{}";
- String url = "http://localhost:8080/api/v1/mp/channel/mine/detail?";
- System.out.println(request(url, params));
- }
- }
|