PHP code example of firezihai / message-notification

1. Go to this page and download the library: Download firezihai/message-notification library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

firezihai / message-notification example snippets


php bin/hyperf.php vendor:publish firezihai/message-notification


class FeiShu implements PlatformInterface
{

     /**
     * 发送消息.
     */
    public function send(array $userId, string $message)
    {

    }

    /**
     *  根据手机号码获取userid.
     */
    public function getUserIdByMobile(string $mobile)
    {

    }

    /**
     * 获取token.
     */
    public function getAccessToken()
    {

    }

}




Db implements StoreInterface
{
	
	// $app 配置文件中的app配置项
    public function set(array $app,array $token)
    {
		....
		$update['access_token'] = $token['access_token'];
		$update['expires_in'] = $token['expires_in'];
		....
    }

    public function get(array $app)
    {
	  ....
	  
	  return [
		   'access_token' => $token['access_token'],
           'expires_in' => $token['expires_in'],
		   'token_update_time'=>$token['token_update_time'],
	  ]
    }
}