import request from '/@/utils/request';

export interface ModelTypeListParams {
	pageNum: number;
	pageSize: number;
	keyword?: string;
}

export interface ModelTypeItem {
	id: string;
	typeName: string;
	typeCode: string;
	description?: string;
	status: number;
	createTime?: string;
	updateTime?: string;
}

export interface ModelTypeListResponse {
	code: number;
	message: string;
	data: {
		list: ModelTypeItem[];
		total: number;
	};
}

/**
 * 获取模型类型列表
 */
export function getModelTypeList(params: ModelTypeListParams) {
	return request({
		url: '/api/ai-agent/model-config/model-type/list',
		method: 'get',
		params,
	});
}

/**
 * 新增模型类型
 */
export function addModelType(data: Partial<ModelTypeItem>) {
	return request({
		url: '/api/ai-agent/model-config/model-type/add',
		method: 'post',
		data,
	});
}

/**
 * 修改模型类型
 */
export function updateModelType(data: Partial<ModelTypeItem>) {
	return request({
		url: '/api/ai-agent/model-config/model-type/update',
		method: 'put',
		data,
	});
}

/**
 * 删除模型类型
 */
export function deleteModelType(id: string) {
	return request({
		url: `/api/ai-agent/model-config/model-type/delete/${id}`,
		method: 'delete',
	});
}

/**
 * 获取模型类型详情
 */
export function getModelTypeDetail(id: string) {
	return request({
		url: `/api/ai-agent/model-config/model-type/detail/${id}`,
		method: 'get',
	});
}
