|
|
# ShareBrandController获取分享品牌详情服务 #
|
|
|
**方法:getShareBrandInfo()**
|
|
|
|
|
|
**请求参数**
|
|
|
|
|
|
<table>
|
|
|
<tr><th>参数名称</th><th>参数类型</th><th>可否为空</th><th>示例</th><th>默认值</th><th>备注</th></tr>
|
|
|
<tr><td>id</td><td>int</td><td>否</td><td>5</td><td>0</td><td>id</td></tr>
|
|
|
</table>
|
|
|
|
|
|
**实现逻辑:**
|
|
|
|
|
|
1、ShareBrandController.getShareBrandInfo()方法中调用sns.guang.getShareBrandInfo服务;
|
|
|
|
|
|
2、对参数id进行校验,若值小于1,则抛出分享品牌详情id为空异常;
|
|
|
|
|
|
3、根据id查询数据库表brand_relation,获取该id对应品牌相关信息,BrandRelation对象,从该BrandRelation对象中获取对应的品牌id值brand\_id;
|
|
|
|
|
|
4、通过该brand\_id作为参数调用product接口获取该品牌的详细产品信息,得到BrandBo对象.
|
|
|
|
|
|
5、组合查询到的品牌信息与品牌产品详细信息,返回封装的ShareBrandRspBO对象.
|
|
|
|
|
|
**示例:**
|
|
|
请求:
|
|
|
http://localhost:8080/gateway/guang/api/*/share/brandinfo?id=5&debug=XYZ
|
|
|
|
|
|
|
|
|
返回:
|
|
|
|
|
|
{
|
|
|
"code": 500,
|
|
|
"message": "Not found the brand relation"
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|