lock小程序接口API

接口定义说明
Note:
接口通过http接口访问
接口按业务划分为如下几类
base:基础信息接口
user:用户相关接口
store:门店相关接口
order:订单相关接口
pay:用户支付相关接口
transfer:商户转账相关接口

1基础信息接口

1.1获取城市服务类型接口

1.1.1接口说明

          根据用户当前经纬度或用户id获取城市服务类型

1.1.2接口地址

          http://域名:端口/lock/base/selectCityService

1.1.3访问方式

          get

1.1.4访问参数

          参数为json数据,请求要求Context-type:application/json
          {"lat":37.233025,"lng":115.23564,"userId":1321}
          lat:用户当前纬度,可为空(纬度不为空则经度也不为空)
          lng:用户当前经度,可为空
          userId:用户Id,可为空

1.1.5返回结果

          [{"cityId":1,"cityName":"济南", "serviceTypes":[ { "typeId":1,"typeName":"酒吧","priceModel":1},{"typeid":2, "typeName":"剧本杀", "priceModel":2}]}]
          cityId:城市id
          cityName:城市名称
          serviceTypes:服务类型列表
          typeId:服务类型id
          typeName:服务类型名称
          priceModel:计价模式

2.用户接口

2.1用户登录接口

2.1.1接口说明

         用户登录接口接口,在没有用户的情况下自动创建系统用户

2.1.2接口地址

         http://域名:端口/lock/user/getUserInfo

2.1.3访问方式

         post

2.1.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"wxCode":"023aDw1w3cEUJV2X5y3w3u45nv4aDw1","deviceToken":"5abe680EU078ab35","nickName":"昵称","encryptedData":"加密数据","iv":"偏移量"}
         wxCode:本次登录的code
         deviceToken:设备Token
         nickName:昵称
         encryptedData:加密数据
         iv:偏移量

1.2.5返回结果

          {"userId":1,"nickName":"昵称","gender":"性别","avatar_url":"用户头像","country":"国家","province":"省份","city":"城市","language":"语言","token":"授权token"}

2.2获取用户关注店铺

2.2.1接口说明

         根据用户id获取当前用户关注的店铺列表,分页查询

2.2.2接口地址

         http://域名:端口/lock/user/getUserFollows

2.2.3访问方式

         get

2.2.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"userId":1,"lat":37.55656,"lng":115.23539}
         userId:用户的id
         lat:用户当前lat
         lng:用户当前lng

2.2.5返回结果

         [{"storeName":"门店名称","address":"门店位置","tel":"联系电话","description":"门店简介","notice":"公告信息","weighting":"权重值","openTime":"20:00:00","closeTime":"06:00:00","lat":37.56788,"lng":115.5689,"distance":248},{"storeName":"门店名称2","address":"门店位置2","tel":"联系电话2","description":"门店简介2","notice":"公告信息2","weighting":"权重值2","openTime":"20:00:00","closeTime":"06:00:00","lat":37.56788,"lng":115.5689,"distance":248}]
        storeName:门店名称
        address:门店位置
        tel:联系电话
        description:门店介绍,
        notice:公告信息
        weighting:权重值
        openTime:开始营业时间
        closeTime:结束营业时间
        lat:店铺的纬度
        lng:店铺的经度
        distance:与用户当前位置的距离,单位米

2.2获取用户参加的拼团商品明细

2.2.1接口说明

        根据用户id获取当前用参加的拼团商品明细,分页查询

2.2.2接口地址

         http://域名:端口/lock/user/getUserOrders

2.2.3访问方式

         get

2.2.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"userId":1}
         userId:用户的id

2.2.5返回结果

         [{"storeName":"店铺名称","storeImg":"店铺图片","orderCode":"订单编号","goodsName":"商品名称","startDate":"开场时间","origPrice":"原价","sharePrice":"拼团价","during":"时长","sexLimit":1,"maleCount":2,"female":2,"maxCount":8,"minCount":4,"priceModel":1,"personCount":4,"distance":356,"shareStatus":1,"orderDetail":[{"orderCode":"订单编号","orderDetailId":256,"userId":1,"orderGender":1,"avatarUrl":"用户头像","inIndex":3}]}]
         storeName:店铺名称
         storeImg:店铺图片
         orderCode:订单编号
         goodsName:商品名称
         startDate:开场时间
         origPrice:原价
         sharePrice:拼团价
         during:时长
         sexLimit:是否限制性别
         maleCount:男数
         female:女数
         maxCount:最高开场人数
         minCount:最低开场人数
         priceModel:计价模式
         personCount:订单人数
         distance:距离
         shareStatus:拼团状态
         orderDetail:订单明细
         orderCode:订单编号                      
         orderDetailId:订单明细id
         userId:下单用户id
         orderGender:订单性别
         avatarUrl:用户头像
         inIndex:参团顺序

