# 文本消息類 TextMessage
**目錄 (Table of Contents)**
[TOC]
## 類基本信息
**類簡要描述:**
- 微信文本消息,用于接收微信客戶端發送到服務器來的和回復文本消息給微信客戶端
**類名字空間:**
- endor/wechat/message
**類成員變量說明:**
|成員變量|類型|訪問修飾|說明
|:---- |:---|:----- |----- |
|$_content | string | protected | 消息內容 |
**類繼承關系:**
TextMessage -> Message
## 類成員函數/方法
### __construct($platform, $user, $timestamp, $msgId ,$content)
+ 參數列表:
|參數名|類型|必填項|說明
|:---- |:---|:----- |----- |
|$platform| string | 是 | 微信公眾號 ID |
|$user| string | 是 | 用戶ID |
|$timestamp|int 是 | 時間戳 |
|$msgId| string | 是 | 本次消息的ID |
|$content | string | 是 | 本次消息的內容 |
+ 返回值:
`無`
+ 函數說明:
`構造函數`
### setContent($content)
+ 參數列表:
|參數名|類型|必填項|說明
|:---- |:---|:----- |----- |
|$content| string | 是 | 設置的微信消息的內容 |
+ 返回值:
`無`
+ 函數說明:
`設置該消息的文本內容`
### getContent()
+ 參數列表:
`無`
+ 返回值:
`無`
+ 函數說明:
`獲取該消息的文本內容`
### response()
+ 參數列表:
`無`
+ 返回值:
`無`
+ 函數說明:
`發送消息`
- 1、序言
- 1.1、更新說明
- 1.2、更新計劃
- 2、開始使用 Endor
- 3、目錄結構
- 4、類說明
- 4.1、WechatConfig
- 4.2、WechatValid
- 4.3、WechatCommon
- 4.4、WechatException
- 4.5、基礎接口
- 4.5.1、ShortUrl
- 4.5.2、WechatServerApi
- 4.6、菜單接口
- 4.6.1、菜單類設計
- 4.6.2、Menu
- 4.6.3、ClickMenu
- 4.6.4、ViewMenu
- 4.6.5、MiniProgramMenu
- 4.6.6、MenuApi
- 4.7、消息接口
- 4.7.1、Receiver
- 4.7.2、Message
- 4.7.3、EventMessage
- 4.7.4、TextMessage
- 4.7.5、ClickEventMessage
- 4.7.6、SubscribeEventMessage
- 4.7.7、UnSubscribeEventMessage
- 4.7.8、LocationEventMessage
- 4.7.9、ImageMessage
- 4.7.10、LinkMessage
- 4.7.11、NewsMessage
- 4.7.12、NewsContext
- 4.8、OAuth2.0權限驗證
- 4.8.1、WechatUser
- 4.8.2、OAuthApi
- 4.9、微信支付接口
- 4.9.1、微信支付類設計
- 4.9.2、PayApi
- 4.9.3、RequestPay
- 4.9.4、ResponsePay
- 4.9.5、UnifiedOrder
- 4.9.6、JsPay
- 4.9.7、Refund
- 4.9.8、Query
- 4.9.9、Bill
- 4.9.10、NotifyData
- 4.9.11、Notify
- 4.10、模板消息接口
- 4.10.1、TemplateContext
- 4.10.2、TemplateMessageApi
- 5、使用場景
- 5.1、微信接入服務器驗證
- 5.2、獲取微信API令牌(access_token)
- 5.3、獲取JS API
- 5.4、OAuth2.0靜默登錄
- 5.5、微信菜單
- 5.6、微信消息
- 5.7、微信支付
- 5.7.1、微信公眾號內JsApi支付
- 5.7.2、Native 模式二 掃碼支付
- 5.8、模板消息發送