C# 클래스 MPHelper.MpManager

操作集合类
파일 보기 프로젝트 열기: 010227leo/MPHelper 1 사용 예제들

공개 메소드들

메소드 설명
ChangeCategoryAsync ( string openId, string cateId ) : Task

更改用户分组(0:未分组; 1:黑名单; 2:星标组)

GetAllMessageList ( int count = 20, int day = 7 ) : IEnumerable

获取所有用户消息列表

GetContactInfo ( string openId ) : ContactInfo

获取用户信息

GetDonwloadFileBytes ( int msgId ) : byte[]

获取后台文件(音频、图片)

GetMessageListByKeyword ( string keyword, int count = 20 ) : IEnumerable

根据关键字检索消息列表

GetSingleSendMessageList ( string openId ) : IEnumerable

获取单个用户对话消息列表

GetStarMessageList ( int count = 20 ) : IEnumerable

获取星标消息列表

MassSendMessageAsync ( MpMessageType type, string value, string groupId = "-1", int gender, string country = null, string province = null, string city = null ) : Task

群组消息推送

Preheat ( ) : MpManager

预热

SetStarMessageAsync ( string messageId, bool isStar ) : Task

设置/取消星标消息

SingleSendMessageAsync ( string openId, MpMessageType type, string value ) : Task

单用户消息发送

비공개 메소드들

메소드 설명
GetInstance ( string userName, string pwdMd5 ) : MpManager
InternalGetMessageList ( string url ) : IEnumerable
InternalLogin ( ) : bool

模拟后台登录

MpManager ( string userName, string pwdMd5 ) : System

MPManager

메소드 상세

ChangeCategoryAsync() 공개 메소드

更改用户分组(0:未分组; 1:黑名单; 2:星标组)
public ChangeCategoryAsync ( string openId, string cateId ) : Task
openId string 用户OpenId
cateId string 分组ID
리턴 Task

GetAllMessageList() 공개 메소드

获取所有用户消息列表
public GetAllMessageList ( int count = 20, int day = 7 ) : IEnumerable
count int 消息条数
day int 0:今天;1:昨天;以此类推,后台最多保存5天数据,默认全部消息
리턴 IEnumerable

GetContactInfo() 공개 메소드

获取用户信息
public GetContactInfo ( string openId ) : ContactInfo
openId string 用户OpenId
리턴 MPHelper.Dtos.ContactInfo

GetDonwloadFileBytes() 공개 메소드

获取后台文件(音频、图片)
public GetDonwloadFileBytes ( int msgId ) : byte[]
msgId int 消息ID
리턴 byte[]

GetMessageListByKeyword() 공개 메소드

根据关键字检索消息列表
public GetMessageListByKeyword ( string keyword, int count = 20 ) : IEnumerable
keyword string 关键字
count int 消息条数
리턴 IEnumerable

GetSingleSendMessageList() 공개 메소드

获取单个用户对话消息列表
public GetSingleSendMessageList ( string openId ) : IEnumerable
openId string 用户OpenId
리턴 IEnumerable

GetStarMessageList() 공개 메소드

获取星标消息列表
public GetStarMessageList ( int count = 20 ) : IEnumerable
count int 消息条数
리턴 IEnumerable

MassSendMessageAsync() 공개 메소드

群组消息推送
public MassSendMessageAsync ( MpMessageType type, string value, string groupId = "-1", int gender, string country = null, string province = null, string city = null ) : Task
type MpMessageType 消息类型
value string /// 文字消息:文字内容; /// 图片、音频、视频消息:文件ID; /// 图文消息:消息ID; ///
groupId string 分组ID
gender int 性别(0:全部; 1:男; 2:女)
country string 国家
province string
city string
리턴 Task

Preheat() 공개 메소드

预热
public Preheat ( ) : MpManager
리턴 MpManager

SetStarMessageAsync() 공개 메소드

设置/取消星标消息
public SetStarMessageAsync ( string messageId, bool isStar ) : Task
messageId string 消息ID
isStar bool 是否为星标
리턴 Task

SingleSendMessageAsync() 공개 메소드

单用户消息发送
public SingleSendMessageAsync ( string openId, MpMessageType type, string value ) : Task
openId string 用户OpenId
type MpMessageType 消息类型
value string /// 文字消息:文字内容; /// 图片、音频、视频消息:文件ID; /// 图文消息:消息ID; ///
리턴 Task