2.3获取用户浏览记录

2.3.1接口说明

         根据用户id获取当前用户浏览的商品记录,分页查询(参考【获取用户参加的拼团商品明细】)

2.3.2接口地址

         http://域名:端口/lock/user/getUserBrowses

2.3.3访问方式

         get

2.3.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"userId":1,"lat":37.55656,"lng":115.23539}
         userId:用户的id
         lat:用户当前lat
         lng:用户当前lng

2.3.5返回结果

          [{"storeName":"店铺名称","storeImg":"店铺图片","orderCode":"订单编号","goodsName":"商品名称","startDate":"开场时间","origPrice":"原价","sharePrice":"拼团价","during":"时长","sexLimit":1,"maleCount":2,"female":2,"maxCount":8,"minCount":4,"priceModel":1,"personCount":4,"distance":356,"shareStatus":1,"orderDetail":[{"orderCode":"订单编号","orderDetailId":256,"userId":1,"orderGender":1,"avatarUrl":"用户头像","inIndex":3}]}]
         storeName:店铺名称
         storeImg:店铺图片
         orderCode:订单编号
         goodsName:商品名称
         startDate:开场时间
         origPrice:原价
         sharePrice:拼团价
         during:时长
         sexLimit:是否限制性别
         maleCount:男数
         female:女数
         maxCount:最高开场人数
         minCount:最低开场人数
         priceModel:计价模式
         personCount:订单人数
         distance:距离
         shareStatus:拼团状态
         orderDetail:订单明细
         orderCode:订单编号                      
         orderDetailId:订单明细id
         userId:下单用户id
         orderGender:订单性别
         avatarUrl:用户头像
         inIndex:参团顺序

3.店铺接口

3.1获取城市门店列表接口

3.1.1接口说明

         根据用户选址的城市,查询该城市某一服务类别的门店列表,分页查询,考虑权重

3.1.2接口地址

         http://域名:端口/lock/store/getStores

3.1.3访问方式

         get

3.1.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"cityId":1,"typeid":1,"lat":37.55656,"lng":115.23539}
         cityId:用户选中的cityId
         typeid:用户选中的服务类型id
         lat:用户当前纬度
         lng:用户当前经度

3.1.5返回结果

             [{"storeName":"门店名称","address":"门店位置","tel":"联系电话","description":"门店简介","notice":"公告信息","weighting":"权重值","openTime":"20:00:00","closeTime":"06:00:00","lat":37.56788,"lng":115.5689,"distance":248},{"storeName":"门店名称2","address":"门店位置2","tel":"联系电话2","description":"门店简介2","notice":"公告信息2","weighting":"权重值2","openTime":"20:00:00","closeTime":"06:00:00","lat":37.56788,"lng":115.5689,"distance":248}]
        storeName:门店名称
        address:门店位置
        tel:联系电话
        description:门店介绍,
        notice:公告信息
        weighting:权重值
        openTime:开始营业时间
        closeTime:结束营业时间
        lat:店铺的纬度
        lng:店铺的经度
        distance:与用户当前位置的距离,单位米

3.2获取当前商品列表

3.2.1接口说明

         根据用户选址的城市,查询该城市某一服务类别的当日商品列表,分页查询,考虑热度

3.2.2接口地址

         http://域名:端口/lock/store/getCurrentGoods

3.2.3访问方式

         get

3.2.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"cityId":1,"typeid":1,"storeId":1,"lat":37.55656,"lng":115.23539}
         cityId:用户选中的cityId
         typeId:用户选中的服务类型id
         storeId:用户指定的门店id
         lat:用户当前纬度
         lng:用户当前经度

3.2.5返回结果

              [{"storeName":"店铺名称","storeImg":"店铺图片","orderCode":"订单编号","goodsName":"商品名称","startDate":"开场时间","origPrice":"原价","sharePrice":"拼团价","during":"时长","sexLimit":1,"maleCount":2,"female":2,"maxCount":8,"minCount":4,"priceModel":1,"personCount":4,"distance":356,"shareStatus":1,"orderDetail":[{"orderCode":"订单编号","orderDetailId":256,"userId":1,"orderGender":1,"avatarUrl":"用户头像","inIndex":3}]}]
         storeName:店铺名称
         storeImg:店铺图片
         orderCode:订单编号
         goodsName:商品名称
         startDate:开场时间
         origPrice:原价
         sharePrice:拼团价
         during:时长
         sexLimit:是否限制性别
         maleCount:男数
         female:女数
         maxCount:最高开场人数
         minCount:最低开场人数
         priceModel:计价模式
         personCount:订单人数
         distance:距离
         shareStatus:拼团状态
         orderDetail:订单明细
         orderCode:订单编号                      
         orderDetailId:订单明细id
         userId:下单用户id
         orderGender:订单性别
         avatarUrl:用户头像
         inIndex:参团顺序

