Merge branch 'dev' of bvbej/base-php into master

This commit is contained in:
bvbej 2021-11-30 21:35:02 +08:00 committed by Gogs
commit ac4a56fe6d
10 changed files with 31 additions and 31 deletions

View File

@ -1,3 +1,3 @@
```shell ```shell
php artisan vendor:publish --provider=StarPoolCloud\Providers\StarPoolCloudServiceProvider php artisan vendor:publish --provider=BvBeJ\Providers\BvBeJServiceProvider
``` ```

View File

@ -1,5 +1,5 @@
{ {
"name": "starpoolcloud/base-php", "name": "bvbej/base-php",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
{ {
@ -19,7 +19,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"StarPoolCloud\\": "src/" "BvBeJ\\": "src/"
}, },
"files": [ "files": [
"src/Handles/File/helper.php", "src/Handles/File/helper.php",
@ -29,10 +29,10 @@
"extra": { "extra": {
"laravel": { "laravel": {
"providers": [ "providers": [
"StarPoolCloud\\Providers\\StarPoolCloudServiceProvider" "BvBeJ\\Providers\\BvBeJServiceProvider"
], ],
"aliases": { "aliases": {
"StarPoolCloud": "StarPoolCloud\\Facades\\StarPoolCloudFacade" "BvBeJ": "BvBeJ\\Facades\\BvBeJFacade"
} }
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
return [ return [
'server_addr' => 'https://apollo.config.squrab.com', 'server_addr' => 'https://config.bvbej.com',
'cluster' => 'dev', 'cluster' => 'dev',
'client_ip' => '127.0.0.1', 'client_ip' => '127.0.0.1',
'appid' => env('APP_NAME', ''), 'appid' => env('APP_NAME', ''),

View File

@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace StarPoolCloud\Commands; namespace BvBeJ\Commands;
use Exception; use Exception;
use Illuminate\Console\Command; use Illuminate\Console\Command;
@ -38,10 +38,10 @@ class ApolloConfigSync extends Command
public function handle() public function handle()
{ {
try { try {
app('StarPoolCloudApollo')->updateEnv(); app('BvBeJApollo')->updateEnv();
$this->info('Success'); $this->info('Success');
} catch (Exception $exception) { } catch (Exception $exception) {
$this->error("Error{$exception->getMessage()}"); $this->error("Error{$exception->getMessage()}");
} }
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace StarPoolCloud\Facades; namespace BvBeJ\Facades;
use Illuminate\Support\Facades\Facade; use Illuminate\Support\Facades\Facade;
@ -15,10 +15,10 @@ use Illuminate\Support\Facades\Facade;
* @method static PostJsonRequest(string $url, array $params, array $header = []): string * @method static PostJsonRequest(string $url, array $params, array $header = []): string
* @method static YouDaoTextTranslator(string $appID, string $secret, string $text, string $lang): string * @method static YouDaoTextTranslator(string $appID, string $secret, string $text, string $lang): string
*/ */
class StarPoolCloudFacade extends Facade class BvBeJFacade extends Facade
{ {
protected static function getFacadeAccessor(): string protected static function getFacadeAccessor(): string
{ {
return 'StarPoolCloud'; return 'BvBeJ';
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace StarPoolCloud\Handles\Apollo; namespace BvBeJ\Handles\Apollo;
use Dotenv\Dotenv; use Dotenv\Dotenv;
use Exception; use Exception;
@ -457,4 +457,4 @@ class Client
} }
} }
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace StarPoolCloud\Handles\Apollo; namespace BvBeJ\Handles\Apollo;
class Signature class Signature
{ {
@ -53,4 +53,4 @@ class Signature
$sign = self::generateSignature($timestamp, $pathWithQuery, $secret); $sign = self::generateSignature($timestamp, $pathWithQuery, $secret);
return sprintf(self::AUTHORIZATION_FORMAT, $appId, $sign); return sprintf(self::AUTHORIZATION_FORMAT, $appId, $sign);
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace StarPoolCloud\Handles; namespace BvBeJ\Handles;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions; use GuzzleHttp\RequestOptions;
@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Log;
use Ramsey\Uuid\Rfc4122\UuidV4; use Ramsey\Uuid\Rfc4122\UuidV4;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
class StarPoolCloudHandle class BvBeJHandle
{ {
const DATE_FORMAT = 'Y-m-d H:i:s'; const DATE_FORMAT = 'Y-m-d H:i:s';
@ -224,4 +224,4 @@ class StarPoolCloudHandle
return ""; return "";
} }
} }
} }

View File

@ -1,6 +1,6 @@
<?php <?php
namespace StarPoolCloud\Handles\Trait; namespace BvBeJ\Handles\Trait;
use Illuminate\Auth\Events\Lockout; use Illuminate\Auth\Events\Lockout;
use Illuminate\Cache\RateLimiter; use Illuminate\Cache\RateLimiter;

View File

@ -1,15 +1,15 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace StarPoolCloud\Providers; namespace BvBeJ\Providers;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use StarPoolCloud\Commands\ApolloConfigSync; use BvBeJ\Commands\ApolloConfigSync;
use StarPoolCloud\Handles\Apollo\Client; use BvBeJ\Handles\Apollo\Client;
use StarPoolCloud\Handles\StarPoolCloudHandle; use BvBeJ\Handles\BvBeJHandle;
class StarPoolCloudServiceProvider extends ServiceProvider class BvBeJServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap the application services. * Bootstrap the application services.
@ -35,11 +35,11 @@ class StarPoolCloudServiceProvider extends ServiceProvider
*/ */
public function register() public function register()
{ {
$this->app->singleton('StarPoolCloud', function () { $this->app->singleton('BvBeJ', function () {
return new StarPoolCloudHandle(); return new BvBeJHandle();
}); });
$this->app->singleton('StarPoolCloudApollo', function () { $this->app->singleton('BvBeJApollo', function () {
return new Client(config('apollo')); return new Client(config('apollo'));
}); });
} }
} }