import { request } from 'umi';
import type { CardListItemDataType } from './data.d';

export async function queryFakeList(params: {
  count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/api/subjects', {
    params,
  });
}

/**
 * 获取主题列表
 * http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
 * @param params
 * @returns
 */
export async function querySubjectList(params: {
  count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/ypt/careerTraining/subject/listSubject', {
    params,
  });
}

/**
 * 获取可以学习的主题列表（不分页）
 * @param params
 * @returns
 */
export async function listMyLearningSubject(params: {
  identity_id: number;
  person_id: number;
}){
  return request(' /dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject', {
    params,
  });
}

/**
 * 获取标签列表
 * https://www.xiaopiu.com/web/byId?type=project&id=61c45503a4381246987496c6
 * http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6410
 * @param params
 * @returns
 */
 export async function queryTagList(params: {
  count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/ypt/careerTraining/tag/list', {
    params,
  });
}
