<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */

$routes->setAutoRoute(true);

/**
 * 공통 화면
 */
$routes->get('/login', 'Login::index');
$routes->get('/logout', 'Login::out');
$routes->get('/', 'Home\Home::dashboard');
$routes->get('/home', 'Home\Home::dashboard');

$routes->get('/home/viewStatData', 'Home\Home::viewStatData'); // 실적조회
$routes->get('/home/getHomeFaxCount', 'Home\Home::getHomeFaxCount'); // 팩스조회
$routes->get('/listfax/listfax/getLists', 'Listfax\ListFax::getLists'); // 팩스수신확인

/**
 * 공통 API
 */
$routes->group('common', ['namespace' => 'App\Controllers\Common'], function ($routes) {
    $routes->get('common/getVrfcCode', 'Common::getVrfcCode');


    $routes->post('common/changeUserPass', 'Common::changeUserPass'); // 비밀번호변경

});

/**
 * 게시판 (board) 그룹
 */
$routes->group('board', ['namespace' => 'App\Controllers\Board'], function ($routes) {

    /**
     * 공지사항
     */
    $routes->get('notice/lists', 'Notice::notice');
    $routes->get('notice/detail/(:num)', 'Notice::detail/$1');
    $routes->get('notice/write', 'Notice::write');
    $routes->get('notice/modify/(:num)', 'Notice::modify/$1');

    // API
    $routes->get('notice/getNoticeList', 'Notice::getNoticeList');
    $routes->post('notice/actWrite', 'Notice::actWrite');
    $routes->post('notice/actModify', 'Notice::actModify');
    $routes->post('notice/remove', 'Notice::actRemove');
    $routes->get('notice/download/(:num)', 'Notice::download/$1');
});

/**
 * 현장확인매물관리
 */
$routes->group('', ['namespace' => 'App\Controllers\Article'], static function ($routes) {
    /**
     * 현장확인매물 내역
     */
    $routes->group('article/receipt', static function ($routes) {
        $routes->get('lists', 'Receipt::lists');
        $routes->get('detail/(:num)', 'Receipt::detail/$1');

        $routes->get('getResultList', 'Receipt::getResultList');
        $routes->get('excel', 'Receipt::excel');

        $routes->post('saveTel', 'Receipt::saveTel'); // 연락가능전화 저장
        $routes->post('resDbYn', 'Receipt::resDbYn'); // 거주여부 저장
        $routes->post('resGround', 'Receipt::resGround'); // 평면도요청 저장
        $routes->post('assignRegist', 'Receipt::assignRegist'); // 예약확정 저장
        $routes->post('requestMovie', 'Receipt::requestMovie'); // 동영상 촬영여부저장
        $routes->post('requestMessage', 'Receipt::requestMessage'); // 중개사메모 저장
        $routes->post('rsrvcancel', 'Receipt::rsrvcancel'); // 예약취소
        $routes->post('chgStatus', 'Receipt::chgStatus'); // 상태변경
        $routes->post('sendSms', 'Receipt::sendSms'); // 문자발송
        $routes->post('saveRecInfo', 'Receipt::saveRecInfo'); // 거주인정보저장
        $routes->get('getRecInfo', 'Receipt::getRecInfo'); // 거주인정보조회
        $routes->get('getHistory', 'Receipt::getHistory'); // 정보변경이력조회
        $routes->get('getImages', 'Receipt::getImages'); // 이미지 목록 조회
        $routes->post('uploadFile', 'Receipt::uploadFile'); // 파일업로드
        $routes->post('removeUploadFile', 'Receipt::removeUploadFile'); // 파일삭제
        $routes->post('updateImageOrder', 'Receipt::updateImageOrder'); // 이미지 순서 업데이트
        $routes->get('downloadAllImages', 'Receipt::downloadAllImages'); // 이미지 일괄 다운로드
        $routes->post('saveImgLocation', 'Receipt::saveImgLocation'); // 촬영위치 저장
    });

    /**
     * 조직별 배정 현황
     */
    $routes->group('article/dept', static function ($routes) {
        $routes->get('lists', 'Dept::lists');
        $routes->get('detail/(:num)', 'Receipt::detail/$1');

        $routes->get('getResultList', 'Dept::getResultList');
        $routes->get('excel', 'Dept::excel');
        $routes->get('excel2', 'Dept::excel2');
        $routes->get('print', 'Dept::print'); // 관할포인트
        $routes->get('updateAssign', 'Dept::updateAssign'); // 배정변경

    });

    /**
     * 녹취매물 내역
     */
    $routes->group('article/record', static function ($routes) {
        $routes->get('lists', 'Record::lists');
        $routes->get('detail/(:num)', 'Receipt::detail/$1');

        $routes->get('getResultList', 'Record::getResultList');
        $routes->get('excel', 'Record::excel');
    });

    /**
     * 처리가능 수량관리
     */
    $routes->group('article/processible', static function ($routes) {
        $routes->get('datecount', 'Processible::datecount');

        // 일자별 처리가능 수량
        $routes->get('getList1', 'Processible::getList1');
        $routes->get('excel', 'Processible::excel');

        // 지역별 수량
        $routes->get('getList2', 'Processible::getList2');
        $routes->post('saveArea', 'Processible::saveArea'); // 데이터 저장

        // 기본 수량
        $routes->get('getList3', 'Processible::getList3');
        $routes->post('saveCount', 'Processible::saveCount'); // 데이터 저장

    });

    /**
     * 아파트 평면도
     */
    $routes->group('article/ground_ctn', static function ($routes) {
        $routes->get('lists', 'GroundCnt::lists');
        $routes->get('detail/(:num)', 'GroundCnt::detail/$1');

        $routes->get('getResultList', 'GroundCnt::getResultList');
        $routes->get('excel', 'GroundCnt::excel');
    });

    /**
     * 현장확인V2 매물 접수 현황
     */
    $routes->group('article/receipt2', static function ($routes) {
        $routes->get('lists', 'Receipt2::lists');

        $routes->get('getResultList', 'Receipt2::getResultList');
        $routes->get('excel', 'Receipt2::excel');
    });

    /**
     * 현장확인V2 조직별 배정 현황
     */
    $routes->group('article/dept2', static function ($routes) {
        $routes->get('lists', 'Dept2::lists');

        $routes->get('getResultList', 'Dept2::getResultList');
        $routes->get('excel', 'Dept2::excel');
    });

});


