accessToken = $service; } /** * 获取用户信息 * @param string $account * @param string $secret * @return array|mixed */ public function getUser() { return $this->accessToken->httpRequest('v2/user/info'); } /** * 用量记录 * @param int $page * @param int $limit * @param int $type * @return array|mixed */ public function record(int $page, int $limit, int $type, $status = '') { $typeContent = [1 => 'sms', 2 => 'expr_dump', 3 => 'expr_query', 4 => 'copy']; if (!isset($typeContent[$type])) { throw new ValidateException('参数类型不正确'); } $data = ['page' => $page, 'limit' => $limit, 'type' => $typeContent[$type]]; if ($type == 1 && $status != '') { $data['status'] = $status; } return $this->accessToken->httpRequest('user/record', $data); } protected function initialize(array $config) { } }