recodem/module-shopfinder

用于管理商店的扩展

1.0.0 2022-10-20 15:17 UTC

This package is not auto-updated.

Last update: 2024-09-20 23:13:47 UTC


README

Recodem 商店查找模块,用于添加和维护商店列表

变更日志

[1.0.1]

  • 用于在管理界面添加、编辑和删除商店的扩展
  • 可用的字段:商店名称、商店图片、唯一标识符、纬度和经度
  • 创建 Graphql Api 以获取完整的商店列表、通过标识符获取商店、更新商店信息和删除 API,提供错误处理消息,因为商店不能被删除
  • 要访问商店查找 API,请创建一个管理员令牌

post : http:///rest//V1/integration/admin/token

请求

{ "username": "admin", "password": "admin123" } # 响应 "eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjEsInV0eXBpZCI6MiwiaWF0IjoxNjY2MTg0MjA3LCJleHAiOjE2NjYxODc4MDd9.aAxPTz347WBjcddpL3zay05NhOto6wjPOa08HvTM-B4"

# 获取商店列表的示例请求 { shopfinder { shop_id shop_name identifier shop_image latitude } } # 商店列表的示例响应

"data": {
    "shopfinder": [
        {
            "shop_id": 6,
            "shop_name": "Test r",
            "identifier": "store-1",
            "shop_image": "",
            "latitude": "0.0000000"
        },
        {
            "shop_id": 7,
            "shop_name": "Test",
            "identifier": "store-123",
            "shop_image": "",
            "latitude": "0.0000000"
        },
        {
            "shop_id": 14,
            "shop_name": "Test123",
            "identifier": "123-test",
            "shop_image": "",
            "latitude": "9.9000002"
        },
        {
            "shop_id": 15,
            "shop_name": "efer",
            "identifier": "new-2",
            "shop_image": "download_11.png",
            "latitude": "9.9000000"
        },
        {
            "shop_id": 16,
            "shop_name": "Testte",
            "identifier": "new-1",
            "shop_image": "download_11.png",
            "latitude": "9.9000000"
        },
        {
            "shop_id": 17,
            "shop_name": "Newshop",
            "identifier": "new-3",
            "shop_image": "download_11.png",
            "latitude": "9.9000005"
        }
    ]
}

# 通过标识符获取商店的示例请求 { shopsByIdentifier(identifier:"new-3") { shop_id shop_name identifier shop_image latitude } } # 示例响应

"data": {
    "shopsByIdentifier": {
        "shop_id": 17,
        "shop_name": "Newshop",
        "identifier": "new-3",
        "shop_image": "download_11.png",
        "latitude": "9.9000005"
    }
}

# 更新商店信息的示例请求 mutation { updateshopinfo( input:{ shop_id:17 identifier:"new-3" } ){ success_message } }

# 示例响应

{ "data": { "updateshopinfo": { "success_message": "Shop was updated" } } }

# 删除商店的示例请求 mutation { deleteshop( input:{ shop_id:17 } ){ message } }

# 示例响应

 "errors": [
     {
         "message": "The shop Newshop cannot be deleted",
         "extensions": {
             "category": "graphql-input"
         },
         "locations": [
             {
                 "line": 2,
                 "column": 4
             }
         ],
         "path": [
             "deleteshop"
         ]
     }
 ],
 "data": {
     "deleteshop": null
 }