初始化
缺陷:主题配色需要优化整体的同风格
This commit is contained in:
46
app/Http/Controllers/Api/WxAppController.php
Normal file
46
app/Http/Controllers/Api/WxAppController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\WxAppConfigService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* 小程序应用配置
|
||||
*/
|
||||
class WxAppController extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = WxAppConfigService::getInstance();
|
||||
$this->insertField = ['code', 'name', 'app_id'];
|
||||
$this->updateField = ['id'];
|
||||
$this->notRequest = [
|
||||
'app_secret', 'mch_id', 'mch_key', 'mch_serial_no', 'mch_private_key',
|
||||
'platform_public_key', 'notify_url', 'template_code', 'remark', 'name', 'app_id',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/停用
|
||||
* @Method POST
|
||||
*/
|
||||
public function status(): JsonResponse
|
||||
{
|
||||
return jok(
|
||||
$this->service->status(request()->post('id'), request()->post('status')),
|
||||
'操作成功'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按 .env 引导创建/更新一条应用壳子(不含 AppSecret)
|
||||
* @Method POST
|
||||
*/
|
||||
public function initFromEnv(): JsonResponse
|
||||
{
|
||||
return jok($this->service->initFromEnv(), '初始化成功');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user