IPartnerAppService.cs 3.37 KB
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;

/// <summary>
/// 合作伙伴管理接口(fl_partner)
/// </summary>
public interface IPartnerAppService : IApplicationService
{
    /// <summary>
    /// 合作伙伴分页列表(与导出使用相同筛选条件)
    /// </summary>
    /// <param name="input">分页与筛选;SkipCount 为页码(从 1 起)</param>
    /// <returns>分页数据</returns>
    /// <response code="200">成功</response>
    /// <response code="400">参数错误</response>
    /// <response code="500">服务器错误</response>
    Task<PagedResultWithPageDto<PartnerGetListOutputDto>> GetListAsync(PartnerGetListInputVo input);

    /// <summary>
    /// 合作伙伴详情
    /// </summary>
    /// <param name="id">主键 Id</param>
    /// <returns>详情</returns>
    /// <response code="200">成功</response>
    /// <response code="400">Id 无效</response>
    /// <response code="500">服务器错误</response>
    Task<PartnerGetOutputDto> GetAsync(string id);

    /// <summary>
    /// 新增合作伙伴
    /// </summary>
    /// <param name="input">名称、邮箱、电话、启用状态</param>
    /// <returns>新建后的详情</returns>
    /// <remarks>
    /// 示例请求:
    /// ```json
    /// {
    ///   "partnerName": "Global Foods Inc.",
    ///   "contactEmail": "admin@globalfoods.com",
    ///   "phoneNumber": "+1 (555) 100-2000",
    ///   "state": true
    /// }
    /// ```
    /// </remarks>
    /// <response code="200">成功</response>
    /// <response code="400">校验失败</response>
    /// <response code="500">服务器错误</response>
    Task<PartnerGetOutputDto> CreateAsync(PartnerCreateInputVo input);

    /// <summary>
    /// 编辑合作伙伴
    /// </summary>
    /// <param name="id">主键 Id</param>
    /// <param name="input">名称、邮箱、电话、启用状态</param>
    /// <returns>更新后的详情</returns>
    /// <response code="200">成功</response>
    /// <response code="400">校验失败或记录不存在</response>
    /// <response code="500">服务器错误</response>
    Task<PartnerGetOutputDto> UpdateAsync(string id, PartnerUpdateInputVo input);

    /// <summary>
    /// 删除合作伙伴(逻辑删除)
    /// </summary>
    /// <param name="id">主键 Id</param>
    /// <response code="200">成功</response>
    /// <response code="400">Id 无效或记录不存在</response>
    /// <response code="500">服务器错误</response>
    Task DeleteAsync(string id);

    /// <summary>
    /// 按当前列表筛选条件批量导出合作伙伴为 PDF(Account Management「Company」页签;不分页,上限 5000 条)
    /// </summary>
    /// <param name="input">与列表相同的 Keyword、State;分页字段忽略</param>
    /// <returns>PDF 文件流</returns>
    /// <remarks>
    /// 筛选条件需与 <see cref="GetListAsync"/> 一致,便于统计与导出数据对齐。
    /// </remarks>
    /// <response code="200">成功返回 application/pdf</response>
    /// <response code="400">参数错误</response>
    /// <response code="500">服务器错误</response>
    Task<IActionResult> ExportPdfAsync(PartnerGetListInputVo input);
}