import {requestInstance} from "@/service/index";
import {UserInfo} from "@/unit/UserInfo";

export function selectInterfaceKoolkitMainPageList(RESOURCE_NAME,RESOURCE_TYPE,INTERFACE_STATE,pageSize,pageIndex){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitMainPageList',
        data:{
            'RESOURCE_NAME':RESOURCE_NAME,
            'RESOURCE_TYPE':RESOURCE_TYPE,
            'INTERFACE_STATE':INTERFACE_STATE,
            'pageSize':pageSize,
            'pageIndex':pageIndex,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}

export function selectInterfaceKoolkitMain(UUID){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitMain',
        data:{
            'UUID':UUID,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}
export function selectInterfaceKoolkitParameter(UUID){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitParameter',
        data:{
            'INTERFACE_UUID':UUID,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}


export function addInterfaceKoolkitApply(INTERFACE_UUID,SHARED_FREQUENCY, SHARED_STARTTIME, SHARED_ENDTIME, USE_TERM, IP_ADDRESS, CONCURRENCY, DAY_LIMIT, APPLY_USER, APPLY_UNIT, APPLY_TIME, APPYL_REASON
){
    return requestInstance({
        url:'/ptjkInterface/addInterfaceKoolkitApply',
        data:{
            "INTERFACE_UUID":INTERFACE_UUID,
            "SHARED_FREQUENCY":SHARED_FREQUENCY,
            "SHARED_STARTTIME":SHARED_STARTTIME,
            "SHARED_ENDTIME":SHARED_ENDTIME,
            "USE_TERM":USE_TERM,
            "IP_ADDRESS":IP_ADDRESS,
            "CONCURRENCY":CONCURRENCY,
            "DAY_LIMIT":DAY_LIMIT,
            "APPLY_USER":APPLY_USER,
            "APPLY_UNIT":APPLY_UNIT,
            "APPLY_TIME":APPLY_TIME,
            "APPYL_REASON":APPYL_REASON,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}

export function selectInterfaceKoolkitApplyPageList(RESOURCE_NAME,RESOURCE_TYPE,APPLY_USER,pageSize,pageIndex){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitApplyPageList',
        data:{
            'RESOURCE_NAME':RESOURCE_NAME,
            'RESOURCE_TYPE':RESOURCE_TYPE,
            'APPLY_USER':APPLY_USER,
            'pageSize':pageSize,
            'pageIndex':pageIndex,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}


export function selectInterfaceKoolkitApplyByUuid(UUID){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitApplyByUuid',
        data:{
            'UUID':UUID,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}


export function selectInterfaceKoolkitWarrant(CID,APPLY_UUID){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitWarrant',
        data:{
            'CID':CID,
            'APPLY_UUID':APPLY_UUID,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}


export function selectDirectiorById(code){
    return requestInstance({
        url:'/gxyw/selectDirectiorById',
        data:{
            'CODE':code,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}

export function selectMetadataId(a_id){
    return requestInstance({
        url:'/gxyw/selectMetadataId',
        data:{
            'a_id':a_id,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}

export function selectServiceDetail(a_code){
    return requestInstance({
        url:'/gxyw/selectServiceDetail',
        data:{
            'a_code':a_code,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}

export function updateLoginLasttime(){
    return requestInstance({
        url:'/user/updateLoginLasttime',
        data:{
            "appkey":new UserInfo().GetUserKeyCode()
        }
    });
}



export function addLoginLog(){
    return requestInstance({
        url:'/user/addLoginLog',
        data:{
            "UNIT":localStorage.getItem("zhfx_unitcode"),
            "userid":localStorage.getItem("zhfx_usercode"),
            "PLATE":"数据分析赋能系统-登录",
            "OPERATION":"登录系统成功",
            "OPERATIONRESULT":"系统登录",
            "appkey":localStorage.getItem("ptjk_userkeycode")
        }
    });
}

export function selectInterfaceKooleitMainType(){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKooleitMainType',
        data:{
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}


export function selectInterfaceKoolkitNewMainPageList(RESOURCE_NAME,RESOURCE_TYPE,INTERFACE_STATE,TYPE,pageSize,pageIndex){
    return requestInstance({
        url:'/ptjkInterface/selectInterfaceKoolkitNewMainPageList',
        data:{
            'RESOURCE_NAME':RESOURCE_NAME,
            'RESOURCE_TYPE':RESOURCE_TYPE,
            'INTERFACE_STATE':INTERFACE_STATE,
            'TYPE':TYPE,
            'pageSize':pageSize,
            'pageIndex':pageIndex,
            "appkey":localStorage.getItem("zhfx_userkeycode")
        }
    });
}



