Commit f7bab85c by 何文超

更新商品品牌接口

parent be5315fb
package com.gic.plug.web.controller.goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.contants.SortType;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.BrandDTO;
import com.gic.goods.api.service.BrandApiService;
import com.gic.plug.web.vo.goods.GoodsBrandVO;
@RestController
public class GoodsBrandController {
@RequestMapping("/goods-brand-list")
public RestResponse goodsBrandList() {
@Autowired
private BrandApiService brandApiService;
return null;
@RequestMapping("/goods-brand-list")
public RestResponse goodsBrandList(int pageSize, int currentPage, String search, Long goodsDomainId) {
ServiceResponse<Page<BrandDTO>> serviceResponse = brandApiService.findBrandPage(currentPage, pageSize, goodsDomainId, search, SortType.sortDescType);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
Page<GoodsBrandVO> page = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(), GoodsBrandVO.class);
//TODO 品牌id的拼写错误
for (int i = 0; i < page.getResult().size(); i++) {
GoodsBrandVO goodsBrandVO = page.getResult().get(i);
goodsBrandVO.setSpecBrandId(serviceResponse.getResult().getResult().get(i).getSepcBrandId());
}
return RestResponse.success(page);
}
}
......@@ -40,5 +40,6 @@
<dubbo:reference interface="com.gic.goods.api.service.CategoryApiService" id="categoryApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.PropertyValueApiService" id="propertyValueApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.PropertyApiService" id="propertyApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.BrandApiService" id="brandApiService" timeout="60000" retries="0" />
<!-- -->
</beans>
\ No newline at end of file
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