Files
lgp-admin-plus-api/app/Http/Controllers/Api/WxAppController.php
LQ bcf54c2727 初始化
缺陷:主题配色需要优化整体的同风格
2026-08-14 23:21:21 +08:00

47 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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(), '初始化成功');
}
}