15313670163 4 månader sedan
förälder
incheckning
fb2f2e698f

+ 1 - 0
app/JsonRpc/NewsService.php

@@ -4,6 +4,7 @@ namespace App\JsonRpc;
 use App\Model\Article;
 use App\Model\Article;
 use App\Model\ArticleData;
 use App\Model\ArticleData;
 use App\Model\Category;
 use App\Model\Category;
+use App\Model\WebsiteCategory;
 use Hyperf\DbConnection\Db;
 use Hyperf\DbConnection\Db;
 use Hyperf\RpcServer\Annotation\RpcService;
 use Hyperf\RpcServer\Annotation\RpcService;
 use App\Tools\Result;
 use App\Tools\Result;

+ 27 - 0
app/Model/ArticleData.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class ArticleData extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'article_data';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/Category.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class Category extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'category';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/Link.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class Link extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'link';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 19 - 0
app/Model/Model.php

@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * This file is part of Hyperf.
+ *
+ * @link     https://www.hyperf.io
+ * @document https://hyperf.wiki
+ * @contact  group@hyperf.io
+ * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
+ */
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model as BaseModel;
+
+abstract class Model extends BaseModel
+{
+}

+ 27 - 0
app/Model/WebsiteCategory.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class WebsiteCategory extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'website_category';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 0 - 29
config/autoload/databases.php

