<?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/GetHealthOrganizationEnableList','App\Http\Controllers\API\Admin\YeWu\HealthOrganizationController@GetEnableList');  //admin后台获取可用体检机构列表
    Route::post('admin/CreateCalendar','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@CreateCalendar');  //admin后台创建日历
    Route::post('admin/CalendarGetList','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@getList');  //admin后台获取日历列表
    Route::post('admin/CalendarListDel','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@Del');  //admin后台删除日历
    Route::post('admin/CalendarChangeInfo','App\Http\Controllers\API\Admin\YeWu\healthCalendarController@ChangeInfo');  //admin后台更新日历


});
Route::post('WXGetOpenid','App\Http\Controllers\API\H5\LoginController@wxGetOpenid')->middleware('log');  //微信获取openid
Route::post('SendHouJianNotice','App\Http\Controllers\API\WeiXinController@SendHouJianNotice')->middleware('log');
Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1'],function () {  //路由分组
    Route::post('H5/PersonSave','App\Http\Controllers\API\H5\PersonController@Save');
    Route::post('H5/PersonGetList','App\Http\Controllers\API\H5\PersonController@GetList');
    Route::post('H5/PersonGetDetail','App\Http\Controllers\API\H5\PersonController@GetDetail');
    Route::post('H5/PersonDel','App\Http\Controllers\API\H5\PersonController@Del');
    Route::post('H5/FenZhenGetTiJianLine','App\Http\Controllers\API\H5\FenZhenController@GetTiJianLine');
});