/**
 * 일반확인매물관리
 */
$routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($routes) {
    /**
     * 확인매물현황
     */
    $routes->group('m701', static function ($routes) {
        $routes->get('m701a/lists', 'M701::lists');
        $routes->get('m701a/detail/(:num)', 'M701::detail/$1');

        /**
         * 확인매물현황 - API
         */
        $routes->get('m701a/getResultList', 'M701::getResultList');
        $routes->get('m701a/excel', 'M701::excel');

        $routes->post('m701a/changePrice', 'M701::changePrice'); // 가격수정
        $routes->post('m701a/chgArticleStatus', 'M701::chgArticleStatus'); // 상태정보변경
        $routes->post('m701a/modifyInfo', 'M701::modifyInfo'); // 정보수정
        $routes->post('m701a/saveMemo', 'M701::saveMemo'); // 메모저장

        $routes->post('m701a/saveDocu', 'M701::saveDocu'); // 서류 저장
        $routes->post('m701a/saveTel', 'M701::saveTel'); // 전화정보 저장
        $routes->post('m701a/saveRegi', 'M701::saveRegi'); // 등기부등본 저장
        $routes->post('m701a/saveFinalRegi', 'M701::saveFinalRegi'); // 검증최종실패 처리

        $routes->post('m701a/uploadFile', 'M701::uploadFile'); // 파일업로드

    });

    /**
     * 배정매물현황
     */
    $routes->group('m702', static function ($routes) {
        $routes->get('m702a/lists', 'M702::lists');
        $routes->get('m702a/detail/(:num)', 'M702::detail/$1');

        /**
         * 배정매물현황 - API
         */
        $routes->get('m702a/getResultList', 'M702::getResultList');
        $routes->get('m702a/excel', 'M702::excel');
        $routes->post('m702a/updateAssign', 'M702::updateAssign'); // 배정변경
        $routes->post('m702a/saveTel', 'M702::saveTel'); // 전화확인 정보 저장
        $routes->post('m702a/modifyInfo', 'M702::modifyInfo'); // 매물정보저장
        $routes->post('m702a/saveDocu', 'M702::saveDocu'); // 서류정보저장

        $routes->post('m702a/uploadFile', 'M702::uploadFile'); // 파일업로드

    });


    /**
     * 홍보확인서현황
     */
    $routes->group('m703', static function ($routes) {
        $routes->get('m703a/lists', 'M703::lists');
        $routes->get('m703a/detail/(:num)', 'M703::detail/$1');

        /**
         * 홍보확인서현황 - API
         */
        $routes->get('m703a/getResultList', 'M703::getResultList');
        $routes->get('m703a/excel', 'M703::excel');
        $routes->post('m703a/saveBunyang', 'M703::saveBunyang'); // 현장확인저장
        $routes->post('m703a/saveOthers', 'M703::saveOthers'); // 홍보확인서아님
        $routes->post('m703a/saveDuplicate', 'M703::saveDuplicate'); // 중복
        $routes->post('m703a/saveBubun', 'M703::saveBubun'); // 부분수신
        $routes->post('m703a/saveFaxImgs', 'M703::saveFaxImgs'); // 매물정보변경
        $routes->post('m703a/getNextFaxImgs', 'M703::getNextFaxImgs'); // 다음매물정보조회
        $routes->post('m703a/saveRequestMessage', 'M703::saveRequestMessage'); // 중개사요청사항저장
        $routes->post('m703a/saveResult', 'M703::saveResult'); // 결과저장


        /**
         * 홍보확인서 확인
         */
        $routes->get('m703a/find', 'M703::find');
    });

    /**
     * 전화확인매물현황
     */
    $routes->group('m704', static function ($routes) {
        $routes->get('m704a/lists', 'M704::lists');
        $routes->get('m704a/detail/(:num)', 'M704::detail/$1');

        /**
         * 전화확인매물현황 - API
         */
        $routes->get('m704a/getResultList', 'M704::getResultList');
        $routes->get('m704a/excel', 'M704::excel');
        $routes->post('m704a/modifyInfo', 'M704::modifyInfo'); // 매물정보 저장
        $routes->post('m704a/uploadFile', 'M704::uploadFile'); // 파일업로드
        $routes->post('m704a/saveMemo', 'M704::saveMemo'); // 메모저장
        $routes->post('m704a/contactFail', 'M704::contactFail'); // 통화실패 저장
        $routes->post('m704a/saveTel', 'M704::saveTel'); // 전화확인정보 저장
        $routes->post('m704a/getNextFaxImgs', 'M704::getNextFaxImgs'); // 다음매물확인
    });

    /**
     * 등기부등본확인매물현황
     */
    $routes->group('m705', static function ($routes) {
        $routes->get('m705a/lists', 'M705::lists');
        $routes->get('m705a/detail/(:num)', 'M705::detail/$1');

        /**
         * 등기부등본확인매물현황 - API
         */
        $routes->get('m705a/getResultList', 'M705::getResultList');
        $routes->get('m705a/excel', 'M705::excel');

        $routes->post('m705a/rotateImage', 'M705::rotateImage'); // 이미지 회전
        $routes->post('m705a/saveCorp', 'M705::saveCorp'); // 법인저장
        $routes->post('m705a/uploadFile', 'M705::uploadFile'); // 파일업로드

        $routes->post('m705a/getNextInfo', 'M705::getNextInfo'); // 다음매물확인
        $routes->post('m705a/saveRegi', 'M705::saveRegi'); // 매물저장
        $routes->post('m705a/getNextInfo', 'M705::getNextInfo'); // 다음매물


    });

    /**
     * 1차 재검증 매물현황
     */
    $routes->group('m706', static function ($routes) {
        $routes->get('m706a/lists', 'M706::lists');
        $routes->get('m706a/detail/(:num)', 'M706::detail/$1');

        /**
         * 1차 재검증 매물현황 - API
         */
        $routes->get('m706a/getResultList', 'M706::getResultList');
        $routes->get('m706a/excel', 'M706::excel');

        $routes->post('m706a/modifyInfo', 'M706::modifyInfo'); // 매물정보 저장
        $routes->post('m706a/saveDocu', 'M706::saveDocu'); // 서류정보 저장
        $routes->post('m706a/saveRegi', 'M706::saveRegi'); // 등기부등본 저장

    });

    /**
     * 현장확인매물 홍보확인서
     */
    $routes->group('m708', static function ($routes) {
        $routes->get('m708a/lists', 'M708::lists');
        $routes->get('m708a/detail/(:num)', 'M708::detail/$1');

        /**
         * 1차 재검증 매물현황 - API
         */
        $routes->get('m708a/getResultList', 'M708::getResultList');
        $routes->get('m708a/excel', 'M708::excel');
        $routes->post('m708a/rotateImage', 'M708::rotateImage'); // 이미지 회전
        $routes->get('m708a/getArticleInfo', 'M708::getArticleInfo'); // 매물검색
        $routes->post('m708a/saveNotArticle', 'M708::saveNotArticle'); // 홍보확인서 아님 저장
        $routes->post('m708a/saveDuplImgs', 'M708::saveDuplImgs'); // 중복으로 저장
        $routes->post('m708a/saveMobileBunyang', 'M708::saveMobileBunyang'); // 모바일분양권 저장
        $routes->post('m708a/saveBunyang', 'M708::saveBunyang'); // 분양권 저장
        $routes->post('m708a/saveRequestMessage', 'M708::saveRequestMessage'); // 중개인 요청사항 저장
        $routes->post('m708a/saveResult', 'M708::saveResult'); // 결과저장
        $routes->post('m708a/saveBunyangCnt', 'M708::saveBunyangCnt'); // 분양계약서조회
        $routes->post('m708a/saveResult3', 'M708::saveResult3'); // 분양계약서저장
        $routes->post('m708a/getNextFaxImgs', 'M708::getNextFaxImgs'); // 다음매물

    });

    /**
     * 모바일 추가 서류
     */
    $routes->group('m709', static function ($routes) {
        $routes->get('m709a/lists', 'M709::lists');
        $routes->get('m709a/detail/(:num)', 'M709::detail/$1');

        /**
         * 모바일 추가 서류 - API
         */
        $routes->get('m709a/getResultList', 'M709::getResultList');
        $routes->get('m709a/excel', 'M709::excel');
        $routes->post('m709a/rotateImage', 'M709::rotateImage'); // 이미지 회전
        $routes->get('m709a/getArticleInfo', 'M709::getArticleInfo'); // 매물검색
        $routes->post('m709a/saveNotArticle', 'M709::saveNotArticle'); // 홍보확인서 아님 저장
        $routes->post('m709a/saveDuplImgs', 'M709::saveDuplImgs'); // 중복으로 저장
        $routes->post('m709a/saveAddress', 'M709::saveAddress'); // 정보 저장
        $routes->post('m709a/saveImageArticle', 'M709::saveImageArticle'); // 확인결과저장
        $routes->post('m709a/getNextFaxImgs', 'M709::getNextFaxImgs'); // 다음매물

    });


    /**
     * 전송대기매물현황
     */
    $routes->group('m710', static function ($routes) {
        $routes->get('m710a/lists', 'M710::lists');

        /**
         * 모바일 추가 서류 - API
         */
        $routes->get('m710a/getResultList', 'M710::getResultList');
        $routes->get('m710a/excel', 'M710::excel');
        $routes->get('m710a/sendApi', 'M710::sendApi'); // 전송요청 api 저장

    });

    /**
     * 모바일 자동검증
     */
    $routes->group('m711', static function ($routes) {
        $routes->get('m711a/lists', 'M711::lists');

        /**
         * 모바일 자동검증 - API
         */
        $routes->get('m711a/getResultList', 'M711::getResultList');

    });

    /**
     * 신홍보확인서 현황
     */
    $routes->group('m712', static function ($routes) {
        $routes->get('m712a/lists', 'M712::lists');
        $routes->get('m712a/detail/(:num)', 'M712::detail/$1');

        /**
         * 신홍보확인서 현황 - API
         */
        $routes->get('m712a/getResultList', 'M712::getResultList');
        $routes->post('m712a/rotateImage', 'M712::rotateImage'); // 이미지 회전
        $routes->post('m712a/uploadFile', 'M712::uploadFile'); // 파일업로드
        $routes->post('m712a/saveNotReceived', 'M712::saveNotReceived'); // 서류미수취 저장
        $routes->post('m712a/saveRegi', 'M712::saveRegi'); // 매물저장
        $routes->post('m712a/nextRegi', 'M712::nextRegi'); // 다음매물

    });

    /**
     * 모바일확인V2 매물현황
     */
    $routes->group('m713', static function ($routes) {
        $routes->get('m713a/lists', 'M713::lists');
        $routes->get('m713a/detail/(:num)', 'M713::detail/$1');

        /**
         * 모바일확인V2 매물현황 - API
         */
        $routes->get('m713a/getResultList', 'M713::getResultList');
        $routes->get('m713a/excel', 'M713::excel');
        $routes->post('m713a/rotateImage', 'M713::rotateImage'); // 이미지 회전
        $routes->post('m713a/saveCorpOwn', 'M713::saveCorpOwn'); // 법인매물저장
        $routes->post('m713a/saveModify', 'M713::saveModify');
        $routes->post('m713a/saveRegi', 'M713::saveRegi'); // 등기부등본 저장
        $routes->post('m713a/nextRegi', 'M713::nextRegi'); // 다음매물

    });

});


