<?php

use Illuminate\Support\Facades\Route;
use Modules\WechatPlatform\Http\Controllers\KFMessageController;
use Modules\WechatPlatform\Http\Controllers\WechatKeywordsController;

Route::prefix('wechatPlatform')->group(function(){
    Route::prefix('kfMessage')->middleware('roleCheck:optimizer')->group(function(){
        Route::get('list', [KFMessageController::class, 'list']);
        Route::post('add', [KFMessageController::class, 'add']);
        Route::post('stop', [KFMessageController::class, 'stop']);
        Route::post('delete', [KFMessageController::class, 'delete']);
        Route::post('updateContent', [KFMessageController::class, 'updateContent']);
        Route::post('updateGZH', [KFMessageController::class, 'updateGZH']);
    });

    // 微信公众号设置
    Route::prefix('officialAccount')->group(function () {
        // 关键字列表
        Route::prefix('keyword')->group(function () {
            // 列表
            Route::any("list",[WechatKeywordsController::class,'list']);
            // 添加
            Route::post('add',[WechatKeywordsController::class,'add']);
            // 编辑
            Route::post('edit/{id}',[WechatKeywordsController::class,'edit']);
            // 详情
            Route::any('detail/{id}',[WechatKeywordsController::class,'detail']);
            // 删除
            Route::any('del/{id}',[WechatKeywordsController::class,'del']);
            // 配置公众号
            Route::post('allocation/id',[WechatKeywordsController::class,'allocation']);
        });
    });
});
