// @ts-ignore
/* eslint-disable */

// 该文件自动生成，请勿手动修改！

// --------------------------------------------------------------------------
// 机构信息服务
// --------------------------------------------------------------------------

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

/** 添加机构 POST /api/sys/org/add */
export async function add(data: API.AddSysOrgInput, options?: { [key: string]: any }) {
    const url = '/api/sys/org/add';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 更新机构 POST /api/sys/org/update */
export async function update(data: API.UpdateSysOrgInput, options?: { [key: string]: any }) {
    const url = '/api/sys/org/update';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除机构 POST /api/sys/org/del */
export async function del(data: API.BaseId_Int16, options?: { [key: string]: any }) {
    const url = '/api/sys/org/del';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 启用禁用机构 POST /api/sys/org/change-status */
export async function changeStatus(data: API.BaseId_Int16, options?: { [key: string]: any }) {
    const url = '/api/sys/org/change-status';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 根据ID获取机构 GET /api/sys/org/get-by-id */
export async function getById(
    params: {
        /**  */
        id: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/org/get-by-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysOrgOutput>>(url, config);
    return res?.data;
}

/** 查询机构列表 POST /api/sys/org/query-list */
export async function queryList(data: API.QuerySysOrgInput, options?: { [key: string]: any }) {
    const url = '/api/sys/org/query-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysOrgLiteOutput[]>>(url, config);
    return res?.data;
}

/** 分页查询机构列表 POST /api/sys/org/query-page-list */
export async function queryPageList(data: API.SysOrgPageInput, options?: { [key: string]: any }) {
    const url = '/api/sys/org/query-page-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.PageResponse<API.SysOrgOutput>>>(url, config);
    return res?.data;
}

/** 获取全部机构列表 GET /api/sys/org/get-all-list */
export async function getAllList(options?: { [key: string]: any }) {
    const url = '/api/sys/org/get-all-list';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.SysOrgLiteOutput[]>>(url, config);
    return res?.data;
}

/** 根据学校ID获取校区列表 GET /api/sys/org/get-org-branch-by-org-id */
export async function getOrgBranchByOrgId(
    params: {
        /**  */
        orgid: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/org/get-org-branch-by-org-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysOrgLiteOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加机构 POST /api/sys/org/add */
    add,
    /** 更新机构 POST /api/sys/org/update */
    update,
    /** 删除机构 POST /api/sys/org/del */
    del,
    /** 启用禁用机构 POST /api/sys/org/change-status */
    changeStatus,
    /** 根据ID获取机构 GET /api/sys/org/get-by-id */
    getById,
    /** 查询机构列表 POST /api/sys/org/query-list */
    queryList,
    /** 分页查询机构列表 POST /api/sys/org/query-page-list */
    queryPageList,
    /** 获取全部机构列表 GET /api/sys/org/get-all-list */
    getAllList,
    /** 根据学校ID获取校区列表 GET /api/sys/org/get-org-branch-by-org-id */
    getOrgBranchByOrgId,
};
