add clear
This commit is contained in:
@@ -15,11 +15,11 @@ use wchat\common\Result;
|
||||
class Account extends SmallProgram
|
||||
{
|
||||
|
||||
private string $wxaqr = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=';
|
||||
private string $getwxacode = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=';
|
||||
private string $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=';
|
||||
private $wxaqr = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=';
|
||||
private $getwxacode = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=';
|
||||
private $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=';
|
||||
|
||||
private string $savePath = __DIR__ . '/../../Users/';
|
||||
private $savePath = __DIR__ . '/../../Users/';
|
||||
|
||||
|
||||
/**
|
||||
@@ -130,7 +130,7 @@ class Account extends SmallProgram
|
||||
* @param $width
|
||||
* @param bool $is_hyaline
|
||||
* @param bool $auto_color
|
||||
* @param string $line_color
|
||||
* @param $line_color
|
||||
* @return array|mixed|Result
|
||||
* @throws \Exception
|
||||
*/
|
||||
@@ -159,7 +159,7 @@ class Account extends SmallProgram
|
||||
* @param $width
|
||||
* @param bool $is_hyaline
|
||||
* @param bool $auto_color
|
||||
* @param string $line_color
|
||||
* @param $line_color
|
||||
* @return array|mixed|Result
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
+34
-34
@@ -19,19 +19,19 @@ class Message extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $openid
|
||||
* @param $openid
|
||||
*/
|
||||
public function setOpenid(string $openid)
|
||||
public function setOpenid($openid)
|
||||
{
|
||||
$this->msgData['touser'] = $openid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
* @param $content
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendTextNews(string $content)
|
||||
public function sendTextNews($content)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'text';
|
||||
$this->msgData['text'] = ['content' => $content];
|
||||
@@ -44,7 +44,7 @@ class Message extends SmallProgram
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendImageNews(string $media_id)
|
||||
public function sendImageNews($media_id)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'image';
|
||||
$this->msgData['image'] = ['media_id' => $media_id];
|
||||
@@ -58,7 +58,7 @@ class Message extends SmallProgram
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendVoiceNews(string $media_id)
|
||||
public function sendVoiceNews($media_id)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'voice';
|
||||
$this->msgData['voice'] = ['media_id' => $media_id];
|
||||
@@ -71,7 +71,7 @@ class Message extends SmallProgram
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendMpNewsNews(string $media_id)
|
||||
public function sendMpNewsNews($media_id)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'mpnews';
|
||||
$this->msgData['mpnews'] = ['media_id' => $media_id];
|
||||
@@ -81,14 +81,14 @@ class Message extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @param string $description
|
||||
* @param string $url
|
||||
* @param string $picurl
|
||||
* @param $title
|
||||
* @param $description
|
||||
* @param $url
|
||||
* @param $picurl
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendNewsNews(string $title, string $description, string $url, string $picurl)
|
||||
public function sendNewsNews($title, $description, $url, $picurl)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'news';
|
||||
$this->msgData['news'] = ['articles' => [[
|
||||
@@ -102,11 +102,11 @@ class Message extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @param $title
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendCardNews(string $title)
|
||||
public function sendCardNews($title)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'wxcard';
|
||||
$this->msgData['wxcard'] = ['card_id' => $title];
|
||||
@@ -116,14 +116,14 @@ class Message extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $media_id
|
||||
* @param string $thumb_media_id
|
||||
* @param string $title
|
||||
* @param string $description
|
||||
* @param $media_id
|
||||
* @param $thumb_media_id
|
||||
* @param $title
|
||||
* @param $description
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendVideoNews(string $media_id, string $thumb_media_id, string $title, string $description)
|
||||
public function sendVideoNews($media_id, $thumb_media_id, $title, $description)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'video';
|
||||
$this->msgData['video'] = ['media_id' => [
|
||||
@@ -137,15 +137,15 @@ class Message extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $musicurl
|
||||
* @param string $hqmusicurl
|
||||
* @param string $thumb_media_id
|
||||
* @param string $title
|
||||
* @param string $description
|
||||
* @param $musicurl
|
||||
* @param $hqmusicurl
|
||||
* @param $thumb_media_id
|
||||
* @param $title
|
||||
* @param $description
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendMusicNews(string $musicurl, string $hqmusicurl, string $thumb_media_id, string $title, string $description)
|
||||
public function sendMusicNews($musicurl, $hqmusicurl, $thumb_media_id, $title, $description)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'music';
|
||||
$this->msgData['music'] = [
|
||||
@@ -160,13 +160,13 @@ class Message extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $head_content
|
||||
* @param string $tail_content
|
||||
* @param $head_content
|
||||
* @param $tail_content
|
||||
* @param array $menus
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendMenuNews(string $head_content, string $tail_content, array $menus = [])
|
||||
public function sendMenuNews($head_content, $tail_content, array $menus = [])
|
||||
{
|
||||
$this->msgData['msgtype'] = 'msgmenu';
|
||||
$this->msgData['msgmenu'] = [
|
||||
@@ -206,7 +206,7 @@ class Message extends SmallProgram
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendMiniprogrampageNews(string $title, string $appid, string $pagepath, string $thumb_media_id)
|
||||
public function sendMiniprogrampageNews($title, $appid, $pagepath, $thumb_media_id)
|
||||
{
|
||||
$this->msgData['msgtype'] = 'msgmenu';
|
||||
$this->msgData['miniprogrampage'] = [
|
||||
@@ -219,15 +219,15 @@ class Message extends SmallProgram
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filePath
|
||||
* @param string $type
|
||||
* @param $filePath
|
||||
* @param $type
|
||||
* @param bool $isPermanent
|
||||
* @param string $title
|
||||
* @param string $introduction
|
||||
* @param $title
|
||||
* @param $introduction
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function upload(string $filePath, string $type, $isPermanent = false, string $title = '', string $introduction = '')
|
||||
public function upload($filePath, $type, $isPermanent = false, $title = '', $introduction = '')
|
||||
{
|
||||
if (!file_exists($filePath)) {
|
||||
throw new Exception('文件不存在');
|
||||
|
||||
@@ -32,25 +32,25 @@ class PublicTemplate extends SmallProgram
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $templateId
|
||||
* @param $templateId
|
||||
*/
|
||||
public function setTemplateId(string $templateId)
|
||||
public function setTemplateId($templateId)
|
||||
{
|
||||
$this->templateId = $templateId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $openId
|
||||
* @param $openId
|
||||
*/
|
||||
public function setOpenId(string $openId)
|
||||
public function setOpenId($openId)
|
||||
{
|
||||
$this->openId = $openId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $defaultUrl
|
||||
* @param $defaultUrl
|
||||
*/
|
||||
public function setDefaultUrl(string $defaultUrl)
|
||||
public function setDefaultUrl($defaultUrl)
|
||||
{
|
||||
$this->defaultUrl = $defaultUrl;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ class PublicTemplate extends SmallProgram
|
||||
/**
|
||||
* @param $name
|
||||
* @param $context
|
||||
* @param string $color
|
||||
* @param $color
|
||||
*/
|
||||
public function replaceKeyword($name, $context, $color = '')
|
||||
{
|
||||
@@ -84,7 +84,7 @@ class PublicTemplate extends SmallProgram
|
||||
|
||||
/**
|
||||
* @param $context
|
||||
* @param string $color
|
||||
* @param $color
|
||||
*/
|
||||
public function setFirst($context, $color = '#f00')
|
||||
{
|
||||
@@ -96,7 +96,7 @@ class PublicTemplate extends SmallProgram
|
||||
|
||||
/**
|
||||
* @param $context
|
||||
* @param string $color
|
||||
* @param $color
|
||||
*/
|
||||
public function setRemark($context, $color = '#000')
|
||||
{
|
||||
|
||||
@@ -29,12 +29,12 @@ class Recharge extends SmallProgram
|
||||
|
||||
/**
|
||||
* @param int $money
|
||||
* @param string $orderNo
|
||||
* @param string $openId
|
||||
* @param $orderNo
|
||||
* @param $openId
|
||||
* @return array|mixed|Result
|
||||
* @throws
|
||||
*/
|
||||
public function recharge(int $money, string $orderNo, $openId = '')
|
||||
public function recharge(int $money, $orderNo, $openId = '')
|
||||
{
|
||||
if ($money < 0) {
|
||||
return new Result(['code' => 500, 'message' => '充值金额不能小于0.']);
|
||||
|
||||
@@ -23,7 +23,7 @@ class SecCheck extends SmallProgram
|
||||
const MEDIA_IMAGE = 1;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param $path
|
||||
* @return array|Result|mixed
|
||||
*/
|
||||
public function image($path = '')
|
||||
@@ -41,12 +41,12 @@ class SecCheck extends SmallProgram
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param $url
|
||||
* @param int $type
|
||||
* @return mixed
|
||||
* @throws
|
||||
*/
|
||||
public function mediaAsync(string $url, $type = SecCheck::MEDIA_IMAGE)
|
||||
public function mediaAsync($url, $type = SecCheck::MEDIA_IMAGE)
|
||||
{
|
||||
if (!in_array($type, [self::MEDIA_IMAGE, self::MEDIA_VIDEO])) {
|
||||
throw new \Exception('暂不支持的文件类型');
|
||||
|
||||
@@ -13,7 +13,7 @@ use wchat\common\Result;
|
||||
class Subject extends \wchat\base\Subject
|
||||
{
|
||||
|
||||
private string $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send';
|
||||
private $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace wchat\wx;
|
||||
*/
|
||||
class Template extends \wchat\base\Template
|
||||
{
|
||||
private string $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send';
|
||||
private $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send';
|
||||
|
||||
public function getUrl()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user