Commit 4561cdc7 by tyfanchz

删除无用方法和接口

1 parent 7c8ba50e
......@@ -112,18 +112,6 @@ public class ProductController {
}
/**
* 校验商城商品 id。
*
* @param shopProductId 商品 id
* @return 商品 id 是否合法
*/
@RequestMapping(value = "/checkShopProductId", method = {RequestMethod.GET, RequestMethod.POST})
public Boolean checkShopProductId(String shopProductId) {
log.info("$$$$ /product/checkShopProductId param: {}", shopProductId);
return productService.checkShopProductId(shopProductId);
}
/**
* 上下架产品。
*
* @param id 产品 id
......
......@@ -74,17 +74,6 @@ public class ProductTypeController {
}
/**
* 获取商城标签。
*
* @return 结果
*/
@RequestMapping(value = "/getShopTagList", method = {RequestMethod.GET, RequestMethod.POST})
public List<String> getShopTagList() {
log.info("$$$$ /productType/getShopTagList ...");
return productTypeService.getShopTagList();
}
/**
* 根据id列表获取指令执行内容
*
* @return 结果
......
......@@ -31,7 +31,5 @@ public interface SmartProductService {
List<SmartDeviceOrder> getCommandSetById(Long id);
Boolean checkShopProductId(String shopProductId);
Boolean putOnOff(Long id);
}
......@@ -21,8 +21,6 @@ public interface SmartProductTypeService {
Boolean save(SmartProductType productType);
List<String> getShopTagList();
List<SmartProductType> getListAndContent(List<Long> list);
List<SmartProductType> getListAndCondition(List<Long> list);
......
......@@ -3,9 +3,7 @@ package com.glsx.smart.service.impl;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -18,10 +16,8 @@ import com.glsx.smart.dao.mapper.SmartProductMapper;
import com.glsx.smart.dao.mapper.SmartSysCodeMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.pojo.DjApiDTO;
import com.glsx.smart.service.BaseService;
import com.glsx.smart.service.SmartProductService;
import com.glsx.smart.utils.DjApiInvoker;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -204,22 +200,6 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
}
/**
* 校验商城商品 id。
*
* @param shopProductId 商品 id
* @return 商品 id 是否合法
*/
@Override
public Boolean checkShopProductId(String shopProductId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("id", shopProductId);
DjApiDTO djApiDTO = DjApiInvoker.of().postForResult(
DjApiInvoker.DjApiMethod.CHECK_SHOP_PRODUCT_ID, paramMap);
boolean valid = "0".equals(djApiDTO.getCode()) && djApiDTO.getData() != null;
return valid;
}
/**
* 上下架产品。
*
* @param id 产品 id
......
package com.glsx.smart.service.impl;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartProductType;
import com.glsx.smart.dao.mapper.SmartProductTypeMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.pojo.DjApiDTO;
import com.glsx.smart.service.BaseService;
import com.glsx.smart.service.SmartProductTypeService;
import com.glsx.smart.utils.DjApiInvoker;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -116,25 +109,4 @@ public class SmartProductTypeServiceImpl extends BaseService implements SmartPro
public List<SmartProductType> getListAndCondition(List<Long> list) {
return productTypeMapper.getListAndCondition(list);
}
/**
* 获取商城标签。
*
* @return 结果
*/
@Override
public List<String> getShopTagList() {
List<String> shopTagList = new ArrayList<>();
DjApiDTO djApiDTO = DjApiInvoker.of().postForResult(
DjApiInvoker.DjApiMethod.GET_SHOP_TAGS, new HashMap<>());
String data = djApiDTO.getData();
if ("0".equals(djApiDTO.getCode()) && data != null) {
JSONArray dataList = JSON.parseArray(data);
for (int i = 0; i < dataList.size(); i++) {
JSONObject obj = dataList.getJSONObject(i);
shopTagList.add(obj.getString("labelName"));
}
}
return shopTagList;
}
}
......@@ -14,18 +14,17 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
/**
* <p>Description: 嘀加商城 API 调用工具类
* <p>Project: chejia-smart
*
* @deprecated 已废弃,不用 http 方式调用嘀加接口
* @deprecated 已废弃,改成在上层应用中使用 dubbo 调用嘀加接口
* @author wbh
* @date 2021-03-23
*/
@Slf4j
@Component
//@Component
@Deprecated
public class DjApiInvoker implements ApplicationContextAware, DisposableBean {
private static final String ARG_METHOD = "method";
......
......@@ -22,6 +22,3 @@ pagehelper.helperDialect=mysql
#pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql
#\u8BBE\u5907\u8FDC\u7A0B\u8BBF\u95EEurl
device_remote_url=http://192.168.3.222:8099/smartDevices-platform-service
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!