[关闭]
@kirkzwy 2015-01-15T14:27:50.000000Z 字数 4553 阅读 1605

Let's Cake API及数据结构格式

创业 Let'sCake


一、页面间跳转逻辑

Let's Cake页面逻辑

二、数据API及数据结构

1.首页广告

(1)API
/api/indexAds
(2)方法及数据结构
方法
GET:主要用于获取首页的头部横幅广告图片,不用通过用户信息分别获取
返回数据结构

  1. [
  2. adsPics:[{
  3. adsPicSrc(string):图片地址
  4. },
  5. ...
  6. ]
  7. shoppingEnts:[{
  8. entImg(string):入口图片地址,
  9. entSlogan(string):入口广告语,
  10. entLink(string):入口跳转地址
  11. },
  12. ....
  13. ]
  14. ]

2.蛋糕产品

(1)API
/api/productsInfo
(2)方法及数据结构
方法
GET:通过(?filter={productType:...})用于获取产品蛋糕或伴手礼分类页面的数据
返回数据结构

  1. {
  2. products(array):[{
  3. productType(string):产品种类(分为'cake''handGift'两类)
  4. serieId(number):产品系列编号,
  5. serieName(string):产品系列名称,
  6. seriePic(string):产品系列代表图片,
  7. serieDesc(string):产品系列介绍,
  8. serieTypes(array):产品系列下的种类[{
  9. typeyId(number):产品系列种类编号,
  10. typeName(string):产品系列种类名称,
  11. typeMainPic(string):产品系列种类主图片,
  12. typeMainDesc(string):产品系列种类主介绍语,
  13. },
  14. ...
  15. ],
  16. },
  17. ....
  18. ]
  19. }

方法
GET:通过(?filter={productType:...,typeyId:...})用于获取产品蛋糕详细页面的数据
返回数据结构

  1. {
  2. typeyId(number):产品系列种类编号,
  3. typeName(string):产品系列种类名称,
  4. typeMainPic(string):产品系列种类主图片,
  5. typeMainDesc(string):产品系列种类主介绍语,
  6. typePics(array):[
  7. {
  8. picSrc(string):图片地址,
  9. },
  10. ...
  11. ],
  12. // 若查询参数为?filter={productType:'cake',typeyId:...}时,为
  13. typePrices(array):[
  14. {
  15. cakeSize(number):蛋糕尺寸,
  16. cakeSizeName(string):蛋糕尺寸套餐名称,
  17. cakePrice(number):蛋糕价格
  18. },
  19. ...
  20. ],
  21. // 若查询参数为?filter={productType:'handGift',typeyId:...}时,为
  22. typeWeight(number):伴手礼重量,
  23. typePrice(number):伴手礼价格,
  24. // 以下相同
  25. typeFavor(array):[
  26. {
  27. picSrc(string):蛋糕口味材料介绍图片,
  28. favorDesc(string):介绍语
  29. },
  30. ...
  31. ],
  32. typeAdvise(array):[
  33. {
  34. picSrc(string):蛋糕搭配建议,
  35. adviseDesc(string):介绍语
  36. },
  37. ...
  38. ]
  39. }

3.订单信息

(1)API
/api/orderinfo
(2)方法数据结构
方法
POST:主要用于接收用户订单信息,通过用户ID信息(?filter={userId:...)系统自动生成订单生成时间,订单编号,订单状态,订单状态编号,订单确认时间,订单发货时间,订单接收时间,订单支付方式编号
发送数据

  1. {
  2. userId(string):用户ID
  3. orderDate(string):订单指定送达日期,
  4. orderTime(string):订单指定送达时间,
  5. orderConsignee(string): 收货人,
  6. orderConsigneePhone (string): 联系电话,
  7. orderDestination(string): 订单接收地址,
  8. orderRemarkstring): 订单备注,
  9. orderPaymen(string): 订单支付方式,
  10. orderCoupon(number): 订单优惠,
  11. orderDeliverFee(number): 订单运费,
  12. orderTotalPrice(number): 订单总价,
  13. goods(array): [
  14. {
  15. goodsName(string):商品名称 ,
  16. goodsType(string): 商品尺寸或重量,
  17. goodsCounts(number): 商品数量,
  18. goodsPricenumber): 商品价格,
  19. goodsTotalPrice(string): 商品总价,
  20. goodsPackage(string):商品包装附件信息
  21. },
  22. ...
  23. ],
  24. }