3.3获取门店详情

3.3.1接口说明

         根据门店id获取门店详情

3.3.2接口地址

         http://域名:端口/lock/store/getStoreDetails

3.3.3访问方式

         get

3.3.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"storeId":1,"lat":37.55656,"lng":115.23539}
         storeId:用户指定的门店id
         lat:用户当前纬度
         lng:用户当前经度

3.3.5返回结果

          {"storeName":"门店名称","address":"门店位置","tel":"联系电话","description":"门店简介","notice":"公告信息","weighting":"权重值","openTime":"20:00:00","closeTime":"06:00:00","lat":37.56788,"lng":115.5689,"distance":248},{"storeName":"门店名称2","address":"门店位置2","tel":"联系电话2","description":"门店简介2","notice":"公告信息2","weighting":"权重值2","openTime":"20:00:00","closeTime":"06:00:00","lat":37.56788,"lng":115.5689,"distance":248}
        storeName:门店名称
        address:门店位置
        tel:联系电话
        description:门店介绍,
        notice:公告信息
        weighting:权重值
        openTime:开始营业时间
        closeTime:结束营业时间
        lat:店铺的纬度
        lng:店铺的经度
        distance:与用户当前位置的距离,单位米

3.4获取指定日期的门店商品列表

3.4.1接口说明

         根据消费开始时间和门店id获取商品列表,分页查询

3.4.2接口地址

         http://域名:端口/lock/store/getStoreGoods4Date

3.4.3访问方式

         get

3.4.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"storeId":1,"consumStartDate":"2021-01-21","lat":37.55656,"lng":115.23539}
         storeId:用户指定的门店id
         consumStartDate:消费开始日期
         lat:用户当前纬度
         lng:用户当前经度

3.4.5返回结果

          [{"storeName":"店铺名称","storeImg":"店铺图片","orderCode":"订单编号","goodsName":"商品名称","startDate":"开场时间","origPrice":"原价","sharePrice":"拼团价","during":"时长","sexLimit":1,"maleCount":2,"female":2,"maxCount":8,"minCount":4,"priceModel":1,"personCount":4,"distance":356,"shareStatus":1,"orderDetail":[{"orderCode":"订单编号","orderDetailId":256,"userId":1,"orderGender":1,"avatarUrl":"用户头像","inIndex":3}]}]
         storeName:店铺名称
         storeImg:店铺图片
         orderCode:订单编号
         goodsName:商品名称
         startDate:开场时间
         origPrice:原价
         sharePrice:拼团价
         during:时长
         sexLimit:是否限制性别
         maleCount:男数
         female:女数
         maxCount:最高开场人数
         minCount:最低开场人数
         priceModel:计价模式
         personCount:订单人数
         distance:距离
         shareStatus:拼团状态
         orderDetail:订单明细
         orderCode:订单编号                      
         orderDetailId:订单明细id
         userId:下单用户id
         orderGender:订单性别
         avatarUrl:用户头像
         inIndex:参团顺序

3.5获取商品详情(拼团详情)

3.4.1接口说明

         根据商品id获取商品详情

3.4.2接口地址

         http://域名:端口/lock/store/getGoodsDetail

3.4.3访问方式

         get

3.4.4访问参数

         参数为json数据,请求要求Context-type:application/json
         {"goodsId":1,"lat":37.55656,"lng":115.23539}
         goodsId:商品id
         lat:用户当前纬度
         lng:用户当前经度

