// This file is auto-generated by @hey-api/openapi-ts

import type { CancelablePromise } from "./core/CancelablePromise";
import type { BaseHttpRequest } from "./core/BaseHttpRequest";
import type {
  PostFreshmanAddData,
  PostFreshmanAddResponse,
  GetFreshmanListData,
  GetFreshmanListResponse,
} from "./types.gen";

export class FreshmanService {
  constructor(public readonly httpRequest: BaseHttpRequest) {}

  /**
   * 添加新人
   * @param data The data for the request.
   * @param data.requestBody
   * @returns unknown 返回创建结果
   * @throws ApiError
   */
  public postFreshmanAdd(
    data: PostFreshmanAddData = {},
  ): CancelablePromise<PostFreshmanAddResponse> {
    return this.httpRequest.request({
      method: "POST",
      url: "/api/freshman",
      body: data.requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * 获取新人列表
   * @param data The data for the request.
   * @param data.page 页码
   * @returns unknown 返回列表
   * @throws ApiError
   */
  public getFreshmanList(
    data: GetFreshmanListData = {},
  ): CancelablePromise<GetFreshmanListResponse> {
    return this.httpRequest.request({
      method: "GET",
      url: "/api/freshman",
      query: {
        page: data.page,
      },
      errors: {
        500: "服务器错误",
      },
    });
  }
}
