<?php

namespace app\api\route;
use app\common\middleware\JwtAuth;
use think\facade\Route;
//-1已完成，-12正在改，-13没改的
//登录 & 等出 路由表
Route::group(function () {
    Route::post(":version.login",":version.Login/login");        //登出
    //Route::post(":version.logout1",":version.Login/logout");        //登出 todo 还没写

})->allowCrossDomain();

Route::group(function () {
    //检测单 相关路由
    Route::post(":version.getJcdList",":version.Jcd/getJcdList");        //获取检测单列表
    Route::post(":version.getJcdObjectItem",":version.Jcd/getJcdObjectItem");        //填报检测单
    Route::post(":version.upJcdItem",":version.Jcd/upJcdItem");        //上报检测单
    Route::post(":version.saveJcdItem",":version.Jcd/saveJcdItem");        //保存检测项目的检测值
    Route::post(":version.getTestValue",":version.Jcd/createTestValue");        //生成检测报告



    //监管单位路由
    Route::post(":version.AddTask",":version.superviser/create");        //增 添加任务
    Route::post(":version.delTask",":version.superviser/delete");        //删 删除任务
    Route::post(":version.isPublicTask",":version.superviser/update");        //改 修改任务状态（发布状态）
    Route::post(":version.getTaskList",":version.superviser/select");        //查找：监管端渲染任务列表-ok


    //监管端操作
    Route::post(":version.getJgCydList",":version.Cyd/getJgCydList");        //监管端查看抽样单





    //抽样单 相关路由
    Route::post(":version.getCydList",":version.Cyd/getCydList");        //获取抽样单列表
    Route::post(":version.getSampleDetail",":version.Cyd/getCydDetail");        //获取抽样单详情
    Route::post(":version.upCydItem",":version.Cyd/upCydItem");        //上报抽样单

    //填报抽样单
    Route::post(":version.getTestObj",":version.Sample/getSampleObj");        //填报抽样单-step1 获取信息
    Route::post(":version.saveSample",":version.Sample/createSample");        //填报抽样单-step2 保存信息
    Route::post(":version.getSampleId",":version.Sample/createSampleId");        //抽样单中生成样品编码





    //监测模型相关的路由
    Route::post(":version.getModelList",":version.Model/selectModelList");    //显示模型配置页面的列表
    Route::post(":version.saveModel",":version.Model/createModelInfo");       //创建模型信息
    Route::post(":version.delModel",":version.Model/deleteModelInfo");        //删除模型
    Route::post(":version.bindModel",":version.Model/bindModel");        //在执行任务中绑定模型

    Route::post(":version.DoEditModelInfo",":version.Model/updateModelInfo"); //修改模型详情
    Route::post(":version.getModeldetail",":version.Model/getModelInfo");     //获取某个模型的详情信息
    Route::post(":version.getProductList",":version.Product/selectProductList");    //获取检测对象列表
    Route::post(":version.getPesticidesList",":version.Pesticides/selectPesticidesList"); //获取检测项列表
    //牵头单位相关路由
    Route::post(":version.getTaskTest",":version.Organizer/selectTaskList");        //获取牵头单位所属任务
    Route::post(":version.getTaskDetail",":version.Organizer/getTaskInfo");        //获取任务信息
    Route::post(":version.AddUnderTask",":version.Undertaker/createUnderTaker");      //在牵头单位中添加承担单位
    Route::post(":version.delUnderTask",":version.Undertaker/deleteUnderTaskList");      //在牵头单位中获取任务的获取承担单位
    Route::post(":version.qtRelease",":version.Organizer/qtRelease");        //牵头单位发布任务


    //承担单位相关路由
    Route::post(":version.getTaskcd",":version.Undertaker/selectUndertakerTaskList");      //承担单位获取承担单位任务列表
    //Route::post(":version.getTaskDetail",":version.Organizer/getTaskInfo");        //获取任务信息--same牵头单位路由获取任务信息,写在下面了
    Route::post(":version.getSampleList",":version.Sample/selectSampleList");        // 查询抽样单详细信息列表
    //Route::post(":version.getUnderTask",":version.index/getUnderTask");      //获取承担单位--same牵头单位路由获取承担单位信息


    //执行检测-承担单位中，执行检测获取任务信息
    Route::post(":version.getTaskInfo",":version.TaskInformation/getTaskDetail");      //获取任务详情
    Route::post(":version.getSampleTaskList",":version.TaskInformation/getSampleTaskList");//获取抽样任务列表
    Route::post(":version.getCheckTaskList",":version.TaskInformation/getCheckTaskList");//获取检测任务列表
    Route::post(":version.getReportTaskList",":version.TaskInformation/getReportTaskList");//获取报告上传任务列表


    //通用的路由，获取检测单位，抽样单位
    Route::post(":version.getTestList",":version.TaskCommon/getTestUnitList");        //获取检测单位列表--ok

})->allowCrossDomain()->middleware(JwtAuth::class);

//通用库的controller路由
Route::post(":version.ossUpload",":version.Upload/upload")->allowCrossDomain();       //上传文件到oss

/**
 *
POST（CREATE）：在服务器新建一个资源。
DELETE（DELETE）：从服务器删除资源。
PUT（UPDATE）：在服务器更新资源（客户端提供改变后的完整资源）。
GET（SELECT）：从服务器取出资源（一项或多项）。
PATCH（UPDATE）：在服务器更新资源（客户端提供改变的属性）。
 */
//
//Route::post(":version.loginOut",":version.Index/loginOut");        //登出
//
//Route::post(":version.rsa",":version.Ha/rsa");        //登录
//
//Route::post(":version.uploadfile",":version.Sample/uploadfile");        //登录
//Route::post(":version.test",":version.index/test");        //登录
//Route::post(":version.getSampleId",":version.index/getSampleId");        //登录
//Route::post(":version.setSampleStatus",":version.index/setSampleStatus");        //登录
//Route::post(":version.delSample",":version.index/delSample");        //登录
//Route::post(":version.getTestPesticides",":version.index/getTestPesticides");        //登录
//Route::post(":version.saveSamplePesticides",":version.index/saveSamplePesticides");        //登录
//Route::post(":version.editSamplePesticides",":version.index/editSamplePesticides");        //登录
//Route::post(":version.saveTestFile",":version.index/saveTestFile");        //登录
//Route::post(":version.getUnitsFileList",":version.index/getUnitsFileList");        //登录
//Route::post(":version.getGovFileList",":version.index/getGovFileList");        //登录