/**
 * 아파트단지 DB구축 그룹
 */
$routes->group('article', ['namespace' => 'App\Controllers\Article'], function ($routes) {
    // 아파트단지DB구축현황
    $routes->get('apt/lists', 'Apt::lists');
    $routes->get('apt/detail/(:num)', 'Apt::detail/$1');

    // 관할포인트 인쇄
    $routes->get('apt/print', 'Apt::print');

    /** API - 아파트단지 */
    $routes->get('apt/getAptLists', 'Apt::getAptLists');
    $routes->post('apt/saveAptMemo', 'Apt::saveAptMemo');
    $routes->post('apt/chgAptDamdang', 'Apt::chgAptDamdang');
    $routes->post('apt/chgAptVideoTarget', 'Apt::chgAptVideoTarget');
    $routes->post('apt/chkTakeAptPhotoCnt', 'Apt::chkTakeAptPhotoCnt');
    $routes->get('apt/excel', 'Apt::excel');
    $routes->post('apt/uploadExcel', 'Apt::uploadExcel');

    /** API - 아파트단지 상세 */
    $routes->post('apt/saveKeeper', 'Apt::saveKeeper');
    $routes->post('apt/saveCoordinate', 'Apt::saveCoordinate');
    $routes->post('apt/saveNote', 'Apt::saveNote');
    $routes->post('apt/saveVideoTarget', 'Apt::saveVideoTarget');
    $routes->post('apt/saveVideoReason', 'Apt::saveVideoReason');
    $routes->get('apt/cateJson', 'Apt::cateJson');
    $routes->post('apt/savePhoReason', 'Apt::savePhoReason');
    $routes->post('apt/saveCate', 'Apt::saveCate');
    $routes->post('apt/savePhotoView', 'Apt::savePhotoView');
    $routes->post('apt/removePhoto', 'Apt::removePhoto');
    $routes->post('apt/confirmAptInfo', 'Apt::confirmAptInfo');
    $routes->post('apt/resendAptInfo', 'Apt::resendAptInfo');
    $routes->post('apt/savePhoExplain', 'Apt::savePhoExplain');
    $routes->post('apt/saveWriteComplete', 'Apt::saveWriteComplete');

    $routes->post('apt/uploadFile', 'Apt::uploadFile');
    $routes->post('apt/savePhoCate', 'Apt::savePhoCate');
    $routes->post('apt/reqRemovePho', 'Apt::reqRemovePho');


    // 단지번호 변경/삭제
    $routes->get('apt/del_chg_hscp_no', 'DelChgApt::lists');

    /**
     * 단지번호 변경/삭제 - API
     */
    $routes->get('apt/delChgApt/getAptLists', 'DelChgApt::getAptLists');
    $routes->post('apt/delChgApt/chgAptHscp', 'Apt::chgAptHscp');


    // 아파트 평면도
    $routes->get('apt/lists2', 'Ground::lists');
    $routes->get('apt/ground/detail/(:num)/(:num)', 'Ground::detail/$1/$2');

    /**
     * 아파트 평면도 - API
     */
    $routes->get('apt/ground/getAptLists', 'Ground::getAptLists');
    $routes->get('apt/ground/excel', 'Ground::excel');
    $routes->post('apt/ground/uploadExcel', 'Ground::uploadExcel');
    $routes->post('apt/ground/chgAptDamdang', 'Ground::chgAptDamdang');
    $routes->post('apt/ground/uploadFile', 'Ground::uploadFile');
    $routes->get('apt/ground/print', 'Ground::print');

    $routes->post('apt/ground/saveMemo', 'Ground::saveMemo');
    $routes->post('apt/ground/saveKeeper', 'Ground::saveKeeper');
    $routes->post('apt/ground/statusChange', 'Ground::statusChange');
    $routes->post('apt/ground/saveNote', 'Ground::saveNote');


});

