1 Star 0 Fork 0

supermay/CommLib.BdPush

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
BdResponseClasses.cs 11.26 KB
一键复制 编辑 原始数据 按行查看 历史
supermay 提交于 2016-05-04 03:19 . no commit message
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CommLib.BdPush
{
/// <summary>
/// 作者:闲人工作室 Freeman
/// QQ:15832782
/// 日期:2016-05-03
/// </summary>
/// <summary>
/// 百度云推送回复的基础类
/// </summary>
/// <typeparam name="T"></typeparam>
public class BdResponse<T>
{
public uint request_id { get; set; }
public uint error_code { get; set; }
public string error_msg { get; set; }
public T response_params { get; set; }
public BdResponse(T param)
{
response_params = param;
}
}
public class msg_response
{
public string msg_id { get; set; }// string 是 该条消息id
public uint send_time { get; set; }// number 是 消息的实际推送时间
public DateTime SendTimeToTime()
{
return Tool.getTime(send_time);
}
}
/// <summary>
/// 推送消息到单台设备返回值
/// 使用 new BdResponse<Push_Single_Device_Response>(new Push_Single_Device_Response());
/// </summary>
public class Push_Single_Device_Response : msg_response { }
/// <summary>
/// 推送广播消息返回值
/// </summary>
public class Push_All_Response : msg_response
{
public string timer_id { get; set; }// string 否 定时任务ID间
}
/// <summary>
/// 推送消息或通知给指定的标签返回值
/// </summary>
public class Push_Tags_Response : msg_response
{
public string timer_id { get; set; }// string 否 定时任务ID
}
/// <summary>
/// 推送消息到给定的一组设备(批量单播)返回值
/// </summary>
public class Push_Batch_Device_Response : msg_response { }
/// <summary>
/// 查询消息的发送状态返回值
/// </summary>
public class query_msg_status_array : msg_response
{
public uint status { get; set; }// number 是 取值如下:0:已发送;1:未发送;2:正在发送;3:失败;
public uint success { get; set; }// number 是 成功到达数
}
public class Report_Query_Msg_Status_Response
{
public uint total_num { get; set; }// number 是 结果数量
public List<query_msg_status_array> result { get; set; } //JsonArray 是 result是数组对象,每项内容为一条消息的状态
public Report_Query_Msg_Status_Response()
{
result = new List<query_msg_status_array>();
}
}
/// <summary>
/// 查询定时消息的发送记录返回值
/// </summary>
public class query_timer_records_array : msg_response
{
public uint status { get; set; }// number 是 取值如下:0:已发送;1:未发送;2:正在发送;3:失败;
}
public class Report_Query_Timer_Records_Response
{
public string timer_id { get; set; }// string 是 定时任务ID
public List<query_timer_records_array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public Report_Query_Timer_Records_Response()
{
result = new List<query_timer_records_array>();
}
}
/// <summary>
/// 查询指定分类主题的发送记录返回值
/// </summary>
public class query_topic_records_array : msg_response
{
public uint status { get; set; }// number 是 取值如下:0:已发送;1:未发送;2:正在发送;3:失败;
}
public class Report_Query_Topic_Records_Response
{
public string topic_id { get; set; }// string 是 定时任务ID
public List<query_topic_records_array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public Report_Query_Topic_Records_Response()
{
result = new List<query_topic_records_array>();
}
}
/// <summary>
/// 查询标签组列表返回值
/// </summary>
public class query_tags_array
{
public uint tid { get; set; }// number 标签ID
public string tag { get; set; }// string 标签名
public string info { get; set; }// string 用于进一步描述标签的附件信息
public uint type { get; set; }// number 标签类型(已废弃,请勿依赖该字段进行开发)
public uint createtime { get; set; }// number 标签创建时间,unix时间戳
public DateTime CreateTimetoTime()
{
return Tool.getTime(createtime);
}
}
public class App_Query_Tags_Response
{
public uint total_num { get; set; }// number Tag总数
public List<query_tags_array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public App_Query_Tags_Response()
{
result = new List<query_tags_array>();
}
}
/// <summary>
/// 创建标签组返回值
/// </summary>
public class App_Create_Tag_Response
{
public string tag { get; set; }// string 标签名
public uint result { get; set; }// number 状态 0:创建成功; 1:创建失败;
}
/// <summary>
/// 删除标签组返回值
/// </summary>
public class App_Del_Tag_Response : App_Create_Tag_Response
{
}
/// <summary>
/// 添加设备到标签组返回值
/// </summary>
public class add_devices_array
{
public string channel_id { get; set; }// string 设备ID
public uint result { get; set; }// number 状态 0:添加成功; 1:添加失败;
}
public class Tag_Add_Devices_Response
{
public List<add_devices_array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public Tag_Add_Devices_Response()
{
result = new List<add_devices_array>();
}
}
/// <summary>
/// 将设备从标签组中移除
/// </summary>
public class del_devices_array : add_devices_array
{
}
public class Tag_Del_Devices_Response
{
public List<del_devices_array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public Tag_Del_Devices_Response()
{
result = new List<del_devices_array>();
}
}
/// <summary>
/// 查询标签组设备数量返回值
/// </summary>
public class Tag_Device_Num_Response
{
public uint device_num { get; set; }// number 标签中设备的数量
}
/// <summary>
/// 查询定时任务列表返回值
/// </summary>
public class timer_query_list_array
{
public string timer_id { get; set; } // string 发送定时消息时返回的timer_id
public string msg { get; set; } // string 发送消息的内容
public uint send_time { get; set; } // number 消息的实际推送时间
public uint msg_type { get; set; } // number 消息类型:0:透传消息;1:通知;2:带格式的消息;3:富媒体消息;
public uint range_type { get; set; } // number 消息发送范围: 0:tag组播;1:广播;2:批量单播;3:标签组合;4:精准推送;5:LBS推送;6:系统保留;7:单播;
}
public class Timer_Query_List_Response
{
public uint total_num { get; set; }// number Tag总数
public List<timer_query_list_array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public Timer_Query_List_Response()
{
result = new List<timer_query_list_array>();
}
}
/// <summary>
/// 取消定时任务返回值
/// void,如果未产生异常信息,则表示删除成功。
/// </summary>
public class Timer_Cancel_Response
{
//这个返回值特殊的,但估计还是可以用基础类
//{
// "request_id":12394838223,
//}
}
/// <summary>
/// 功能:查询推送过程中使用过的分类主题列表
/// </summary>
public class Topic_Query_List_Array
{
public uint ack_cnt { get; set; } // number 总的到达数,-1代表数据未ready
public uint ctime { get; set; } // number 第一次发送时间
public uint mtime { get; set; } // number 最后一次发送时间
public uint push_cnt { get; set; } // number 总的推送目标数
public string topic_id { get; set; } // string 分类主题名称
}
public class Topic_Query_List_Response
{
public uint total_num { get; set; }// number Tag总数
public List<Topic_Query_List_Array> result { get; set; } // JsonArray 是 result是数组对象,每项内容为该定时任务所产生的一条消息的状态
public Topic_Query_List_Response()
{
result = new List<Topic_Query_List_Array>();
}
}
/// <summary>
/// 当前应用的设备统计信息返回值
/// </summary>
public class Report_Statistic_Device_Map_Value
{
public uint new_term { get; set; } // 当天新增用户数;
public uint del_term { get; set; } // 当天解绑用户数;
public uint online_term { get; set; } // 当天在线用户数;
public uint addup_term { get; set; } // 当天累计终端数;
public uint total_term { get; set; } // 有效channelId总数,等于addup_term 减去 del_term;
}
public class Report_Statistic_Device_Response
{
public uint total_num { get; set; }// number 统计结果集的条数
public Dictionary<uint, Report_Statistic_Device_Map_Value> result { get; set; } // result属性是一个map对象,其中:key为统计信息所在当天0点0分时间戳;
public Report_Statistic_Device_Response()
{
result = new Dictionary<uint, Report_Statistic_Device_Map_Value>();
}
}
/// <summary>
/// 查询分类主题统计信息返回值
/// 统计当前应用下一个分类主题的消息数量
/// </summary>
public class Report_Statistic_Topic_Map_Value
{
public uint ack { get; set; } // 当天消息到达数
}
public class Report_Statistic_Topic_Response
{
public uint total_num { get; set; }// number 统计结果集的条数
public Dictionary<uint, Report_Statistic_Topic_Map_Value> result { get; set; } // result属性是一个map对象,其中:key为统计信息所在当天0点0分时间戳;
public Report_Statistic_Topic_Response()
{
result = new Dictionary<uint, Report_Statistic_Topic_Map_Value>();
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/supermay/CommLib.BdPush.git
git@gitee.com:supermay/CommLib.BdPush.git
supermay
CommLib.BdPush
CommLib.BdPush
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385