Authored by LUOXC
# 商品库定义
## 实现方案
### 大数据计算出系统优质 (销量最好的商品,去掉退货率超过10%的商品,差评率超过10%的商品)的 `SKN`列表。然后将结果写入到`redis`中。
- 销量排序SKN列表。列表保存4000个SKN。数据结构: `Redis LIST`: `YH:MK:SKNS` -->`[1234,45464,121,1222]`
- 商品SKN标签信息,标签用【,】分割。数据结构: `REDIS String`:`YH:MK:SKNTAG:1234`-->`adidas,鞋,黄色,另类,怀旧`
### JAVA 前台定时(每24小时)从`REDIS`中获取`SKN`列表,并且组装`XML`文件,上传到七牛云中。
# XML文件样例
```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url>
<!--商品详情页URL-->
<loc>
<![CDATA[http://item.yohobuy.com/product/pro_646374_792696/ABLE%20JEANS%20nanshiComfortzhangkuanyurongfu%20277874001402.html?from=brand-b-_1_1]]></loc>
<data>
<!-- 商品名称 -->
<name><![CDATA[ABLE JEANS 男式Comfort长款羽绒服]]></name>
<!--SKN-->
<outerID><![CDATA[51454428]]></outerID>
<!-- 广告主ID -->
<accountID><![CDATA[365136]]></accountID>
<!-- 商品描述 -->
<title><![CDATA[ABLE JEANS 男式Comfort长款羽绒服]]></title>
<!-- SKN 封面图,如果gender是男生,则显示男生封面图,如果gender是女生,则显示女生封面图,如果是通用,则显示男生封面图-->
<image><![CDATA[http://images4.c-xxxxx.com/target/hotel/1000/9/a91_550_412.jpg]]></image>
<!-- 市场价 -->
<price>1999.00</price>
<!-- 商品原价 -->
<value>2999.00></value>
<!-- *************** 落地页信 **************** -->
<!-- PC 落地页-->
<targetUrl><![CDATA[http://hotels.xxxxx.com/hotel/428586.html]]></targetUrl>
<!-- m站落地页-->
<targetUrlMobile><![CDATA[移动落地页]]></targetUrlMobile>
<!-- IOS 应用直达落地页-->
<targetUrlIosApp><![CDATA[应用直达落地页]]></targetUrlIosApp>
<!-- Android 应用直达落地页-->
<targetUrlAndroidApp><![CDATA[应用直达落地页]]></targetUrlAndroidApp>
<!-- 库存量 -->
<stock>12</stock>
<!-- 品牌信息 -->
<brand><![CDATA[ABLE JEANS]]></brand>
<!-- 店铺信息 -->
<!--店铺名称 -->
<shopName>ABLE JEANS</shopName>
<!-- 品类信息 -->
<firstCategory><![CDATA[男生]]></firstCategory>
<subCategory><![CDATA[上衣]]></subCategory>
<thirdCategory><![CDATA[羽绒服]]></thirdCategory>
<fourthCategory><![CDATA[羊毛羽绒服]]></fourthCategory>
<!-- 商品属性,属性描述和属性值以冒号分隔,属性之间以分号间隔,多个属性值以逗号分隔,中间不要加空格,属性不能和xml里其他元素的冲突,如:style:运动;texture:条纹-->
<attribute><![CDATA[style:运动;texture:条纹]]></attribute>
<!-- 标签和标签之间用英文逗号隔开,广告主可以根据标签自定义商品范围 -->
<label><![CDATA[潮流,服饰]]></label>
</data>
</url>
</urlset>
```
\ No newline at end of file
... ...
#流量分析首页接口
## 接口描述
### 1、流量总览分析
#### 请求参数
| Param Name | Param Type | Required | Param Value | Desc |
| :-- | --: | --: | --: | --: |
| type | String | false |pc/ios/android/wap/all| 客户端类类型(默认all)|
| date | date | false |2016-12-26|时间类型(默认当天)|
#### 请求方法
post htttp://localhost:8080/flowsurvey/overview
#### 请求内容json
{
"date": "2016-12-16",
"type": "pc/ios/android/app/all"
}
#### 响应内容json
{
"code": 200,
"msg": "",
"data": {
"type": "all",
"date": "2016-12-16",
"content": {
"pv": "",
"uv": "",
"loss_rate": "",
"avg_pv": "",
"avg_stay": ""
}
}
}
### 2、流量趋势分析(现在默认近7天的数据)
#### 请求参数
| Param Name | Param Type | Required | Param Value | Desc |
| :-- | --: | --: | --: | --: |
| type | String | false |pc/wap/ios/android/all| 客户端类类型(默认全部)|
| index | Array | false | ["pv","uv","loss_rate","avg_pv","avg_stay"]|指标类型(默认全部指标)|
### 请求方法
post http://localhost:8080//flowsurvey/trend
### 请求内容json
{
"type": "pc/wap/ios/android/all",
"index": [
"pv",
"uv",
"loss_rate",
"avg_pv",
"avg_stay"
]
}
#### 响应内容json
{
"code": 200,
"msg": "",
"data": {
"type": "pc",
"content": [
{
"date": "2016-12-26",
"pv": "",
"uv": "",
"loss_rate": "",
"avg_pv": "",
"avg_stay": ""
},
{
"date": "2016-12-25",
"pv": "",
"uv": "",
"loss_rate": "",
"avg_pv": "",
"avg_stay": ""
},
{
"date": "2016-12-24",
"pv": "",
"uv": "",
"loss_rate": "",
"avg_pv": "",
"avg_stay": ""
}
]
}
}
### 3、来源排行分析
#### 请求参数
| Param Name | Param Type | Required | Param Value | Desc |
| :-- | --: | --: | --: | --: |
| type | String | true |ios/android| 客户端类类型|
| date | date | false |2016-12-26|时间类型(默认当天)|
#### 请求方法
post htttp://localhost:8080/flowsurvey/resource_rank
#### 请求内容json
{
"date": "2016-12-26",
"type": "ios/android"
}
#### 响应内容json(结果已排序 index 从大到小排列)
{
"code": 200,
"msg": "",
"data": {
"type": "ios",
"date": "2016-12-26",
"content": [
{
"index": 1,
"name": "自然流量",
"uv": 1,
"order_rate": "12%",
"order_rate_change": "+- 6%"
},
{
"index": 2,
"name": "搜索流量",
"uv": 1,
"order_rate": "12%",
"order_rate_change": "+- 6%"
}
]
}
}
### 4、访客行为分析
#### 请求参数
| Param Name | Param Type | Required | Param Value | Desc |
| :-- | --: | --: | --: | --: |
| type | String | true |brand/product| 排行分类|
| date | date | false |2016-12-26|时间类型(默认当天)|
| top | Int | false ||排名多少(默认前50)|
#### 请求方法
post htttp://localhost:8080/flowsurvey/action_rank
#### 请求内容json
{
"date": "2016-12-16",
"type": “brand/product”,
"top": 50
}
#### 响应内容json (同上 index 排序)
{
"code": 200,
"msg": "",
"data": {
"type": "brand",
"date": "2016-12-26",
"content": [
{
"index": "1",
"name": "vans",
"uv": 7000,
"order_rate": "12%"
},
{
"index": 2,
"name": "adidas",
"uv": 6000,
"order_rate": "8%"
}
]
}
}
### 5、用户特征分析
#### 请求参数
| Param Name | Param Type | Required | Param Value | Desc |
| :-- | --: | --: | --: | --: |
| type | String | true |terminal/city/gender/comp| 特征类型|
| date | date | false |2016-12-26|时间类型(默认当天)|
#### 请求方法
post htttp://localhost:8080/flowsurvey/user_rank
#### 请求内容json
{
"date": "2016-12-16",
"type": “terminal/city/gender/comp"
}
#### 响应内容json
##### terminal
{
"code": 200,
"msg": "",
"data": {
"type": "terminal",
"date": "2016-12-26",
"content": [
{
"pc": [
{
"time": 0,
"pv": 1,
"uv": 1
},
{
"time": 1,
"pv": 1,
"uv": 1
}
],
"wireless": [
{
"time": 0,
"pv": 1,
"uv": 1
},
{
"time": 1,
"pv": 1,
"uv": 1
}
]
}
]
}
}
##### city
{
"code": 200,
"msg": "",
"data": {
"type": "city",
"date": "2016-12-26",
"content": [
{
"index": 1,
"name": "上海",
"uv": 1,
"order_rate": "5%"
},
{
"index": 2,
"name": "北京",
"uv": 1,
"order_rate": "5%"
}
]
}
}
##### gender
{
"code": 200,
"msg": "",
"data": {
"type": "gender",
"date": "2016-12-26",
"content": [
{
"index": 1,
"name": "男生",
"uv": 1,
"order_rate": "5%"
},
{
"index": 2,
"name": "女生",
"uv": 1,
"order_rate": "5%"
},
{
"index": 3,
"name": "其它",
"uv": 1,
"order_rate": "5%"
}
]
}
}
##### comp 组成
{
"code": 200,
"msg": "",
"data": {
"type": "comp",
"date": "2016-12-26",
"content": [
{
"index": 1,
"name": "新客",
"uv": 1,
"rate": "5%"
},
{
"index": 2,
"name": "老客",
"uv": 1,
"order_rate": "95%"
}
]
}
}
... ...
... ... @@ -16,19 +16,19 @@
二、潮流顾问:
1、获取潮流顾问列表(同列表接口,不同活动类型入参):ActivityConfigController/getActivityNowList
1、获取潮流顾问列表(同列表接口,不同活动类型入参):ActivityConfigController/getActivityList
2、根据潮流顾问id获取详情:ActivityConfigController/getFrontActivityInfoById
三、剪发:
1、根据发型师id获取套餐列表(同列表接口,不同活动类型入参):ActivityConfigController/getActivityNowList
1、根据发型师id获取套餐列表(同列表接口,不同活动类型入参):ActivityConfigController/getActivityList
2、根据套餐id获取活动详情:ActivityConfigController/getFrontActivityInfoById
四、摄影
1、获取套餐列表(同列表接口,不同活动类型入参):ActivityConfigController/getActivityNowList
1、获取套餐列表(同列表接口,不同活动类型入参):ActivityConfigController/getActivityList
2、根据id获取套餐详情:ActivityConfigController/getFrontActivityInfoById
... ... @@ -403,7 +403,7 @@ http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getAppointInfoB
## 1、获取潮流顾问列表 ##
入口:ActivityConfigController/getActivityNowList
入口:ActivityConfigController/getActivityList
**请求参数**
... ... @@ -420,7 +420,7 @@ http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getAppointInfoB
注意,通用的头部没有列出。
http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getActivityNowList
http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getActivityList
{
"activityType":5,
... ... @@ -491,7 +491,7 @@ http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getActivityNowL
## 1、根据发型师id获取套餐列表 ##
入口:ActivityConfigController/getActivityNowList
入口:ActivityConfigController/getActivityList
**请求参数**
... ... @@ -507,7 +507,7 @@ http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getActivityNowL
注意,通用的头部没有列出。
http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getActivityNowList
http://172.16.6.207:8080/portal-gateway/ActivityConfigController/getActivityList
{
"activityType":5,
... ...