/**
 * 실적관리 (results) 그룹
 */
$routes->group('results', ['namespace' => 'App\Controllers\Results'], function ($routes) {
    /** 화면 */
    $routes->match(['GET', 'POST'], 'summary/stats_s01', 'Summary::lists'); // 현장확인요약실적
    $routes->match(['GET', 'POST'], 'dept/stats_d01', 'Dept::lists'); // 현장확인요약실적
    $routes->match(['GET', 'POST'], 'person/stats_p01', 'Person::lists'); // 현장확인개인별실적
    $routes->match(['GET', 'POST'], 'assign/stats_a01', 'Assign::lists'); // 현장확인인원별배정현황
    $routes->match(['GET', 'POST'], 'm409/m409a/stats', 'M409::stats'); // 확인매물일별실적


    /** API - 현장확인조직별실적 */
    $routes->get('dept/excel', 'Sms::excel');

    /** API - 현장확인개인별실적 */
    $routes->get('person/getUserList', 'Person::getUserList');
    $routes->get('person/excel', 'Person::excel');

    /** API - 현장확인인원별배정현황 */
    $routes->get('assign/getUserList', 'Assign::getUserList');
    $routes->get('assign/excel', 'Assign::excel');

    /** API - 확인매물일별실적 */
});


/**
 * 실적관리 그룹
 */
