<?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('admin/PlanTypeGetList', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@GetList');//号源类型列表
  Route::post('admin/PlanTypeSave', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@Save');//号源类型保存
  Route::post('admin/PlanTypeGetDetail', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@GetDetail');//号源类型详情
  Route::post('admin/PlanTypeDel', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@Del');//号源类型删除
  Route::post('admin/CheckUpTypeGetEnableList', 'App\Http\Controllers\API\Admin\YeWu\CheckUpTypeController@GetEnableList');//可用体检类型列表
  Route::post('admin/PlanModelTimeList', 'App\Http\Controllers\API\Admin\YeWu\PlanModelController@timeList');//获取时间点列表
  Route::post('admin/PlanModelSave', 'App\Http\Controllers\API\Admin\YeWu\PlanModelController@Save');//保存号源模板
  Route::post('admin/PlanModelGetList', 'App\Http\Controllers\API\Admin\YeWu\PlanModelController@GetList');//号源模板列表
  Route::post('admin/PlanModelGetDetail', 'App\Http\Controllers\API\Admin\YeWu\PlanModelController@GetDetail');//号源模板详情
  Route::post('admin/PlanModelDel', 'App\Http\Controllers\API\Admin\YeWu\PlanModelController@Del');//号源模板删除
  Route::post('admin/CreatePlan', 'App\Http\Controllers\API\Admin\YeWu\PlanController@CreatePlan');//生成号源
  Route::post('admin/PlanGetList', 'App\Http\Controllers\API\Admin\YeWu\PlanController@GetList');//号源列表
  Route::post('admin/PlanGetDetail', 'App\Http\Controllers\API\Admin\YeWu\PlanController@GetDetail');//号源详情
  Route::post('admin/PlanSave', 'App\Http\Controllers\API\Admin\YeWu\PlanController@Save');//保存号源详情

  Route::post('admin/ComboGetList', 'App\Http\Controllers\API\Admin\YeWu\ComboController@GetList');//获取套餐列表
  Route::post('admin/ComboGetDetail', 'App\Http\Controllers\API\Admin\YeWu\ComboController@GetDetail');//获取套餐详情
  Route::post('admin/ComboSave', 'App\Http\Controllers\API\Admin\YeWu\ComboController@Save');//获取套餐详情保存

  Route::post('admin/HospitalSave', 'App\Http\Controllers\API\Admin\YeWu\HospitalController@Save');
  Route::post('admin/HospitalGetList', 'App\Http\Controllers\API\Admin\YeWu\HospitalController@GetList');
  Route::post('admin/HospitalGetEnableList', 'App\Http\Controllers\API\Admin\YeWu\HospitalController@GetEnableList');//获取可用的医院信息
  Route::post('admin/GetBaseInfoDetail', 'App\Http\Controllers\API\Admin\YeWu\HospitalController@GetBaseInfoDetail');
  Route::post('admin/SaveCacheInfo', 'App\Http\Controllers\API\Admin\YeWu\HospitalController@SaveCacheInfo');
  Route::post('admin/ComboTypeGetList', 'App\Http\Controllers\API\Admin\YeWu\ComboTypeController@GetList');//套餐类型列表
  Route::post('admin/ComboCrowdGetList', 'App\Http\Controllers\API\Admin\YeWu\ComboCrowdController@GetList');//套餐适应人群
  Route::post('admin/OrderGetList', 'App\Http\Controllers\API\Admin\YeWu\OrderController@GetList');//订单列表
  Route::post('admin/QuestionGetList', 'App\Http\Controllers\API\Admin\YeWu\QuestionController@GetList');//问答列表
  Route::post('admin/QuestionSave', 'App\Http\Controllers\API\Admin\YeWu\QuestionController@Save');//保存题目
  Route::post('admin/QuestionGetDetail', 'App\Http\Controllers\API\Admin\YeWu\QuestionController@GetDetail');//题目详情
  Route::post('admin/QuestionDel', 'App\Http\Controllers\API\Admin\YeWu\QuestionController@Del');//删除题目
  Route::post('admin/ArticleGetList', 'App\Http\Controllers\API\Admin\YeWu\ArticleController@GetList');//获取文章列表



});

Route::post('admin/UpdateCombo', 'App\Http\Controllers\API\Admin\YeWu\ComboController@UpdateCombo')->middleware('log');
Route::post('admin/UpdateItem','App\Http\Controllers\API\Admin\YeWu\ItemController@UpdateItem')->middleware('log');


Route::group(['middleware' => ['log'], 'prefix' => 'v1'], function () {  //路由分组
  Route::post('PayCheck', 'App\Http\Controllers\API\Admin\YeWu\PayController@PayCheck');//支付查询
  Route::post('MakePay', 'App\Http\Controllers\API\Admin\YeWu\PayController@MakePay');//支付
});



