src/Biz/CloudData/Service/Impl/CloudDataServiceImpl.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\CloudData\Service\Impl;

use Biz\BaseService;
use Biz\CloudData\Dao\CloudDataDao;
use Biz\CloudData\Service\CloudDataService;
use Biz\System\Service\LogService;
use Biz\CloudPlatform\CloudAPIFactory;

class CloudDataServiceImpl extends BaseService implements CloudDataService
{
    public function push($name, array $body = array(), $timestamp = 0, $level = 'normal')
    {
        try {
            return CloudAPIFactory::create('event')->push($name, $body, $timestamp);
        } catch (\Exception $e) {
            $this->getLogService()->error('cloud_data', 'push', "{$name} 事件发送失败", array('message' => $e->getMessage()));

            if ($level == 'important') {
                $user = $this->getCurrentUser();
                $fields = array(
                    'name' => $name,
                    'body' => $body,
                    'timestamp' => $timestamp,
                    'createdUserId' => $user['id'],
                );
                $this->getCloudDataDao()->create($fields);
            }

            return false;
        }
    }

    public function searchCloudDataCount($conditions)
    {
        return $this->getCloudDataDao()->count($conditions);
    }

    public function searchCloudDatas($conditions, $orderBy, $start, $limit)
    {
        return $this->getCloudDataDao()->search($conditions, $orderBy, $start, $limit);
    }

    public function deleteCloudData($id)
    {
        return $this->getCloudDataDao()->delete($id);
    }

    /**
     * @return CloudDataDao
     */
    protected function getCloudDataDao()
    {
        return $this->createDao('CloudData:CloudDataDao');
    }

    /**
     * @return LogService
     */

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。