import { request } from '@umijs/max';


export default {
    //创建分组
    Add(parms: WorkInfoTypes.WorkInfoAddInput) {
        return request('/api/workinfo/add', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    //删除
    Del(parms: WorkInfoTypes.WorkInfoDelInput) {
        return request(`/api/workinfo/del`, {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    //修改
    Update(parms: WorkInfoTypes.WorkInfoUpdateInput) {
        return request('/api/workinfo/update', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    //列表
    List() {
        return request('/api/workinfo/list', {
            method: 'POST',
        });
    },
    /**
     * 分页查询
     * @param parms 
     * @returns 
     */
    PagedList(parms: WorkInfoTypes.Page) {
        return request('/api/workinfo/pagedlist', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    Publish(workId: string){
        return request(`/api/workinfo/publish/${workId}`, {
            method: 'POST'
        });
    },
    UpdateStatus(parms:WorkInfoTypes.WorkInfoStatusUpdateInput){
        return request('/api/workinfo/ForcedEnd', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    ForcedEnd(workId: string){
        return request(`/api/workinfo/forcedend/${workId}`, {
            method: 'POST'
        });
    },
    UpdateStatusList(workId:string){
        return request(`/api/workinfo/statuslist/${workId}`, {
            method: 'GET'
        });
    }
}

