Compare commits
3 Commits
4042fd297d
...
a5a10898a2
| Author | SHA1 | Date | |
|---|---|---|---|
| a5a10898a2 | |||
|
|
00d4e0c3e8 | ||
|
|
0ce1eae772 |
@@ -0,0 +1,51 @@
|
||||
package com.tashow.cloud.productapi.api.product;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ShopDetailDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdListVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdServiceVO;
|
||||
import com.tashow.cloud.productapi.enums.ApiConstants;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
/** RPC 服务 - 参数配置 */
|
||||
public interface ProdApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/prod";
|
||||
/**
|
||||
* 获取商品详情
|
||||
*
|
||||
* @param id 商品id
|
||||
* @return 编号
|
||||
*/
|
||||
|
||||
@GetMapping(PREFIX + "/getProdInfo")
|
||||
ProdDO getProdInfo(@RequestParam(value = "id", required = false) Long id);
|
||||
|
||||
/**
|
||||
* 获取商品服务配置
|
||||
*
|
||||
* @param id 商品id
|
||||
* @return 编号
|
||||
*/
|
||||
@GetMapping(PREFIX + "/getProdService")
|
||||
ProdServiceVO getProdService(@RequestParam(value = "id", required = false) Long id);
|
||||
|
||||
/**
|
||||
* 获得商品分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品分页
|
||||
*/
|
||||
@GetMapping(PREFIX + "/getProdPage")
|
||||
PageResult<ProdListVO> getProdPage(ProdPageReqVO pageReqVO);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.tashow.cloud.product.api;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.product.service.ProdService;
|
||||
import com.tashow.cloud.product.service.ShopDetailService;
|
||||
import com.tashow.cloud.productapi.api.product.ProdApi;
|
||||
import com.tashow.cloud.productapi.api.product.ShopDetailApi;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ShopDetailDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdListVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdServiceVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class ProdImpl implements ProdApi {
|
||||
|
||||
@Resource
|
||||
private ProdService prodService;
|
||||
|
||||
@Override
|
||||
public ProdDO getProdInfo(Long id) {
|
||||
return prodService.getProd(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceVO getProdService(Long id) {
|
||||
return prodService.getProdService(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdListVO> getProdPage(ProdPageReqVO pageReqVO) {
|
||||
return prodService.getProdPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -551,6 +551,7 @@
|
||||
<result property="deleteTime" column="delete_time"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="pic" column="pic"/>
|
||||
<collection property="areaNameList" ofType="string">
|
||||
<result column="area_name"/>
|
||||
</collection>
|
||||
@@ -604,7 +605,7 @@
|
||||
<if test="createTime != null and createTime.length == 2">
|
||||
AND tp.create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
|
||||
</if>
|
||||
<if test="prodName != null">
|
||||
<if test="prodName != null and prodName != ''">
|
||||
AND tp.prod_name = #{prodName}
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
|
||||
Reference in New Issue
Block a user