HC小区接口文档

查询商铺仓库接口文档

一、接口名称

查询商铺仓库列表

二、接口描述

该接口用于查询商铺的仓库信息,支持分页查询,并可筛选特定仓库(通过 shId 排除)。

三、接口路径

http://ip:port/app/shopHouse.queryShopHouse

四、请求方法

GET

五、请求头

参数名称 必填 类型 描述
Authorization String 用户认证token,通过登录接口获取
app-id String 应用ID,由系统分配
transaction-id String 请求流水号,格式:1000000000+YYYYMMDDhhmmss+6位序列
sign String 签名
req-time String 请求时间,格式:YYYYMMDDhhmmss

六、请求参数

6.1 查询参数

参数名称 必填 类型 描述
shopId String 商铺ID
page Integer 当前页码(默认1)
row Integer 每页记录数(默认10)
shId String 仓库ID(用于排除当前仓库)
flag String 特殊标记(1 表示启用筛选逻辑)

七、返回值

7.1 响应格式

{
  "code": 0,
  "msg": "成功",
  "data": {
    "totalPage": 1,
    "total": 5,
    "records": [
      {
        "shId": "仓库ID",
        "shopId": "商铺ID",
        "houseName": "仓库名称",
        "address": "仓库地址",
        "contact": "联系人",
        "phone": "联系电话"
      }
    ]
  }
}

7.2 状态码

  • 200 OK:请求成功
  • 400 Bad Request:参数错误
  • 401 Unauthorized:未授权访问
  • 500 Internal Server Error:服务器内部错误

八、示例请求

8.1 查询所有仓库

curl -X GET \
  'http://ip:port/app/shopHouse.queryShopHouse?shopId=123456&page=1&row=10' \
  -H 'Authorization: Bearer xxxxxx' \
  -H 'app-id: mall' \
  -H 'transaction-id: 100000000020231001120000000001' \
  -H 'sign: xxxxxx' \
  -H 'req-time: 20231001120000'

8.2 排除特定仓库

curl -X GET \
  'http://ip:port/app/shopHouse.queryShopHouse?shopId=123456&shId=789&flag=1' \
  -H 'Authorization: Bearer xxxxxx' \
  -H 'app-id: mall' \
  -H 'transaction-id: 100000000020231001120000000002' \
  -H 'sign: xxxxxx' \
  -H 'req-time: 20231001120000'

九、示例响应

9.1 成功响应

{
  "code": 0,
  "msg": "成功",
  "data": {
    "totalPage": 2,
    "total": 15,
    "records": [
      {
        "shId": "001",
        "shopId": "123456",
        "houseName": "主仓库",
        "address": "北京市朝阳区",
        "contact": "张三",
        "phone": "13800138000"
      },
      {
        "shId": "002",
        "shopId": "123456",
        "houseName": "备用仓库",
        "address": "北京市海淀区",
        "contact": "李四",
        "phone": "13900139000"
      }
    ]
  }
}

9.2 错误响应

{
  "code": 400,
  "msg": "参数 shopId 不能为空",
  "data": null
}

十、业务逻辑说明

  1. 分页查询:默认返回第1页,每页10条数据。
  2. 仓库筛选:当 flag=1 时,会排除 shId 指定的仓库。
  3. 数据转换:请求参数自动映射到 ShopHouseDto 对象,并调用 IShopHouseInnerServiceSMO 进行查询。

十一、相关DTO字段说明

字段名 类型 描述
shId String 仓库ID
shopId String 所属商铺ID
houseName String 仓库名称
address String 仓库地址
contact String 联系人
phone String 联系电话

这份文档符合 RESTful API 规范,涵盖了请求、响应、示例及业务逻辑说明,可直接用于开发对接。