门店(Location)接口对接说明.md 2.53 KB

概述

美国版后端采用 ABP 动态接口(ConventionalControllers),宿主统一前缀为 api/app,Swagger 地址为:

  • http://localhost:19001/swagger

门店模块的服务类为 LocationAppService(模块:food-labeling-us)。

说明:接口的最终 URL 以 Swagger 展示为准(在 Swagger 里搜索 LocationLocationAppService 即可)。


数据库表

表名:location

核心字段(与原型一致):

  • Partner:Partner
  • Group:GroupName
  • Location ID:LocationCode
  • Location Name:LocationName
  • Street/City/State/Country/Zip:Street/City/StateCode/Country/ZipCode
  • Phone/Email:Phone/Email
  • GPS:Latitude/Longitude
  • Active Location:State(1=启用,0=停用)

接口 1:门店分页列表

方法签名

Task<PagedResultDto<LocationGetListOutputDto>> GetListAsync(LocationGetListInputVo input)

入参(LocationGetListInputVo)

  • SkipCount:跳过条数(分页用)
  • MaxResultCount:每页条数(分页用)
  • Sorting:排序字段(可选;不传默认按 CreationTime 倒序)
  • Keyword:关键字模糊搜索(会匹配 LocationCode/LocationName/Street/City/StateCode/Country/ZipCode/Phone/Email)
  • Partner:Partner 精确过滤(可选)
  • GroupName:Group 精确过滤(可选)
  • State:启用状态过滤(可选,true/false)

出参(PagedResultDto)

  • TotalCount:总数
  • Items:列表

LocationGetListOutputDto 字段:

  • Id
  • Partner
  • GroupName
  • LocationCode
  • LocationName
  • Street
  • City
  • StateCode
  • Country
  • ZipCode
  • Phone
  • Email
  • Latitude
  • Longitude
  • State

接口 2:新增门店

方法签名

Task<LocationGetListOutputDto> CreateAsync(LocationCreateInputVo input)

入参(LocationCreateInputVo)

  • Partner:可选
  • GroupName:可选
  • LocationCode:必填(唯一,重复会报错)
  • LocationName:必填
  • Street/City/StateCode/Country/ZipCode:可选
  • Phone/Email:可选
  • Latitude/Longitude:可选(decimal)
  • State:是否启用(默认 true)

校验规则

  • LocationCode 不能为空,且唯一
  • LocationName 不能为空

Swagger 中如何找到

  1. 启动后端宿主(Yi.Abp.Web),确保端口为 19001
  2. 打开 http://localhost:19001/swagger
  3. 在接口分组里找到 “食品标签-美国版接口” 或直接搜索 Location
  4. 查看 LocationAppServiceGetListAsyncCreateAsync