3.4.5返回结果

         {"storeId":1,"storeName":"奥斯卡","notice":"奥斯卡简介","serviceTypeName":"夜店、剧本杀","address":"奥斯卡地址","tel":"15054177099","goodsId":1,"goodsName":"散台1","consumStartDate":"2021-01-21 20:00:00","consumEndDate":"2021-01-22 02:00:00","during":"6小时","openTimelong":"1小时35分","origPrice":300,"sharePrice":100,"shareStatus":1,"sexLimit":1,"maleCount":2,"female":2,"maxCount":8,"minCount":4,"priceModel":1,"personCount":4,"distance":356,"orderDetail":[{"orderCode":"订单编号","orderDetailId":256,"userId":1,"orderGender":1,"avatarUrl":"用户头像","inIndex":3}]}
         storeId:门店id
         storeName:门店名称
         notice:门店公告
         serviceTypeName:门店服务类型
         address:门店地址
         tel:门店电话
         goodsId:商品id
         goodsName:商品名称
         consumStartDate:消费开始时间
         consumEndDate:消费结束时间
         during:消费时长
         openTimelong:距离开场时间
         origPrice:原价
         sharePrice:拼团价
         shareStatus:拼团状态
         sexLimit:是否限制性别
         maleCount:男数
        female:女数
        maxCount:最大开场人数
        minCount:最少开场人数
        priceModel:计价模式
        personCount:订单人数
        distance:距离
        orderDetail:订单明细
            orderCode:订单编号
            orderDetailId:订单明细id
            userId:用户id
            orderGender:订单性别
            avatarUrl:用户头像
            inIndex:拼团顺序

4支付相关接口

4.1Lock平台下单接口

4.1.1接口说明

          用于在Lock平台下单,获取订单信息,在平台下单成功的情况下,调用微信的统一下单接口进行支付。需注意区分订单是否已经存在,在订单不存在的情况下,创建订单和订单明细,在订单存在的情况下,仅生成订单支付明细和订单明细。订单表中的订单编号作为订单支付明细编号的前缀,在订单表中的订单编号基础上加上订单序号为订单支付明细编号,订单支付明细编号=订单表中的订单编号+订单序号(3位)。示例如下:

订单表中的订单编号为0123456789,订单序号为001,则订单支付明细编号为0123456789001,该订单支付明细编号作为微信统一下单的商户订单号(out_trade_no)。后台调用微信支付平台-微信小程序统一下单api,尽可能丰富附加数据(attach)数据项,地址如下:
https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_1.shtml

4.1.2接口地址

          http://域名:端口/lock/pay/order

4.1.3访问方式

          post

4.1.4访问参数

          参数为json数据,请求要求Context-type:application/json
         {"goodsId":1,"userId":1,"sexLimit":1,"maleCount":1,"female":1,"personCount":2,"price":334,"totalMoney":668,"acturlPrice":333.33,"actualTotalMoney":666.66,"payType":"支付类型(0:普通支付,1:包场支付)"}

4.1.5返回结果

            {"orderId":1,"orderCode":"0123456789","priceModel":1,"goodsId":1,"goodsCode":"30547869","goodsName":"卡座1","userId":1,"orderPpayCode":"0123456789001","payTotal":668,其他统一支付加单的相关字段(结合数据库及微信统一下单api进行设置)}]}
           orderId:订单id
           orderCode:订单编号
           priceModel:计价模式
           goodsId:商品id
           goodsCode:商品编号
           goodsName:商品名称
           userId:用户id
           orderPpayCode:订单支付编号
           payTotal:支付中金额
           其他统一支付加单的相关字段(结合数据库及微信统一下单api进行设置)

4.2Lock平台微信统一下单回调接口

4.2.1接口说明

          提供微信小程序统一下单调用后的回调

4.2.2接口地址

          http://域名:端口/lock/pay/orderPayCallback

4.2.3访问方式

          post

4.2.4访问参数

          参数为json数据,请求要求Context-type:application/json
          参见微信支付平台

4.2.5返回结果

          参考微信支付平台相关文档。

4.2Lock平台查询微信支付信息接口

4.3.1接口说明

          用于小程序端调用查询微信下单后支付情况

4.3.2接口地址

          http://域名:端口/lock/pay/findOrderPayInfo

4.3.3访问方式

          post

4.3.4访问参数

          参数为json数据,请求要求Context-type:application/json
          参见微信支付平台
          {orderId:1,orderCode:"订单编号","userId":1}

4.3.5返回结果

          参考微信支付平台相关文档,返回用户支付情况。

5订单相关接口

5.1查询订单列表

5.1.1接口说明

          根据门店id、用户id、拼台状态、核销状态及消费日期查询订单列表

5.1.2接口地址

          http://域名:端口/lock/pay/findOrders

5.1.3访问方式

          get

5.1.4访问参数

          参数为json数据,请求要求Context-type:application/json
          {"storeId":1,"userId":1,"shareStatus":1,"closureStatus":1,"consumeStartDate":"2020-01-21"}

5.1.5返回结果

         {"storeId":"门店Id","storeName":"门店名称","goodsId":"商品id","goodsName":"商品"}

你可能感兴趣的:(lock小程序接口API)