import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PlatformSelectionVO, PlatformSelectionForm } from './types';

/** 查询年度入围(平台)列表 */
export function listPlatformSelection(query: any): AxiosPromise<PlatformSelectionVO[]> {
    return request({
        url: '/customer/annualFinalization/list',
        method: 'get',
        params: query
    });
}

/** 获取详细 */
export function getPlatformSelection(id: string | number): AxiosPromise<PlatformSelectionVO> {
    return request({
        url: `/customer/annualFinalization/${id}`,
        method: 'get'
    });
}

/** 新增年度入围(平台) */
export function addPlatformSelection(data: PlatformSelectionForm): AxiosPromise<void> {
    return request({
        url: '/customer/annualFinalization',
        method: 'post',
        data: data
    });
}

/** 修改年度入围(平台) */
export function updatePlatformSelection(data: PlatformSelectionForm): AxiosPromise<void> {
    return request({
        url: '/customer/annualFinalization',
        method: 'put',
        data: data
    });
}

/** 删除年度入围(平台) */
export function delPlatformSelection(id: string | number | (string | number)[]): AxiosPromise<void> {
    return request({
        url: `/customer/annualFinalization/${id}`,
        method: 'delete'
    });
}

/** 权属转移 */
export function transferPlatformSelection(data: any): AxiosPromise<void> {
    return request({
        url: '/customer/annualFinalization/transfer',
        method: 'put',
        data: data
    });
}

/** 发布项目进度 */
export function publishPlatformProgress(data: { projectId: string | number; content: string }): AxiosPromise<void> {
    return request({
        url: '/customer/annualFinalization/progress',
        method: 'post',
        data
    });
}

