<?php

/*
|--------------------------------------------------------------------------
| 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!
|
*/


$api = app('Dingo\Api\Routing\Router');

$api->version('v1', ['namespace' => 'App\Http\Controllers\Api\mini', 'prefix' => 'api/mini', 'middleware' => 'mini'], function ($api) {
    $api->any('test', 'TestController@index');
    $api->any('login', 'AuthController@login');
    $api->any('reset', 'AuthController@reset');
    $api->any('loginByWechat', 'AuthController@loginByWechat');
    $api->any('getUserInfo', 'AuthController@getUserInfo');

    $api->any('projects/create', 'ProjectController@create');
    $api->any('projects/get', 'ProjectController@get');
    $api->any('projects/getAll', 'ProjectController@getAll');
    $api->any('projects/addUser', 'ProjectController@addUser');
    $api->any('projects/detail', 'ProjectController@detail');
    $api->any('projects/getUsers', 'ProjectController@getUsers');
    $api->any('projects/deleteUser', 'ProjectController@deleteUser');
    $api->any('projects/updateUser', 'ProjectController@updateUser');

    $api->any('project-roles/create', 'ProjectRoleController@create');
    $api->any('project-roles/get', 'ProjectRoleController@get');
    $api->any('project-roles/getAll', 'ProjectRoleController@getAll');
    $api->any('project-roles/getByExclude', 'ProjectRoleController@getByExclude');
    $api->any('project-roles/getRoleAndRights', 'ProjectRoleController@getRoleAndRights');

    $api->any('project-users/detail', 'ProjectUserController@detail');

    $api->any('users/search', 'UserController@search');

    $api->any('work-points/get', 'WorkPointController@get');

    $api->any('devices/get', 'DeviceController@get');
    $api->any('devices/getThreeLevel', 'DeviceController@getThreeLevel');

    $api->any('inner-devices/get', 'InnerDeviceController@get');
    $api->any('inner-devices/search', 'InnerDeviceController@search');
    $api->any('inner-devices/search2', 'InnerDeviceController@search2');
    $api->any('inner-devices/detail', 'InnerDeviceController@detail');

    $api->any('specs/get', 'SpecController@get');

    $api->any('rent-types/get', 'RentTypeController@get');

    $api->any('orders/create', 'OrderController@create');
    $api->any('orders/createInner', 'OrderController@createInner');
    $api->any('orders/update', 'OrderController@update');
    $api->any('orders/updateInner', 'OrderController@updateInner');
    $api->any('orders/get', 'OrderController@get');
    $api->any('orders/detail', 'OrderController@detail');
    $api->any('orders/getRole', 'OrderController@getRole');
    $api->any('orders/check', 'OrderController@check');
    $api->any('orders/change', 'OrderController@change');
    $api->any('orders/delete', 'OrderController@delete');

    $api->any('repair-devices/create', 'RepairDeviceController@create');
    $api->any('repair-devices/get', 'RepairDeviceController@get');

    $api->any('order-devices/get', 'OrderDeviceController@get');

    $api->any('parts/get', 'PartController@get');

    $api->any('notifications/getStat', 'NotificationController@getStat');
    $api->any('notifications/get', 'NotificationController@get');
    $api->any('notifications/detail', 'NotificationController@detail');
    $api->any('notifications/change', 'NotificationController@change');
    $api->any('notifications/notReadCount', 'NotificationController@notReadCount');

    $api->any('data/getYearsAndMonths', 'DataController@getYearsAndMonths');
    $api->any('data/getDateInfo', 'DataController@getDateInfo');
    $api->any('data/getStat', 'DataController@getStat');
    $api->any('data/getTotalInfo', 'DataController@getTotalInfo');
    $api->any('data/getDetailData', 'DataController@getDetailData');
    $api->any('data/getYearAndMonthMoney', 'DataController@getYearAndMonthMoney');
    $api->any('data/projectStat', 'DataController@projectStat');

    $api->any('device-names/get', 'DeviceNameController@get');
    $api->any('device-names/getNamesAndSpecs', 'DeviceNameController@getNamesAndSpecs');

    $api->any('uploadFile', 'UploadController@upload');

    $api->any('users/update', 'UserController@update');
    $api->any('users/changePassword', 'UserController@changePassword');
    $api->any('users/getTopRole', 'UserController@getTopRole');
    $api->any('users/getRight', 'UserController@getRight');

    $api->any('feedback/create', 'FeedbackController@create');

    $api->any('rights/get', 'RightController@get');
});