Commit 08f84352 by 何文超

更新接口

parent 3f930ae5
...@@ -41,7 +41,7 @@ import java.util.Map; ...@@ -41,7 +41,7 @@ import java.util.Map;
* 商城装修选择器 * 商城装修选择器
*/ */
@RestController @RestController
public class AppletConfigGoodsController { public class AppletConfigGoodsController extends BaseGoodsController {
@Autowired @Autowired
private CordApiService cordApiService; private CordApiService cordApiService;
...@@ -84,7 +84,7 @@ public class AppletConfigGoodsController { ...@@ -84,7 +84,7 @@ public class AppletConfigGoodsController {
} }
areaId = shopDTOServiceResponse.getResult().getAreaId(); areaId = shopDTOServiceResponse.getResult().getAreaId();
} }
ServiceResponse<List<SpecCordDTO>> listServiceResponse = cordApiService.listSpecCordDTO(areaId); ServiceResponse<List<SpecCordDTO>> listServiceResponse = cordApiService.listSpecCordDTO(areaId, getEnterpriseId());
return RestResponse return RestResponse
.success(EntityUtil.changeEntityListByOrika(MallGoodsCordVO.class, listServiceResponse.getResult())); .success(EntityUtil.changeEntityListByOrika(MallGoodsCordVO.class, listServiceResponse.getResult()));
} }
...@@ -123,7 +123,7 @@ public class AppletConfigGoodsController { ...@@ -123,7 +123,7 @@ public class AppletConfigGoodsController {
} }
JSONObject cordJSON = null; JSONObject cordJSON = null;
if (cordId != null) { if (cordId != null) {
ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listChildAll(cordId); ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listChildAll(cordId, getEnterpriseId());
List<Long> cordList = new ArrayList<>(); List<Long> cordList = new ArrayList<>();
for (GoodsCordDTO goodsCord : serviceResponse.getResult()) { for (GoodsCordDTO goodsCord : serviceResponse.getResult()) {
cordList.add(goodsCord.getSpecCordId()); cordList.add(goodsCord.getSpecCordId());
......
...@@ -4,7 +4,7 @@ import com.gic.enterprise.base.EnterpriseInfo; ...@@ -4,7 +4,7 @@ import com.gic.enterprise.base.EnterpriseInfo;
import com.gic.enterprise.utils.UserDetailUtils; import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.mall.base.api.exception.GicMallException; import com.gic.mall.base.api.exception.GicMallException;
public class BaseController { public class BaseGoodsController {
EnterpriseInfo getLoginEnterpriseInfo() { EnterpriseInfo getLoginEnterpriseInfo() {
EnterpriseInfo enterpriseInfo = UserDetailUtils.getUserDetail().getEnterpriseInfo(); EnterpriseInfo enterpriseInfo = UserDetailUtils.getUserDetail().getEnterpriseInfo();
......
...@@ -24,7 +24,7 @@ import java.util.Collections; ...@@ -24,7 +24,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
@RestController @RestController
public class GoodsBrandController extends BaseController { public class GoodsBrandController extends BaseGoodsController {
@Autowired @Autowired
private BrandApiService brandApiService; private BrandApiService brandApiService;
......
...@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@RestController @RestController
public class GoodsCategoryController extends BaseController { public class GoodsCategoryController extends BaseGoodsController {
@Autowired @Autowired
private CategoryApiService categoryApiSerivce; private CategoryApiService categoryApiSerivce;
......
...@@ -31,7 +31,7 @@ import java.util.stream.Collectors; ...@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
* @date 2019/8/29 上午10:03 * @date 2019/8/29 上午10:03
*/ */
@RestController @RestController
public class GoodsController extends BaseController { public class GoodsController extends BaseGoodsController {
@Autowired @Autowired
private EsBusinessOperaApiService esBusinessOperaApiService; private EsBusinessOperaApiService esBusinessOperaApiService;
......
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
* @date 2019/8/29 上午10:03 * @date 2019/8/29 上午10:03
*/ */
@RestController @RestController
public class GoodsCordController { public class GoodsCordController extends BaseGoodsController {
@Autowired @Autowired
private CordApiService cordApiService; private CordApiService cordApiService;
...@@ -31,7 +31,7 @@ public class GoodsCordController { ...@@ -31,7 +31,7 @@ public class GoodsCordController {
*/ */
@GetMapping("list-parent-cord") @GetMapping("list-parent-cord")
public RestResponse listParentCord(Long goodsDomainId) { public RestResponse listParentCord(Long goodsDomainId) {
ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listParentAll(goodsDomainId); ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listParentAll(goodsDomainId, getEnterpriseId());
List<GoodsCordDTO> result = serviceResponse.getResult(); List<GoodsCordDTO> result = serviceResponse.getResult();
if (CollectionUtils.isEmpty(result)) { if (CollectionUtils.isEmpty(result)) {
return RestResponse.success(); return RestResponse.success();
...@@ -49,7 +49,7 @@ public class GoodsCordController { ...@@ -49,7 +49,7 @@ public class GoodsCordController {
*/ */
@GetMapping("list-child-cord") @GetMapping("list-child-cord")
public RestResponse listChildAll(Long specParentId) { public RestResponse listChildAll(Long specParentId) {
ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listChildAll(specParentId); ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listChildAll(specParentId, getEnterpriseId());
List<GoodsCordDTO> result = serviceResponse.getResult(); List<GoodsCordDTO> result = serviceResponse.getResult();
if (CollectionUtils.isEmpty(result)) { if (CollectionUtils.isEmpty(result)) {
return RestResponse.success(); return RestResponse.success();
......
...@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
@RestController @RestController
public class GoodsDomainController extends BaseController { public class GoodsDomainController extends BaseGoodsController {
@Autowired @Autowired
private GoodsDomainApiService goodsDomainApiService; private GoodsDomainApiService goodsDomainApiService;
......
...@@ -20,7 +20,7 @@ import java.util.ArrayList; ...@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
@RestController @RestController
public class GoodsPropertyController extends BaseController { public class GoodsPropertyController extends BaseGoodsController {
@Autowired @Autowired
private PropertyApiService propertyApiService; private PropertyApiService propertyApiService;
......
...@@ -15,13 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -15,13 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class GoodsRightsSelectorController extends BaseController { public class GoodsRightsSelectorController extends BaseGoodsController {
@Autowired @Autowired
private GoodsRightsSelectorApiService goodsRightsSelectorApiService; private GoodsRightsSelectorApiService goodsRightsSelectorApiService;
/** /**
* @Title: goodsRightsSelectorSave * @Title: BaseGoodsController
* @Description: 保存商品选择器权限版 * @Description: 保存商品选择器权限版
* @author majia * @author majia
* @param goodsRightsSelectorSaveQO * @param goodsRightsSelectorSaveQO
......
...@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class GoodsSelectorController extends BaseController { public class GoodsSelectorController extends BaseGoodsController {
@Autowired @Autowired
private GoodsSelectorApiService goodsSelectorApiService; private GoodsSelectorApiService goodsSelectorApiService;
......
...@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class GoodsStandardController extends BaseController { public class GoodsStandardController extends BaseGoodsController {
@Autowired @Autowired
private StandardApiService standardApiService; private StandardApiService standardApiService;
......
...@@ -2,22 +2,17 @@ package com.gic.plug.web.controller.goods; ...@@ -2,22 +2,17 @@ package com.gic.plug.web.controller.goods;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils; import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.ErrorCode; import com.gic.goods.api.dto.ErrorCode;
import com.gic.goods.api.dto.GoodsTagDTO; import com.gic.goods.api.dto.GoodsTagDTO;
import com.gic.goods.api.dto.StandardDTO;
import com.gic.goods.api.service.TagApiService; import com.gic.goods.api.service.TagApiService;
import com.gic.plug.web.vo.goods.GoodsTagVO; import com.gic.plug.web.vo.goods.GoodsTagVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* @ClassName: GoodsTagController * @ClassName: GoodsTagController
* @Description: 商品标签相关接口 * @Description: 商品标签相关接口
...@@ -25,7 +20,7 @@ import java.util.List; ...@@ -25,7 +20,7 @@ import java.util.List;
* @date 2019/8/29 上午10:03 * @date 2019/8/29 上午10:03
*/ */
@RestController @RestController
public class GoodsTagController { public class GoodsTagController extends BaseGoodsController {
@Autowired @Autowired
private TagApiService tagApiService; private TagApiService tagApiService;
...@@ -42,7 +37,7 @@ public class GoodsTagController { ...@@ -42,7 +37,7 @@ public class GoodsTagController {
} }
ServiceResponse<Page<GoodsTagDTO>> serviceResponse = tagApiService.listByPage(currentPage, pageSize, ServiceResponse<Page<GoodsTagDTO>> serviceResponse = tagApiService.listByPage(currentPage, pageSize,
goodsDomainId); goodsDomainId, getEnterpriseId());
Page<GoodsTagVO> voPage = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(), Page<GoodsTagVO> voPage = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(),
GoodsTagVO.class); GoodsTagVO.class);
return RestResponse.success(voPage); return RestResponse.success(voPage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment