using FoodLabeling.Application.Contracts.Dtos.Common; using FoodLabeling.Application.Contracts.Dtos.Partner; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace FoodLabeling.Application.Contracts.IServices; /// /// 合作伙伴管理接口(fl_partner) /// public interface IPartnerAppService : IApplicationService { /// /// 合作伙伴分页列表(与导出使用相同筛选条件) /// /// /// 数据范围(按登录 Token): /// /// 管理员(角色码 admin、用户名为 admin 或权限 *:*:*):可查看全部公司; /// 其它角色:仅可查看当前用户在 userlocation 中绑定门店所属的合作伙伴(location.Partnerfl_partner 按名称或 Id 匹配)。 /// /// /// 分页与筛选;SkipCount 为页码(从 1 起) /// 分页数据 /// 成功 /// 参数错误 /// 服务器错误 Task> GetListAsync(PartnerGetListInputVo input); /// /// 合作伙伴详情 /// /// 主键(Guid,与 fl_partner.Id 一致;约定路由 {id:guid},避免与 export-pdf 等路径冲突) /// 详情 /// 成功 /// Id 无效 /// 服务器错误 Task GetAsync(Guid id); /// /// 新增合作伙伴 /// /// 名称、联系信息、地址、启用状态 /// 新建后的详情 /// /// 示例请求: /// ```json /// { /// "partnerName": "Global Foods Inc.", /// "contactEmail": "admin@globalfoods.com", /// "phoneNumber": "+1 (555) 100-2000", /// "street": "123 Main St", /// "city": "New York", /// "stateCode": "NY", /// "country": "USA", /// "zipCode": "10001", /// "state": true /// } /// ``` /// 地址中的州/省请传 stateCode(如 NY);state(boolean)表示是否启用。 /// /// 成功 /// 校验失败 /// 服务器错误 Task CreateAsync(PartnerCreateInputVo input); /// /// 编辑合作伙伴 /// /// 主键 Id /// 名称、联系信息、地址、启用状态(字段同新增) /// 更新后的详情 /// 成功 /// 校验失败或记录不存在 /// 服务器错误 Task UpdateAsync(Guid id, PartnerUpdateInputVo input); /// /// 删除合作伙伴(逻辑删除) /// /// 主键 Id /// 成功 /// Id 无效或记录不存在 /// 服务器错误 Task DeleteAsync(Guid id); /// /// 按当前列表筛选条件批量导出合作伙伴为 PDF(Account Management「Company」页签;不分页,上限 5000 条) /// /// 与列表相同的 Keyword、State;分页字段忽略 /// PDF 文件流 /// /// 筛选条件与数据范围需与 完全一致(含 Token 权限:管理员全部公司,其它角色仅绑定门店所属公司;见 PartnerScopeHelper)。 /// /// 成功返回 application/pdf /// 参数错误 /// 服务器错误 Task ExportPdfAsync(PartnerGetListInputVo input); }