/** * Generated by orval v7.0.1 🍺 * Do not edit manually. * Serve API * Serve应用接口文档 * OpenAPI spec version: 0.0.1-SNAPSHOT */ import type { ContestDto, ContestProblemDto, ContestRegisterDto, DeleteByIds1Params, GetDetail1Params, QueryByPage2Params, RemoveProblemParams, ResponseBoolean, ResponseContestVo, ResponseListContestRegistrationVo, ResponseListRankVo, ResponsePageVoListContestVo, } from "./models"; import { customAxiosInstance } from "../util/axios-instance"; export const getContestController = () => { /** * @summary 分页查询比赛列表 */ const queryByPage2 = (params: QueryByPage2Params) => { return customAxiosInstance({ url: `/contest`, method: "GET", params, }); }; /** * @summary 修改比赛 */ const edit2 = (contestDto: ContestDto) => { return customAxiosInstance({ url: `/contest`, method: "PUT", headers: { "Content-Type": "application/json" }, data: contestDto, }); }; /** * @summary 新增比赛 */ const add2 = (contestDto: ContestDto) => { return customAxiosInstance({ url: `/contest`, method: "POST", headers: { "Content-Type": "application/json" }, data: contestDto, }); }; /** * @summary 批量删除比赛 */ const deleteByIds1 = (params: DeleteByIds1Params) => { return customAxiosInstance({ url: `/contest`, method: "DELETE", params, }); }; /** * @summary 修改比赛题目 */ const updateProblem = (id: number, contestProblemDto: ContestProblemDto) => { return customAxiosInstance({ url: `/contest/${id}/problem`, method: "PUT", headers: { "Content-Type": "application/json" }, data: contestProblemDto, }); }; /** * @summary 比赛添加题目 */ const addProblem = (id: number, contestProblemDto: ContestProblemDto) => { return customAxiosInstance({ url: `/contest/${id}/problem`, method: "POST", headers: { "Content-Type": "application/json" }, data: contestProblemDto, }); }; /** * @summary 比赛移除题目 */ const removeProblem = (id: number, params: RemoveProblemParams) => { return customAxiosInstance({ url: `/contest/${id}/problem`, method: "DELETE", params, }); }; /** * @summary 报名比赛 */ const register = (id: number, contestRegisterDto: ContestRegisterDto) => { return customAxiosInstance({ url: `/contest/${id}/register`, method: "POST", headers: { "Content-Type": "application/json" }, data: contestRegisterDto, }); }; /** * @summary 查询比赛详情 */ const getDetail1 = (id: number, params?: GetDetail1Params) => { return customAxiosInstance({ url: `/contest/${id}`, method: "GET", params, }); }; /** * @summary 查询比赛报名名单 */ const queryRegistrations = (id: number) => { return customAxiosInstance({ url: `/contest/${id}/registrations`, method: "GET", }); }; /** * @summary 查询比赛排行榜 */ const getRanking = (id: number) => { return customAxiosInstance({ url: `/contest/${id}/ranking`, method: "GET", }); }; return { queryByPage2, edit2, add2, deleteByIds1, updateProblem, addProblem, removeProblem, register, getDetail1, queryRegistrations, getRanking, }; }; export type QueryByPage2Result = NonNullable< Awaited["queryByPage2"]>> >; export type Edit2Result = NonNullable< Awaited["edit2"]>> >; export type Add2Result = NonNullable< Awaited["add2"]>> >; export type DeleteByIds1Result = NonNullable< Awaited["deleteByIds1"]>> >; export type UpdateProblemResult = NonNullable< Awaited["updateProblem"]>> >; export type AddProblemResult = NonNullable< Awaited["addProblem"]>> >; export type RemoveProblemResult = NonNullable< Awaited["removeProblem"]>> >; export type RegisterResult = NonNullable< Awaited["register"]>> >; export type GetDetail1Result = NonNullable< Awaited["getDetail1"]>> >; export type QueryRegistrationsResult = NonNullable< Awaited< ReturnType["queryRegistrations"]> > >; export type GetRankingResult = NonNullable< Awaited["getRanking"]>> >;