$routes->group('', ['namespace' => 'App\Controllers\Results'], static function ($routes) {

    // 확인매물일별실적
    $routes->group('m409', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm409a/stats', 'M409::stats');

        // API
        $routes->get('m409a/getResultList', 'M409::getResultList');
        $routes->get('m409a/excel', 'M409::excel');
    });

    // 확인매물개인별실적
    $routes->group('m410', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm410a/stats', 'M410::stats');

        // API
        $routes->get('m410a/getResultList', 'M410::getResultList');
        $routes->get('m410a/excel', 'M410::excel');
    });

    // 확인매물매체사실적
    $routes->group('m411', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm411a/stats', 'M411::stats');

        // API
        $routes->get('m411a/getResultList', 'M411::getResultList');
        $routes->get('m411a/excel', 'M411::excel');
    });

    // 확인매물일자별실적
    $routes->group('m412', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm412a/stats', 'M412::stats');

        // API
        $routes->get('m412a/getResultList', 'M412::getResultList');
        $routes->get('m412a/excel', 'M412::excel');
        $routes->post('m412a/saveSendType', 'M412::saveSendType');
    });

    // 검증소요시간
    $routes->group('m415', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm415a/stats', 'M415::stats');

        // API
        $routes->get('m415a/getResultList', 'M415::getResultList');
        $routes->get('m415a/excel', 'M415::excel');
    });

    // 개인별이동거리
    $routes->group('m416', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm416a/stats', 'M416::stats');

        // API
        $routes->get('m416a/getResultList', 'M416::getResultList');
        $routes->get('m416a/excel', 'M416::excel');
    });

    // 신규매물실적관리
    $routes->group('m417', static function ($routes) {
        $routes->match(['GET', 'POST'], 'm417a/stats', 'M417::stats');

        // API
        $routes->get('m417a/getResultList', 'M417::getResultList');
        $routes->get('m417a/excel', 'M417::excel');
    });

});


