| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- /**
- * 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,
- ResponseContestDetailVo,
- ResponseListContestRegistrationVo,
- ResponseListRankVo,
- ResponsePageVoListContestVo,
- } from "./models";
- import { customAxiosInstance } from "../util/axios-instance";
- export const getContestController = () => {
- /**
- * @summary 分页查询比赛列表
- */
- const queryByPage2 = (params: QueryByPage2Params) => {
- return customAxiosInstance<ResponsePageVoListContestVo>({
- url: `/contest`,
- method: "GET",
- params,
- });
- };
- /**
- * @summary 修改比赛
- */
- const edit2 = (contestDto: ContestDto) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest`,
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- data: contestDto,
- });
- };
- /**
- * @summary 新增比赛
- */
- const add2 = (contestDto: ContestDto) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest`,
- method: "POST",
- headers: { "Content-Type": "application/json" },
- data: contestDto,
- });
- };
- /**
- * @summary 批量删除比赛
- */
- const deleteByIds1 = (params: DeleteByIds1Params) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest`,
- method: "DELETE",
- params,
- });
- };
- /**
- * @summary 修改比赛题目
- */
- const updateProblem = (id: number, contestProblemDto: ContestProblemDto) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest/${id}/problem`,
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- data: contestProblemDto,
- });
- };
- /**
- * @summary 比赛添加题目
- */
- const addProblem = (id: number, contestProblemDto: ContestProblemDto) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest/${id}/problem`,
- method: "POST",
- headers: { "Content-Type": "application/json" },
- data: contestProblemDto,
- });
- };
- /**
- * @summary 比赛移除题目
- */
- const removeProblem = (id: number, params: RemoveProblemParams) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest/${id}/problem`,
- method: "DELETE",
- params,
- });
- };
- /**
- * @summary 报名比赛
- */
- const register = (id: number, contestRegisterDto: ContestRegisterDto) => {
- return customAxiosInstance<ResponseBoolean>({
- url: `/contest/${id}/register`,
- method: "POST",
- headers: { "Content-Type": "application/json" },
- data: contestRegisterDto,
- });
- };
- /**
- * @summary 查询比赛详情
- */
- const getDetail1 = (id: number, params?: GetDetail1Params) => {
- return customAxiosInstance<ResponseContestDetailVo>({
- url: `/contest/${id}`,
- method: "GET",
- params,
- });
- };
- /**
- * @summary 查询比赛报名名单
- */
- const queryRegistrations = (id: number) => {
- return customAxiosInstance<ResponseListContestRegistrationVo>({
- url: `/contest/${id}/registrations`,
- method: "GET",
- });
- };
- /**
- * @summary 查询比赛排行榜
- */
- const getRanking = (id: number) => {
- return customAxiosInstance<ResponseListRankVo>({
- url: `/contest/${id}/ranking`,
- method: "GET",
- });
- };
- return {
- queryByPage2,
- edit2,
- add2,
- deleteByIds1,
- updateProblem,
- addProblem,
- removeProblem,
- register,
- getDetail1,
- queryRegistrations,
- getRanking,
- };
- };
- export type QueryByPage2Result = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["queryByPage2"]>>
- >;
- export type Edit2Result = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["edit2"]>>
- >;
- export type Add2Result = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["add2"]>>
- >;
- export type DeleteByIds1Result = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["deleteByIds1"]>>
- >;
- export type UpdateProblemResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["updateProblem"]>>
- >;
- export type AddProblemResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["addProblem"]>>
- >;
- export type RemoveProblemResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["removeProblem"]>>
- >;
- export type RegisterResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["register"]>>
- >;
- export type GetDetail1Result = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["getDetail1"]>>
- >;
- export type QueryRegistrationsResult = NonNullable<
- Awaited<
- ReturnType<ReturnType<typeof getContestController>["queryRegistrations"]>
- >
- >;
- export type GetRankingResult = NonNullable<
- Awaited<ReturnType<ReturnType<typeof getContestController>["getRanking"]>>
- >;
|