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

/**
 * 分页查询班级荣誉列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/classhonor/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增班级荣誉
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/classhonor',
    method: 'post',
    data
  });
};

/**
 * 获取详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/classhonor/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 编辑班级荣誉
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/classhonor/edit',
    method: 'post',
    data
  });
};

/**
 * 归档班级荣誉
 * @param data
 */
export const editBelong = (data: any) => {
  return request({
    url: '/stuwork/classhonor/editBelong',
    method: 'post',
    data
  });
};

/**
 * 删除班级荣誉
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/classhonor/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 根据班级代码查询班级荣誉
 * @param classCode 班级代码
 */
export const queryClassHonorByClassCode = (classCode: string | number) => {
  return request({
    url: '/stuwork/classhonor/queryClassHonorByClassCode',
    method: 'get',
    params: { classCode },
  });
};
