Skip to content

拼音搜索

数据库加字段:

1.表tbl_address里加pinyin和pingyin_first字段
2.表sku_product_new里加pinyin和pingyin_first字段

GM_SERVICE

/station/order/customer/search 搜索商户

接口名:/station/order/customer/search
Method : GET
请求参数:
    search_text M  string 搜索内容,支持三种格式,纯数字的sid、带S0开头的sid、商户名称的中文,拼音字符(首拼或全拼)
    no_more bool TRUE 数据已全部传完 FALSE还有数据未传完
响应:略

示例
    request
        http://station.guanmai.cn/station/order/customer/search?search_text=999&offset=0&limit=10

    response
        {
              "code": 0,
              "msg": "ok",
              "data": {
                "pagination": {
                  "no_more": TRUE
                },
                "list": [
                  {
                    "lng": 0,
                    "finance_status": 0,
                    "resname": "产品技术测试1",
                    "service_station_id": "T002",
                    "receiver_phone": "12345678965",
                    "address_sign_id": 30100100000,
                    "receiver_name": "希捷1",
                    "address": "产品技术测试1",
                    "lat": 0,
                   "pinyin":"CHANPINJISHUCESHI1"(新增)
                    "pinyin_first":"CPJSCS1"(新增)
                    "map_address": null,
                    "address_id": 3386,
                    "keycustomer": 0,
                    "id": 6384
                  },
                ]
              }
            }
逻辑:
    1.始终检索搜索商户名
    2.当输入首字符是S其余字符是数字或全数字搜索商户ID
    3.当输入字符为全英文时搜索首拼和全拼

/station/skus/addr 搜索商品

接口名:/station/skus/addr 搜索商品
Method:GET
请求:
    address_id   M   int     商户ID
    search_text  M   string  商品sku_id、自定义编码、商品别名、商品名称的中文,全拼或首拼
响应: 
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
逻辑:
    1.SPU别名始终检索
    首先需要在spu_product表里检索出符合的SPU,得到spuid,再到sku_product_new中取出对应的SKU
    2.当输入首字符是D其余字符是数字时搜索商品ID
    3.当输入纯英文时搜索首拼和全拼
    4.当输入只有英文和数字时搜索自定义编码

/product/sku_sale/create 创建售卖sku

接口名: /product/sku_sale/create 
逻辑:
    根据SKU的名字得到其首拼和全拼,同时将两个字段同步添加到DB。

/product/sku/update 更新sku

接口名: /product/sku/update
逻辑:
    当SKU的名字变化时,根据改变其首拼和全拼,同时将两个字段同步添加到DB。

/product/sku_purchase/create 创建采购sku

接口名: /product/sku_purchase/create
逻辑:
    根据SKU的名字得到其首拼和全拼,同时将两个字段同步添加到DB。

management模块

/custommanage/edit/S -- 修改商户信息

接口名
    /custommanage/edit/S<sid>
逻辑:
    根据商户的名字得到其首拼和全拼,同时将两个字段同步添加到DB。

BSHOP

/register 注册

接口名: /register
逻辑:
    根据用户注册时的商户名字得到其首拼和全拼,同时将两个字段同步添加到DB。

/user/address/add 增加店铺 (注册时还未添加店铺时调用)

接口名: /user/address/add
逻辑:
    根据商户的名字得到其首拼和全拼,同时将两个字段同步添加到DB。

/user/address/edit 编辑店铺信息

接口名: /user/address/edit
逻辑:
    根据商户的名字得到其首拼和全拼,同时将两个字段同步添加到DB。