first commit

This commit is contained in:
root
2025-06-18 10:31:43 +08:00
commit d9f820b55d
981 changed files with 449311 additions and 0 deletions

27
app/Rpc/CalculatorService.php Executable file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Rpc;
use Hyperf\Di\Annotation\Inject;
use Hyperf\Rpc\Response;
use Hyperf\RpcServer\Annotation\RpcService;
// #[RpcService(name: "xxx-oo", server: "jsonrpc-http", protocol: "jsonrpc-http", publishTo: 'nacos')]
class CalculatorService
{
public function add(int $a, int $b)
{
// \Hyperf\Logger\LoggerFactory::get('default')->info("Add called with: $a + $b");
// 这里是服务方法的具体实现
return ['xxxx' => 888];
return $a + $b;
}
public function add2(int $a, int $b)
{
// \Hyperf\Logger\LoggerFactory::get('default')->info("Add called with: $a + $b");
// 这里是服务方法的具体实现
return ['xxxx' => 888999];
return $a + $b;
}
}