1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\JsonRpc;
- use App\Model\Article;
- use App\Model\OldModel\Article as OLDArticle;
- use Hyperf\RpcServer\Annotation\RpcService;
- use App\Tools\Result;
- #[RpcService(name: "CrawlerService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
- class CrawlerService implements CrawlerServiceInterface
- {
- /**
- * @param array $data
- * @return array
- */
- public function sendCrawler(array $data): array
- {
- $result = Article::get();
- $b = OLDArticle::get();
- $a = [
- 'old'=>$b,
- 'new'=>$result
- ];
- return Result::success($a);
- }
- }
|