AlipayContent.Apis.Interfaces
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package AlipayContent.Apis.Interfaces --version 1.0.0
NuGet\Install-Package AlipayContent.Apis.Interfaces -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AlipayContent.Apis.Interfaces" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AlipayContent.Apis.Interfaces" Version="1.0.0" />
<PackageReference Include="AlipayContent.Apis.Interfaces" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AlipayContent.Apis.Interfaces --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AlipayContent.Apis.Interfaces, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AlipayContent.Apis.Interfaces@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AlipayContent.Apis.Interfaces&version=1.0.0
#tool nuget:?package=AlipayContent.Apis.Interfaces&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AlipayContent.Apis.Interfaces
支付宝内容发布API接口定义库,提供支付宝生活号+内容发布相关的接口定义和数据传输对象(DTO)。
功能特性
- 🚀 文件上传:支持本地文件上传和URL文件上传两种方式
- 📝 内容发布:支持短图文和视频内容发布
- 🔍 内容查询:支持单条内容状态查询
- ✅ 数据验证:内置完整的数据验证特性
- 📋 完整文档:提供详细的XML文档注释
支持的接口
文件上传接口
FileUpload
- 本地文件上传(支持大文件流式上传)FileUploadByUrl
- 通过URL上传文件
内容管理接口
ContentPublish
- 内容发布接口ContentQuery
- 单条内容状态查询接口
安装
dotnet add package AlipayContent.Apis.Interfaces
使用示例
文件上传DTO
public class AlipayFileUploadDto
{
[Required(ErrorMessage = "上传文件不能为空")]
public IFormFile File { get; set; }
[Required(ErrorMessage = "素材使用场景不能为空")]
public string BizCode { get; set; } = "content_creation";
}
URL文件上传DTO
public class AlipayFileUploadByUrlDto
{
[Required(ErrorMessage = "文件URL地址不能为空")]
[Url(ErrorMessage = "请输入有效的URL地址")]
public string FileUrl { get; set; }
public string BizCode { get; set; } = "content_creation";
}
内容发布DTO
public class AlipayContentPublishDto
{
[Required(ErrorMessage = "内容类型不能为空")]
[RegularExpression("^[12]$", ErrorMessage = "内容类型只能是1(短图文)或2(视频)")]
public string SourceType { get; set; } = "1";
[MaxLength(128, ErrorMessage = "内容标题长度不能超过128位")]
public string? SourceTitle { get; set; }
}
数据验证
所有DTO类都包含完整的数据验证特性:
[Required]
- 必填字段验证[MaxLength]
- 最大长度验证[RegularExpression]
- 正则表达式验证[Url]
- URL格式验证[Range]
- 数值范围验证
版本要求
- .NET 9.0 或更高版本
- Microsoft.AspNetCore.Http.Features 5.0.17+
许可证
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
贡献
欢迎提交问题和功能请求!
更新日志
v1.0.0
- 初始版本发布
- 支持文件上传(本地文件和URL文件)
- 支持内容发布和查询
- 完整的数据验证支持
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.AspNetCore.Http.Features (>= 5.0.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.0.0:
- 初始版本发布
- 支持文件上传(本地文件和URL文件)
- 支持内容发布和查询
- 完整的数据验证支持