Selaa lähdekoodia

feat(shipping-template): 初始化运费模板插件基础结构

- 新增插件核心扩展类Extension.php
- 配置插件基本信息info.php和config.php
- 添加路由配置文件admin.php和api.php
- 创建composer.json定义插件依赖和自动加载
- 添加.gitignore忽略不必要的开发和运行时文件
- 设置命名空间和PSR-4自动加载规则
- 定义插件ID常量和基础目录获取方法
runphp 5 kuukautta sitten
sitoutus
8518715ba3
7 muutettua tiedostoa jossa 126 lisäystä ja 0 poistoa
  1. 46 0
      .gitignore
  2. 32 0
      composer.json
  3. 5 0
      config.php
  4. 7 0
      info.php
  5. 10 0
      route/admin.php
  6. 10 0
      route/api.php
  7. 16 0
      src/Extension.php

+ 46 - 0
.gitignore

@@ -0,0 +1,46 @@
+# Dependencies
+/vendor/
+/node_modules/
+/.idea/
+/.vscode/
+.DS_Store
+Thumbs.db
+*.log
+*.cache
+.env
+.env.local
+/runtime/
+/temp/
+/cache/
+composer.lock
+package-lock.json
+
+# Environment files
+
+# IDE files
+
+# OS files
+
+# Log files
+
+# Cache and temporary files
+
+# Build artifacts
+/dist/
+/build/
+
+# PHP specific
+
+# Test coverage
+/coverage/
+/.phpunit.result.cache
+
+# Database
+*.sqlite
+*.db
+
+# Generated files
+/public/mix-manifest.json
+/public/hot
+/public/storage
+/storage/*.key

+ 32 - 0
composer.json

@@ -0,0 +1,32 @@
+{
+  "name": "six-shop/shipping-template",
+  "description": "运费模模板",
+  "type": "sixshop-extension",
+  "keywords": [
+    "sixshop",
+    "thinkphp"
+  ],
+  "require": {
+    "php": ">=8.3",
+    "six-shop/core": ">=0.6 <1.0"
+  },
+  "authors": [
+    {
+      "name": "hui he",
+      "email": "runphp@qq.com"
+    }
+  ],
+  "license": "MIT",
+  "autoload": {
+    "psr-4": {
+      "SixShop\\ShippingTemplate\\": "src"
+    }
+  },
+  "extra": {
+    "sixshop": {
+      "id": "six-shop-shipping-template",
+      "class": "SixShop\\ShippingTemplate\\Extension"    }
+  },
+  "minimum-stability": "dev",
+  "prefer-stable": true
+}

+ 5 - 0
config.php

@@ -0,0 +1,5 @@
+<?php
+declare(strict_types=1);
+
+return [
+];

+ 7 - 0
info.php

@@ -0,0 +1,7 @@
+<?php
+declare(strict_types=1);
+
+return [
+    'id' => 'six-shop-shipping-template',
+    'name' => '运费模模板',
+];

+ 10 - 0
route/admin.php

@@ -0,0 +1,10 @@
+<?php
+declare(strict_types=1);
+
+
+use think\facade\Route;
+
+// Admin路由
+// 路由前缀: /admin/six-shop-shipping-template//
+// 如果需要登录请添加认证中间件auth
+// ->middleware(['auth'])

+ 10 - 0
route/api.php

@@ -0,0 +1,10 @@
+<?php
+declare(strict_types=1);
+
+
+use think\facade\Route;
+
+// API路由
+// 路由前缀: /api/six-shop-shipping-template//
+// 如果需要登录请添加认证中间件auth
+// ->middleware(['auth'])

+ 16 - 0
src/Extension.php

@@ -0,0 +1,16 @@
+<?php
+declare(strict_types=1);
+
+namespace SixShop\ShippingTemplate;
+
+use SixShop\Core\ExtensionAbstract;
+
+class Extension extends ExtensionAbstract
+{
+    public const string EXTENSION_ID = 'six-shop-shipping-template';
+
+    protected function getBaseDir(): string
+    {
+        return dirname(__DIR__);
+    }
+}