@@ -13,35 +13,6 @@ use function Hyperf\Support\env;
 
 
 return [
 return [
     'default' => [
     'default' => [
-        'driver' => env('DB_DRIVER2', 'mysql'),
-        'host' => env('DB_HOST2', 'localhost'),
-        'database' => env('DB_DATABASE2', 'hyperf'),
-        'port' => env('DB_PORT2', 3306),
-        'username' => env('DB_USERNAME2', 'root'),
-        'password' => env('DB_PASSWORD2', ''),
-        'charset' => env('DB_CHARSET2', 'utf8'),
-        'collation' => env('DB_COLLATION2', 'utf8_unicode_ci'),
-        'prefix' => env('DB_PREFIX2', ''),
-        'pool' => [
-            'min_connections' => 1,
-            'max_connections' => 10,
-            'connect_timeout' => 10.0,
-            'wait_timeout' => 3.0,
-            'heartbeat' => -1,
-            'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
-        ],
-        'variables' => [
-            'time_zone' => '+08:00', // 设置MySQL连接的时区
-        ],
-        'commands' => [
-            'gen:model' => [
-                'path' => 'app/Model',
-                'force_casts' => true,
-                'inheritance' => 'Model',
-            ],
-        ],
-    ],
-    'secondary' => [
         'driver' => env('DB_DRIVER', 'mysql'),
         'driver' => env('DB_DRIVER', 'mysql'),
         'host' => env('DB_HOST', 'localhost'),
         'host' => env('DB_HOST', 'localhost'),
         'database' => env('DB_DATABASE', 'hyperf'),
         'database' => env('DB_DATABASE', 'hyperf'),

+ 1 - 1
config/autoload/server.php

@@ -20,7 +20,7 @@ return [
             'name' => 'jsonrpc-http',
             'name' => 'jsonrpc-http',
             'type' => Server::SERVER_HTTP,
             'type' => Server::SERVER_HTTP,
             'host' => '0.0.0.0',
             'host' => '0.0.0.0',
-            'port' => 9509,
+            'port' => 9505,
             'sock_type' => SWOOLE_SOCK_TCP,
             'sock_type' => SWOOLE_SOCK_TCP,
             'callbacks' => [
             'callbacks' => [
                 Event::ON_REQUEST => [Hyperf\JsonRpc\HttpServer::class, 'onRequest'],
                 Event::ON_REQUEST => [Hyperf\JsonRpc\HttpServer::class, 'onRequest'],

+ 5 - 0
vendor/composer/autoload_classmap.php

@@ -18,8 +18,13 @@ return array(
     'App\\Listener\\DbQueryExecutedListener' => $baseDir . '/app/Listener/DbQueryExecutedListener.php',
     'App\\Listener\\DbQueryExecutedListener' => $baseDir . '/app/Listener/DbQueryExecutedListener.php',
     'App\\Listener\\ResumeExitCoordinatorListener' => $baseDir . '/app/Listener/ResumeExitCoordinatorListener.php',
     'App\\Listener\\ResumeExitCoordinatorListener' => $baseDir . '/app/Listener/ResumeExitCoordinatorListener.php',
     'App\\Model\\Article' => $baseDir . '/app/Model/Article.php',
     'App\\Model\\Article' => $baseDir . '/app/Model/Article.php',
+    'App\\Model\\ArticleData' => $baseDir . '/app/Model/ArticleData.php',
+    'App\\Model\\Category' => $baseDir . '/app/Model/Category.php',
+    'App\\Model\\Link' => $baseDir . '/app/Model/Link.php',
+    'App\\Model\\Model' => $baseDir . '/app/Model/Model.php',
     'App\\Model\\OldModel\\Article' => $baseDir . '/app/Model/OldModel/Article.php',
     'App\\Model\\OldModel\\Article' => $baseDir . '/app/Model/OldModel/Article.php',
     'App\\Model\\Web' => $baseDir . '/app/Model/Web.php',
     'App\\Model\\Web' => $baseDir . '/app/Model/Web.php',
+    'App\\Model\\WebsiteCategory' => $baseDir . '/app/Model/WebsiteCategory.php',
     'App\\Tools\\Result' => $baseDir . '/app/Tools/Result.php',
     'App\\Tools\\Result' => $baseDir . '/app/Tools/Result.php',
     'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
     'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
     'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',
     'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',

+ 5 - 0
vendor/composer/autoload_static.php

@@ -702,8 +702,13 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Listener\\DbQueryExecutedListener' => __DIR__ . '/../..' . '/app/Listener/DbQueryExecutedListener.php',
         'App\\Listener\\DbQueryExecutedListener' => __DIR__ . '/../..' . '/app/Listener/DbQueryExecutedListener.php',
         'App\\Listener\\ResumeExitCoordinatorListener' => __DIR__ . '/../..' . '/app/Listener/ResumeExitCoordinatorListener.php',
         'App\\Listener\\ResumeExitCoordinatorListener' => __DIR__ . '/../..' . '/app/Listener/ResumeExitCoordinatorListener.php',
         'App\\Model\\Article' => __DIR__ . '/../..' . '/app/Model/Article.php',
         'App\\Model\\Article' => __DIR__ . '/../..' . '/app/Model/Article.php',
+        'App\\Model\\ArticleData' => __DIR__ . '/../..' . '/app/Model/ArticleData.php',
+        'App\\Model\\Category' => __DIR__ . '/../..' . '/app/Model/Category.php',
+        'App\\Model\\Link' => __DIR__ . '/../..' . '/app/Model/Link.php',
+        'App\\Model\\Model' => __DIR__ . '/../..' . '/app/Model/Model.php',
         'App\\Model\\OldModel\\Article' => __DIR__ . '/../..' . '/app/Model/OldModel/Article.php',
         'App\\Model\\OldModel\\Article' => __DIR__ . '/../..' . '/app/Model/OldModel/Article.php',
         'App\\Model\\Web' => __DIR__ . '/../..' . '/app/Model/Web.php',
         'App\\Model\\Web' => __DIR__ . '/../..' . '/app/Model/Web.php',
+        'App\\Model\\WebsiteCategory' => __DIR__ . '/../..' . '/app/Model/WebsiteCategory.php',
         'App\\Tools\\Result' => __DIR__ . '/../..' . '/app/Tools/Result.php',
         'App\\Tools\\Result' => __DIR__ . '/../..' . '/app/Tools/Result.php',
         'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
         'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
         'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',
         'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',