/**
 * 시스템관리 (manage) 그룹
 */
$routes->group('manage', ['namespace' => 'App\Controllers\Manage'], function ($routes) {

    /** 화면 */

    $routes->get('sms/lists', 'Sms::lists');
    $routes->get('sms/smsSendView', 'Sms::smsSendView');
    $routes->get('user/lists', 'User::user');
    $routes->get('dept/lists', 'Dept::dept');
    $routes->get('dept/getchkuser', 'Dept::getchkuser');
    $routes->get('menu/lists', 'Menu::lists');
    $routes->get('permit/lists', 'Permit::lists');
    $routes->get('areas/lists', 'Areas::lists');
    $routes->get('dupl_phone/lists', 'Phone::lists');
    $routes->get('scomplex/lists', 'Scomplex::lists');
    $routes->get('loginlog/lists', 'LoginLog::lists');

    /** API - SMS관리 */
    $routes->get('sms/getSmsList', 'Sms::getSmsList');
    $routes->get('sms/excel', 'Sms::excel');
    $routes->get('sms/sendSms', 'Sms::sendSms');

    /** API - 사용자관리 */
    $routes->get('user/getUserList', 'User::getUserList');
    $routes->post('user/save', 'User::saveUser');
    $routes->post('user/remove', 'User::removeUser');
    $routes->get('user/excel', 'User::excel');
    $routes->post('user/saveSms', 'User::saveSms');

    /** API - 조직관리 */
    $routes->get('dept/getDeptList', 'Dept::getDeptList');
    $routes->get('dept/getUserList', 'Dept::getUserList');
    $routes->get('dept/getPdept', 'Dept::getPdept');
    $routes->post('dept/saveDept', 'Dept::saveDept');

    /** API - 메뉴관리 */
    $routes->post('menu/getMenuList', 'Menu::getMenuList');
    $routes->post('menu/saveMenu', 'Menu::saveMenu');

    /** API - 권한관리 */
    $routes->get('permit/getMenuAuthList', 'Permit::getMenuAuthList');
    $routes->post('permit/saveMenuAuth', 'Permit::saveMenuAuth');

    /** API - 지역관리 */
    $routes->post('areas/getAreaList', 'Areas::getAreaList');
    $routes->get('areas/getSvcArea', 'Areas::getSvcArea');
    $routes->post('areas/saveRegion', 'Areas::saveRegion');
    $routes->post('areas/saveAllRegion', 'Areas::saveAllRegion');

    /** API - 전화확인관리 */
    $routes->get('dupl_phone/getDuplPhoneList', 'Phone::getDuplPhoneList');
    $routes->post('dupl_phone/savePhone', 'Phone::savePhone');
    $routes->get('dupl_phone/excel', 'Phone::excel');

    /** API - 특이단지관리 */
    $routes->get('scomplex/getScomplexList', 'Scomplex::getScomplexList');
    $routes->post('scomplex/saveScomplex', 'Scomplex::saveScomplex');
    $routes->get('scomplex/excel', 'Scomplex::excel');

    /** API - 로그인로그관리 */
    $routes->get('loginlog/getLogList', 'LoginLog::getLogList');
    $routes->get('loginlog/excel', 'LoginLog::excel');

    /** Worker 로그 관리 */
    $routes->get('workerlog', 'WorkerLog::index');
    $routes->get('workerlog/stream', 'WorkerLog::stream');
    $routes->get('workerlog/download', 'WorkerLog::download');
    $routes->post('workerlog/delete', 'WorkerLog::delete');
});

/**
 * 금리비교
 */
$routes->group('interest_rates', ['namespace' => 'App\Controllers\Interest'], function ($routes) {
    $routes->get('interest/lists', 'Rates::lists');
});

/**
 * 로그인 API
 */
$routes->post('/login/chkLogin', 'Login::chkLogin');


/*
 * --------------------------------------------------------------------
 * Additional Routing
 * --------------------------------------------------------------------
 *
 * 이 영역에서 다른 라우트 파일을 로드할 수 있습니다.
 */

if (is_file($filepath = APPPATH . 'Config/Routes/Api.php')) {
    require $filepath;
}
