41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { swaggerError } from "@/utils/swagger-error";
|
|
|
|
import { account } from "./models";
|
|
|
|
import type { SwaggerMessage } from "@/types/swagger.type";
|
|
|
|
export const getAccountsResponse: Record<string, SwaggerMessage> = {
|
|
200: {
|
|
type: "array",
|
|
description: "Массив аккаунтов",
|
|
items: account,
|
|
},
|
|
};
|
|
|
|
export const getAccountResponse: Record<string, SwaggerMessage> = {
|
|
200: account,
|
|
400: swaggerError(400, "invalid user id"),
|
|
};
|
|
|
|
export const createAccountResponse: Record<string, SwaggerMessage> = {
|
|
200: account,
|
|
400: swaggerError(400, "invalid user id"),
|
|
401: swaggerError(401, "invalid token"),
|
|
404: swaggerError(404, "user not found"),
|
|
409: swaggerError(409, "account already exist"),
|
|
};
|
|
|
|
export const setAccountRoleResponse: Record<string, SwaggerMessage> = {
|
|
200: account,
|
|
400: swaggerError(400, "invalid user id"),
|
|
401: swaggerError(401, "invalid token"),
|
|
404: swaggerError(404, "user not found"),
|
|
};
|
|
|
|
export const removeRoleResponse: Record<string, SwaggerMessage> = {
|
|
200: account,
|
|
400: swaggerError(400, "invalid user id"),
|
|
401: swaggerError(401, "invalid token"),
|
|
404: swaggerError(404, "user not found"),
|
|
};
|