Parcourir la source

渠道相关接口

guanglong il y a 3 ans
Parent
commit
5158e03c55

+ 36 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/channel/ChannelController.java

@@ -1,14 +1,22 @@
 package com.qs.mp.web.controller.api.channel;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qs.mp.channel.domain.Channel;
+import com.qs.mp.channel.domain.vo.ChannelVO;
 import com.qs.mp.channel.service.IChannelService;
+import com.qs.mp.common.core.domain.AjaxResult;
 import com.qs.mp.common.core.page.TableDataInfo;
+import com.qs.mp.common.enums.ErrorCodeEnum;
 import com.qs.mp.system.service.id.BizIdGenerator;
 import com.qs.mp.web.controller.common.BaseApiController;
 import io.swagger.annotations.Api;
 import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -44,4 +52,32 @@ public class ChannelController extends BaseApiController {
     List<Channel> list = channelService.list(new LambdaQueryWrapper<Channel>());
     return getDataTable(list);
   }
+  
+  
+  /**
+   * 获取我的下级渠道详情信息
+   *
+   * @param
+   * @return
+   */
+  @PostMapping(value = "subchannel/detail")
+  public AjaxResult getInfo(@RequestBody Channel channel) {
+    if (null == channel || null == channel.getChannelId()) {
+      return error(ErrorCodeEnum.ERROR_CODE_1001);
+    }
+
+    Long channelId = channel.getChannelId();
+    ChannelVO channelVO = new ChannelVO();
+//    try {
+//      Customer queryCustomer = customerService.getById(custId);
+//      BeanUtils.copyProperties(queryCustomer, queryCustomerVO);
+//      int totalShopCnt = shopService.count(new QueryWrapper<Shop>().lambda()
+//          .eq(Shop::getCustId, hostHolder.getUser().getCustId()).in(Shop::getShopType, ShopTypeEnum.getShopTypes()));
+//      queryCustomerVO.setShopNum(totalShopCnt);
+//    } catch (DataOperationException e) {
+//      return AjaxResult.error(e.getCode(), e.getMessage(), null);
+//    }
+    return AjaxResult.success(channelVO);
+  }
+
 }

+ 8 - 0
mp-service/src/main/java/com/qs/mp/channel/service/IChannelService.java

@@ -24,6 +24,14 @@ public interface IChannelService extends IService<Channel> {
 	 * @return
 	 */
 	public List<ChannelVO> selectVoList(Channel channel);
+	
+	/**
+	 * 获取指定渠道信息
+	 * 
+	 * @param channel
+	 * @return
+	 */
+	public ChannelVO getVoById(Long channelId);
 
 	/**
 	 * 根据用户ID查询渠道

+ 9 - 0
mp-service/src/main/java/com/qs/mp/channel/service/impl/ChannelServiceImpl.java

@@ -27,6 +27,15 @@ public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> impl
 
 		return null;
 	}
+	
+	
+	@Override
+	public ChannelVO getVoById(Long channelId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+
 
 	@Override
 	public Channel getChannelByUserId(Long userId) {