<?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.test",":version.SGB/index");                      //测试

    //监管端
    Route::post(":version.getTaskList",":version.JianGuan/getTaskList");                      //获取任务列表              #监管
    Route::post(":version.AddTask",":version.JianGuan/addTaskItem");                          //添加任务                 #监管
    Route::post(":version.delTask",":version.JianGuan/deleteTaskItem");                       //删除任务                 #监管
    Route::post(":version.isPublicTask",":version.JianGuan/editTaskUpdateInfo");              //修改任务：发布/废止        #监管
    Route::post(":version.getJgCydList",":version.Cyd/getJgCydList");                         //监管端查看抽样单           #监管    #抽样单
    Route::post(":version.getQtouList",":version.JianGuan/getJgQtName");                         //监管端获取牵头单位名称           #监管    #牵头 #名称



    //模型相关操作
    Route::post(":version.getModelList",":version.Model/selectModelList");                      //显示模型配置页面的列表       #牵头     #模型
    Route::post(":version.bindModel",":version.Model/bindModel");                               //在执行任务中绑定模型        #模型     #绑定
    Route::post(":version.saveModel",":version.Model/createModelInfo");                         //创建模型信息                #模型     #创建
    Route::post(":version.delModel",":version.Model/deleteModelInfo");                           //删除模型
    Route::post(":version.DoEditModelInfo",":version.Model/updateModelInfo");                   //修改模型详情（通过模型id）
    Route::post(":version.getModeldetail",":version.Model/getModelInfoByModelId");                       //获取某个模型的详情信息（通过模型id）
    Route::post(":version.getModelInfo",":version.Model/getModelInfoByTaskId");                       //获取某个模型的详情信息（通过任务id）
    Route::post(":version.getPesticidesList",":version.Model/selectPesticidesList");            //获取检测项目列表         #模型中 #修改检测项目 #获取检测项目
    Route::post(":version.getProductList",":version.Model/selectProductList");                 //获取检测对象列表         #模型中 #修改检测对象 #获取检测对象



    //牵头单位
    Route::post(":version.getTestList",":version.QianTou/getTestUnitList");                    //获取检测单位，获取抽样单位       #牵头单位   #机构与地域  #选择机构
    Route::post(":version.qtRelease",":version.QianTou/qtRelease");                           //牵头单位发布任务            #修改的是整个任务的状态
    Route::post(":version.getTaskTest",":version.QianTou/selectQtTaskList");                  //获取牵头单位所属任务        #牵头
    Route::post(":version.getTaskDetail",":version.QianTou/getTaskInfo");                     //获取任务信息                 #牵头     #任务     #detail


    Route::post(":version.AddUnderTask",":version.QianTou/createUnderTaker");                    //在牵头单位中 创建承担任务
    Route::post(":version.delUnderTask",":version.QianTou/deleteUnderTaskList");                //牵头单位中 删除创建的承担任务
    Route::post(":version.getTaskBaseInfo",":version.QianTou/getTaskBaseInfo");                //牵头单位中 获取任务的基本信息
    Route::post(":version.getUndertakeList",":version.QianTou/getUndertakeList");                //牵头单位中 获取机构与地域信息



    //承担单位 todo validate从下面开始validate没写

    Route::post(":version.getTaskcd",":version.ChengDan/selectUndertakerTaskList");                 //获取承担的任务列表
    Route::post(":version.getTaskInfo",":version.ChengDan/getTaskDetail");                          //获取任务信息（执行检测）
    Route::post(":version.getSampleTaskList",":version.ChengDan/getSampleTaskList");         //获取抽样任务列表
    Route::post(":version.getCheckTaskList",":version.ChengDan/getCheckTaskList");           //获取检测任务列表
    Route::post(":version.getReportTaskList",":version.ChengDan/getReportTaskList");         //获取报告上传任务列表

    //抽样单 相关路由
    Route::post(":version.getTestObj",":version.Cyd/getSampleObj");        //填报抽样单-step1 获取信息
    Route::post(":version.getSampleId",":version.Cyd/createSampleId");     //填报抽样单-step1 生成样品编码
    Route::post(":version.saveSample",":version.Cyd/createSample");        //填报抽样单-step3 保存信息

    Route::post(":version.getSampleList",":version.Cyd/selectSampleList");        // 查询抽样单详细信息列表

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


    //检测单 相关路由
    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");        //生成检测报告


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

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

//
//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");        //登录








