import request from "@/utils/request";
const { api } = process.env.CONFIG;


export interface GetLicenseAppListProps {
    pageNum: number,
    pageSize: number,
    corpName?: string,
    expiredStart?: string,
    expiredEnd?: string,
    licenseCheckStart?: string,
    licenseCheckEnd?: string
    sortFiled?: string
    sortAsc?: boolean
    bugStatus?: 0 | 1
}

/**
 * 企业许可列表
 * @returns 
 */
export function getLicenseAppListApi(data: GetLicenseAppListProps) {
    return request({
        url: api + `/corpOperation/license/app/listOfPage`,
        method: 'POST',
        data
    })
}


/**
 * 应用信息同步更新 
 * @param params 
 * @returns 
 */
export function syncByCorpAppApi(params: { corpId: string }) {
    return request({
        url: api + `/corpOperation/license/app/syncByCorpId`,
        method: 'PATCH',
        params
    })
}


/**
 * 修改应用信息更新通知人员
 * @param data 
 * @returns 
 */
export function updateCallUserAppApi(data: { corpIdList: string[], userIdList: number[] }) {
    return request({
        url: api + `/corpOperation/license/app/updateCallUserIds`,
        method: 'POST',
        data
    })
}