You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

49 lines
1.1 KiB

using System.Threading.Tasks;
namespace learun.wechat
{
/// <summary>
/// 版 本 EasyCode EC管理后台
/// Copyright (c) 2019-present EC管理有限公司
/// 创建人:tobin
/// 日 期:2019.11.06
/// 描 述:媒体上传
/// </summary>
public class MediaUpload : OperationRequestBase<MediaUploadResult, HttpPostFileRequest>
{
private string url = "https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type={0}";
/// <summary>
///
/// </summary>
/// <returns></returns>
protected override string Url()
{
return string.Format(url, type);
}
/// <summary>
/// 类型
/// </summary>
/// <returns></returns>
[IsNotNull]
public string type { get; set; }
/// <summary>
/// 文件地址
/// </summary>
/// <returns></returns>
public string media { get; set; }
/// <summary>
///
/// </summary>
/// <param name="httpSend"></param>
/// <param name="url"></param>
/// <returns></returns>
protected override Task<string> HttpSend(IHttpSend httpSend, string url)
{
return httpSend.Send(url, media);
}
}
}