YSMWSystemWaveAction.class.php 2.86 KB
<?php
require_once dirname(__FILE__).'/common/YSMWBaseAction.class.php';
require_once dirname(__FILE__).'/../facade/YSMFSystemWaveFacade.class.php';
class YSMWSystemWaveAction extends YSMWBaseAction
{

     /**
     * 操作区的系统wave处理
     * @var     object
     */
    private $mSystemWave;
    
    /**
     * 初始化函数
     * 
     */
    public function __construct()
    {
        $this->mSystemWave = new YSMFSystemWaveFacade();
    }
    
    /**
     * 同意联系人请求并添加为好友函数
     * 
     * @param array $request
     * @return string
     */
    public function confirmContactRequest($request)
    {
        $userID = $this->getUserID();
        $result = $this->mSystemWave->confirmContactRequest($userID, $request);
        return $result;
    }
    
    /**
     * 拒绝联系人请求函数
     * 
     * @param array $request
     * @return string
     */
    public function refuseContactRequest($request)
    {
        $userID = $this->getUserID();
        $result = $this->mSystemWave->refuseContactRequest($userID, $request);
        return $result;
    }
    
    /**
     * 修改联系人信息函数
     * 
     * @param array $request
     * @return string
     */
    public function modifyContactInfo($request)
    {
        $userID = $this->getUserID();
        $result = $this->mSystemWave->modifyContactInfo($userID, $request);
        return $result;
    }
    
    /** 
     * 删除系统消息
     * 
     * @param array $request
     * @return string
     */
    public function deleteSystemMessage($request)
    {
        $userID = $this->getUserID();
        $result = $this->mSystemWave->deleteSystemMessage($userID, $request);
        return $result;
    }
    
      /**
     * 设置访问规则函数
     * 
     * @return array
     */
    public function accessRule()
    {
        return array(
                        array(
                                 'allow',
                                 'actions' => array(    
                                                       'confirmContactRequest',
                                                       'refuseContactRequest',
                                                       'modifyContactInfo',
                                                       'deleteSystemMessage'
                                                   ),
                                 'users' => array('@'),
                             ),
                    );
    }

    /**
     * (non-PHPdoc)
     * @see YSMWBaseAction::optLoggerRule()
     */
    public function optLoggerRule()
    {
        return array(
                        'confirmContactRequest' => 'PS000808001',
                        'refuseContactRequest' => 'PS000808002',
                        'modifyContactInfo' => 'PS000808003',
                        'deleteSystemMessage' => 'PS000808004',
                    );
    }
}
?>