提交成功后,系统返回以下数据

  1. {
  2. orderId(number): 订单编号,
  3. orderConsignee(string): 收货人,
  4. orderConsigneePhone (string): 联系电话,
  5. orderDestination(string): 订单接收地址,
  6. orderDate(string):订单指定送达日期,
  7. orderTime(string):订单指定送达时间,
  8. orderPaymen(string): 订单支付方式,
  9. orderTotalPrice(number): 订单总价
  10. {

方法
get:根据用户账号信息(?filter={userId:...)获取相关订单信息
返回数据结构

  1. [
  2. {
  3. userId(string):用户ID
  4. orderId(number): 订单编号,
  5. orderStatus(string) : 订单状态,
  6. orderStatusType(number): 订单状态编号,
  7. orderDate(string):订单指定送达日期,
  8. orderTime(string):订单指定送达时间,
  9. orderConfirmTime(string): 订单确认时间,
  10. orderDeliverTime(string): 订单发货时间,
  11. orderArrivalTime (string): 订单接收时间,
  12. orderConsignee(string): 收货人,
  13. orderConsigneePhone (string): 联系电话,
  14. orderDestination(string): 订单接收地址,
  15. orderRemarkstring): 订单备注,
  16. orderPaymen(string): 订单支付方式,
  17. orderPayType (number): 订单支付方式编号,
  18. orderCoupon(number): 订单优惠,
  19. orderDeliverFee(number): 订单运费,
  20. orderTotalPrice(number): 订单总价,
  21. goods(array): [
  22. {
  23. goodsName(string):商品名称 ,
  24. goodsType(string): 商品尺寸或重量,
  25. goodsCounts(number): 商品数量,
  26. goodsPricenumber): 商品价格,
  27. goodsImg(string): 商品图片,
  28. goodsTotalPrice(string): 商品总价,
  29. goodsPackage(string):商品包装附件信息
  30. },
  31. ...
  32. ],
  33. },
  34. ...
  35. ]

4.个人信息

(1)API
/api/userInfo
(2)方法数据结构
方法
POST:通过使用QQ和微博Oauth进行注册操作,系统自动生成用户ID
发送数据

  1. {
  2. OauthInfo(object):相关Oauth信息
  3. }

系统返回数据

  1. {
  2. userId(string):用户ID,
  3. OauthInfo(object):相关Oauth信息
  4. }

方法
GET:通过Oauth注册后,根据用户ID(?filter={userId:...)获得相关用户信息,并通过ID获得相关用户信息(微信绑定后可获得相关微信信息)

  1. {
  2. userId(string):用户ID,
  3. OauthInfo(string):相关Oauth信息,
  4. signName(string):注册名,
  5. wechatName(string):微信名,
  6. wechatAvatar(string):微信头像地址,
  7. }

5.微信绑定

(1)API
/api/wxbinding
(2)方法数据结构
方法
POST:通过授权及用户ID(?filter={userId:...)与微信账号绑定
发送数据

  1. {
  2. bindingInfo(object):相关微信绑定信息
  3. }

系统返回数据

  1. {
  2. userId(string):用户ID,
  3. OauthInfo(string):相关Oauth信息,
  4. signName(string):注册名,
  5. wechatName(string):微信名,
  6. wechatAvatar(string):微信头像地址,
  7. }

6.地址信息

(1)API
/api/addressInfo
(2)方法及数据结构
方法
POST:通过用户ID(?filter={userId:...)新建收货地点信息,系统自动生成地址信息Id,
发送数据结构

  1. {
  2. userId(string): 用户ID,
  3. orderConsignee(string): 收货人,
  4. orderConsigneePhone (string): 联系电话,
  5. orderMCode(string): 订单邮编,
  6. orderDist(string):订单省份,
  7. orderCity(string):订单城市,
  8. orderArea(string):订单地区,
  9. orderDestination(string): 订单接收地址
  10. }

方法
GET:根据用户ID(?filter={userId:...)获取收货地点信息
返回数据结构

  1. [
  2. {
  3. userId(string): 用户ID,
  4. addressId(string): 地址信息ID,
  5. orderConsignee(string): 收货人,
  6. orderConsigneePhone(string): 联系电话,
  7. orderMCode(string): 订单邮编,
  8. orderDist(string): 订单省份,
  9. orderCity(string): 订单城市,
  10. orderArea(string): 订单地区,
  11. orderDestination(string): 订单接收地址
  12. },
  13. ...
  14. ]

方法
PUT:根据用户ID及地址信息ID(?filter={userId:..., addressId:...)更改收货地点信息
发送数据结构

  1. {
  2. userId(string): 用户ID,
  3. addressId(string):地址信息ID,
  4. orderConsignee(string): 收货人,
  5. orderConsigneePhone (string): 联系电话,
  6. orderMCode(string): 订单邮编,
  7. orderDist(string): 订单省份,
  8. orderCity(string):订单城市,
  9. orderArea(string):订单地区,
  10. orderDestination(string): 订单接收地址
  11. }

方法
DELETE:根据用户ID及地址信息ID(?filter={userId:..., addressId:...)删除收货地点信息
发送数据结构

  1. {
  2. userId(string): 用户ID,
  3. addressId(string):地址信息ID
  4. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注