Преглед изворни кода

feat(sixshop): 添加阿里云大鱼短信扩展

- 新增 composer.json 文件,定义扩展的依赖和自动加载
- 创建 config.php 文件,配置阿里云短信服务的必要参数
- 实现 Extension 类,提供扩展的基础信息和功能- 添加 info.php 文件,描述扩展的基本信息
- 更新 .gitignore 文件,排除不必要的文件和目录- 编写 README.md 文件,介绍扩展的用途和使用方法
runphp пре 7 месеци
родитељ
комит
2504377544
6 измењених фајлова са 159 додато и 4 уклоњено
  1. 1 4
      .gitignore
  2. 6 0
      README.md
  3. 32 0
      composer.json
  4. 90 0
      config.php
  5. 16 0
      info.php
  6. 14 0
      src/Extension.php

+ 1 - 4
.gitignore

@@ -1,6 +1,3 @@
 composer.phar
 /vendor/
-
-# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
-# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
-# composer.lock
+.idea/

+ 6 - 0
README.md

@@ -0,0 +1,6 @@
+# aliyun_dysms
+
+扩展说明
+
+
+https://next.api.aliyun.com/document/Dysmsapi/2017-05-25/overview

+ 32 - 0
composer.json

@@ -0,0 +1,32 @@
+{
+  "name": "six-shop/aliyun-dysms",
+  "description": "阿里云大鱼短信扩展",
+  "type": "sixshop-extension",
+  "keywords": [
+    "sixshop",
+    "thinkphp"
+  ],
+  "require": {
+    "php": ">=8.3",
+    "six-shop/core": ">=0.5 <1.0",
+    "symfony/http-client": ">=7.3"
+  },
+  "authors": [
+    {
+      "name": "hui he",
+      "email": "runphp@qq.com"
+    }
+  ],
+  "license": "MIT",
+  "autoload": {
+    "psr-4": {
+      "SixShop\\AliyunDysms\\": "src"
+    }
+  },
+  "extra": {
+    "sixshop": {
+      "id": "aliyun-wuliu",
+      "class": "SixShop\\AliyunDysms\\Extension"
+    }
+  }
+}

+ 90 - 0
config.php

@@ -0,0 +1,90 @@
+<?php
+declare(strict_types=1);
+
+return [[
+    'type' => 'input',
+    'title' => 'AccessKey ID',
+    'field' => 'access_key_id',
+    'props' => [
+        'placeholder' => '请输入阿里云AccessKey ID'
+    ],
+    '$required' => true,
+    '_fc_id' => 'id_Fov2me9qr7b0abc',
+    'name' => 'ref_Fyhwme9qr7b0acc',
+    '_fc_drag_tag' => 'input',
+    'display' => true,
+    'hidden' => false
+],
+    [
+        'type' => 'input',
+        'title' => 'AccessKey Secret',
+        'field' => 'access_key_secret',
+        'props' => [
+            'placeholder' => '请输入阿里云AccessKey Secret',
+            'type' => 'password'
+        ],
+        '$required' => true,
+        '_fc_id' => 'id_Fbixme9qr7b0adc',
+        'name' => 'ref_Fm5zme9qr7b0aec',
+        '_fc_drag_tag' => 'input',
+        'display' => true,
+        'hidden' => false
+    ],
+    [
+        'type' => 'input',
+        'title' => 'Endpoint',
+        'field' => 'endpoint',
+        'props' => [
+            'placeholder' => '例如:dysmsapi.aliyuncs.com'
+        ],
+        '$required' => true,
+        '_fc_id' => 'id_Fvw7me9qr7b0afc',
+        'name' => 'ref_Fwbyme9qr7b0agc',
+        '_fc_drag_tag' => 'input',
+        'display' => true,
+        'hidden' => false
+    ],
+    [
+        'type' => 'input',
+        'title' => '签名名称',
+        'field' => 'sign_name',
+        'props' => [
+            'placeholder' => '请输入短信签名名称'
+        ],
+        '$required' => true,
+        '_fc_id' => 'id_Fcrbme9qr7b0ahc',
+        'name' => 'ref_F3z5me9qr7b0aic',
+        '_fc_drag_tag' => 'input',
+        'display' => true,
+        'hidden' => false
+    ],
+    [
+        'type' => 'input',
+        'title' => '模板CODE',
+        'field' => 'template_code',
+        'props' => [
+            'placeholder' => '请输入短信模板CODE'
+        ],
+        '$required' => true,
+        '_fc_id' => 'id_Fkzdme9qr7b0ajc',
+        'name' => 'ref_Fo1ome9qr7b0akc',
+        '_fc_drag_tag' => 'input',
+        'display' => true,
+        'hidden' => false
+    ],
+    [
+        'type' => 'inputNumber',
+        'title' => '有效期(分钟)',
+        'field' => 'expire_time',
+        'props' => [
+            'min' => 1,
+            'placeholder' => '验证码有效期'
+        ],
+        '$required' => true,
+        '_fc_id' => 'id_F2l9me9qr7b0alc',
+        'name' => 'ref_Fq34me9qr7b0amc',
+        '_fc_drag_tag' => 'inputNumber',
+        'display' => true,
+        'hidden' => false
+    ]
+];

+ 16 - 0
info.php

@@ -0,0 +1,16 @@
+<?php
+declare(strict_types=1);
+return [
+  'id' => 'aliyun_dysms',
+  'name' => '阿里云大鱼短信',
+  'is_core' => false,
+  'category' => 'other',
+  'description' => '阿里云短信服务',
+  'version' => '1.0.0',
+  'core_version' => '^1.0',
+  'author' => 'yourname',
+  'email' => '',
+  'website' => '',
+  'image' => '',
+  'license' => 'MIT',
+];

+ 14 - 0
src/Extension.php

@@ -0,0 +1,14 @@
+<?php
+declare(strict_types=1);
+
+namespace SixShop\AliyunDysms;
+
+use SixShop\Core\ExtensionAbstract;
+
+class Extension extends ExtensionAbstract
+{
+    protected function getBaseDir(): string
+    {
+        return dirname(__DIR__);
+    }
+}