<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});


Route::post('admin/login','App\Http\Controllers\API\Admin\LoginController@Login')->middleware('log');   //登录
Route::post('/tokenRefresh','App\Http\Controllers\API\TokenController@TokenRefresh')->middleware('log');  //刷新token

Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1'],function () {  //路由分组
    Route::post('admin/getBaseMenuList','App\Http\Controllers\API\Admin\BaseInfoController@GetBaseMenuList');   //登录后获取admin后台用户对应菜单列表
    Route::post('admin/GetBaseUserInfo','App\Http\Controllers\API\Admin\BaseInfoController@GetBaseUserInfo');   //获取admin用户基本信息
    Route::post('admin/getMenuList','App\Http\Controllers\API\Admin\MenuController@GetList');  //admin后台所有菜单管理
    Route::post('admin/GetFatherMenuList','App\Http\Controllers\API\Admin\MenuController@GetFatherMenuList');  //admin后台获取一级菜单
    Route::post('admin/AddMenu','App\Http\Controllers\API\Admin\MenuController@AddMenu');  //admin后台添加菜单
    Route::post('admin/EditMenu','App\Http\Controllers\API\Admin\MenuController@EditMenu');  //admin后台修改菜单
    Route::post('admin/getUserList','App\Http\Controllers\API\Admin\UserController@GetInfoList');  //admin后台获取用户列表
    Route::post('admin/GetSystemUserDetail','App\Http\Controllers\API\Admin\UserController@GetDetail');  //admin后台获取用户详情
    Route::post('admin/adminChangePwd','App\Http\Controllers\API\Admin\UserController@ChangePwd');  //admin后台修改密码
    Route::post('admin/SaveSystemUserInfo','App\Http\Controllers\API\Admin\UserController@Save');  //admin后台保存用户信息
    Route::post('admin/getGroupList','App\Http\Controllers\API\Admin\GroupController@GetList');  //admin后台组列表
    Route::post('admin/GroupChangeMenu','App\Http\Controllers\API\Admin\GroupController@ChangeMenu');  //admin后台组列表
    Route::post('admin/GetGroupMenuList','App\Http\Controllers\API\Admin\GroupController@GetGroupMenuList');  //管理员查询分组使用的菜单
    Route::post('admin/SaveGroup','App\Http\Controllers\API\Admin\GroupController@Save');  //admin后台组列表
    Route::post('admin/CheckMenuAuth','App\Http\Controllers\API\Admin\BaseInfoController@CheckMenuAuth');  //admin后台检查用户菜单权限
    Route::post('UpFile','App\Http\Controllers\API\UpLoadController@UpFile');  //上传文件
    Route::post('admin/ChangInfo','App\Http\Controllers\API\Admin\UserController@ChangInfo');  //修改自身用户信息
    Route::post('admin/GetConfigInfo','App\Http\Controllers\API\Admin\ConfigController@GetConfigInfo');  //获取配置信息
    Route::post('admin/SaveConfigInfo','App\Http\Controllers\API\Admin\ConfigController@SaveConfig');  //保存配置信息
    Route::post('admin/SystemLogGetList','App\Http\Controllers\API\LogController@GetList');//admin后台获取日志列表
    Route::post('admin/GetLogTableName','App\Http\Controllers\API\LogController@GetLogTableName');//admin后台获取日志表名
    //--------------以上为系统基本接口
    Route::post('admin/AppGetList','App\Http\Controllers\API\Admin\YeWu\AppMngrController@GetList');//接入app列表
    Route::post('admin/AppSave','App\Http\Controllers\API\Admin\YeWu\AppMngrController@Save');//保存接入app
    Route::post('admin/AppDel','App\Http\Controllers\API\Admin\YeWu\AppMngrController@Del');//删除接入app
    Route::post('admin/InvoiceGetList','App\Http\Controllers\API\Admin\YeWu\InvoiceController@GetList');//发票列表
    Route::post('admin/InvoiceGetDetail','App\Http\Controllers\API\Admin\YeWu\InvoiceController@GetDetail');//发票列表
    Route::post('admin/InvoiceSave','App\Http\Controllers\API\Admin\YeWu\InvoiceController@Save');//修改发票信息
    Route::post('admin/InvoiceDel','App\Http\Controllers\API\Admin\YeWu\InvoiceController@Del');//删除发票信息
    Route::post('admin/GetWorkOrderList','App\Http\Controllers\API\Admin\YeWu\ChatController@GetWorkOrderList');//获取列表
    Route::post('admin/ChatGetMsgList','App\Http\Controllers\API\Admin\YeWu\ChatController@GetMsgList');//获取chatlist
    Route::post('admin/ChatInsertMsg','App\Http\Controllers\API\Admin\YeWu\ChatController@InsertMsg');//插入消息
    Route::post('admin/GetWorkOrderInfo','App\Http\Controllers\API\H5\ChatController@GetWorkOrderInfo');//获取工单简介
    Route::post('admin/ChangeWorkOrder','App\Http\Controllers\API\Admin\YeWu\ChatController@ChangeWorkOrder');//更改工单状态
    Route::post('admin/WorkOrderDel','App\Http\Controllers\API\Admin\YeWu\ChatController@Del');//更改工单状态
});


Route::post('H5/MianMiLogin','App\Http\Controllers\API\H5\LoginController@H5Login');//H5登录
Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1'],function () {
    Route::post('H5/InvoiceSave','App\Http\Controllers\API\H5\InvoiceController@Save');//H5保存发票申请
    Route::post('H5/InvoiceGetList','App\Http\Controllers\API\H5\InvoiceController@GetList');//H5获取发票列表
    Route::post('H5/InvoiceGetDetail','App\Http\Controllers\API\H5\InvoiceController@GetDetail');//H5获取发票详情
    Route::post('H5/InvoiceGetHistory','App\Http\Controllers\API\H5\InvoiceController@GetHistory');//获取上次填写的历史信息
    Route::post('H5/WorkOrderList','App\Http\Controllers\API\H5\ChatController@GetWorkOrderList');//获取工单列表
    Route::post('H5/WorkOrderSave','App\Http\Controllers\API\H5\ChatController@SaveWorkOrder');//提交工单
    Route::post('H5/GetSelfMsgList','App\Http\Controllers\API\H5\ChatController@GetSelfMsgList');//获取工单详情
    Route::post('H5/GetWorkOrderInfo','App\Http\Controllers\API\H5\ChatController@GetWorkOrderInfo');//获取工单简介
    Route::post('H5/InsertMsg','App\Http\Controllers\API\H5\ChatController@InsertMsg');//H5插入留言
    Route::post('H5/UserChangeWorkOrder','App\Http\Controllers\API\H5\ChatController@UserChangeWorkOrder');//H5用户关闭工单
});







