-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgramForChecker.cs
68 lines (59 loc) · 2.19 KB
/
ProgramForChecker.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models.WX.MessageModel.PreviewMessage;
using Models.WX.MessageModel.TemplateMessage;
using Models.ShortMessage;
namespace WXRobot
{
public partial class Program
{
/// <summary>
/// 判断预览消息发送是否成功。
/// </summary>
/// <param name="sendWXPreviewMessageResponseModel"></param>
/// <returns></returns>
public static bool IsPreviewMessageSentSuccessfully(SendWXPreviewMessageResponseModel sendWXPreviewMessageResponseModel)
{
bool isSuccess = false;
//判断是否成功
if (sendWXPreviewMessageResponseModel != null && sendWXPreviewMessageResponseModel.Ret == 0) //不为空,并且错误码为 0时
{
isSuccess = true;
}
return isSuccess;
}
/// <summary>
/// 判断模板消息发送是否成功。
/// </summary>
/// <param name="sendWXTemplateMessageResponseModel"></param>
/// <returns></returns>
public static bool IsTemplateMessageSentSuccessfully(SendWXTemplateMessageResponseModel sendWXTemplateMessageResponseModel)
{
bool isSuccess = false;
//判断是否成功
if (sendWXTemplateMessageResponseModel != null && sendWXTemplateMessageResponseModel.ErrCode == 0) //不为空,并且错误码为 0时
{
isSuccess = true;
}
return isSuccess;
}
/// <summary>
/// 判断短信消息发送是否成功。
/// </summary>
/// <param name="shortMessageResponseModel"></param>
/// <returns></returns>
public static bool IsShortMessageSentSuccessfully(ShortMessageResponseModel shortMessageResponseModel)
{
bool isSuccess = false;
//判断是否成功
if (shortMessageResponseModel != null && shortMessageResponseModel.ReturnCode == 0) //不为空,并且错误码为 0时
{
isSuccess = true;
}
return isSuccess;
}
}
}