feat(blog-frontend): 添加 axios 和 swagger 生成的 api

This commit is contained in:
2023-03-05 01:16:26 +08:00
parent 96bae10726
commit 3023679501
25 changed files with 1425 additions and 102 deletions

View File

@@ -1,85 +1,70 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
import VueIndexVuew from '@/views/VueIndexVuew.vue'
import * as api from '@/api-base/index'
// let userAPI = api.UserControllerApiFp();
api.UserControllerApiFactory().getAllUserInfo()
.then(response => {
let data = response.data;
console.log(data)
})
.catch(err => {
console.error(err);
})
</script>
<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
<div class="wrapper">
<HelloWorld msg="You did it!" />
<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>
<RouterView />
<el-container>
<el-header>
<el-row :gutter="20">
<el-col :span="4">
<h1>网站标题</h1>
</el-col>
<el-col :span="16">
<h1>
<RouterLink to="/" class="router-link">首页</RouterLink>
<RouterLink to="/" class="router-link">项目</RouterLink>
<RouterLink to="/" class="router-link">分类</RouterLink>
<a href="/swagger-ui/index.html">Swagger</a>
&nbsp;
<a href="https://editor.swagger.io/">Editor</a>
</h1>
</el-col>
<el-col :span="4">
<h1>头像</h1>
</el-col>
</el-row>
</el-header>
<el-main>
<RouterView />
</el-main>
<el-footer></el-footer>
</el-container>
</template>
<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
nav {
.el-container {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
height: 100%;
padding: 5px;
background-color: aqua;
}
nav a.router-link-exact-active {
color: var(--color-text);
.el-header {
height: 60px;
background-color: aliceblue;
}
nav a.router-link-exact-active:hover {
background-color: transparent;
.el-row {
margin-bottom: 20px;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
.el-col {
background-color: aquamarine;
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
.router-link {
margin-right: 5px;
}
</style>

View File

@@ -0,0 +1,15 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/export * from './apis/blog-controller-api';
export * from './apis/user-controller-api';

View File

@@ -0,0 +1,116 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { ResponseVOListBlogEntity } from '../models';
/**
* BlogControllerApi - axios parameter creator
* @export
*/
export const BlogControllerApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBlogList: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/blog/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* BlogControllerApi - functional programming interface
* @export
*/
export const BlogControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBlogList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOListBlogEntity>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).getBlogList(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* BlogControllerApi - factory interface
* @export
*/
export const BlogControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBlogList(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOListBlogEntity>> {
return BlogControllerApiFp(configuration).getBlogList(options).then((request) => request(axios, basePath));
},
};
};
/**
* BlogControllerApi - object-oriented interface
* @export
* @class BlogControllerApi
* @extends {BaseAPI}
*/
export class BlogControllerApi extends BaseAPI {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlogControllerApi
*/
public async getBlogList(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOListBlogEntity>> {
return BlogControllerApiFp(this.configuration).getBlogList(options).then((request) => request(this.axios, this.basePath));
}
}

View File

@@ -0,0 +1,325 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { ResponseVOUserRegisterResponseVO } from '../models';
import { ResponseVOVoid } from '../models';
import { UserRegisterRequireVO } from '../models';
/**
* UserControllerApi - axios parameter creator
* @export
*/
export const UserControllerApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllUserInfo: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/user/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @param {string} userID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserInfo: async (userID: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'userID' is not null or undefined
if (userID === null || userID === undefined) {
throw new RequiredError('userID','Required parameter userID was null or undefined when calling getUserInfo.');
}
const localVarPath = `/api/v1/user/{userID}/`
.replace(`{${"userID"}}`, encodeURIComponent(String(userID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyUserInfo: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/user/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @param {UserRegisterRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
registerUser: async (body: UserRegisterRequireVO, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling registerUser.');
}
const localVarPath = `/api/v1/user/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* UserControllerApi - functional programming interface
* @export
*/
export const UserControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllUserInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getAllUserInfo(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {string} userID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserInfo(userID: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<any>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getUserInfo(userID, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async modifyUserInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<any>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).modifyUserInfo(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {UserRegisterRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async registerUser(body: UserRegisterRequireVO, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOUserRegisterResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).registerUser(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* UserControllerApi - factory interface
* @export
*/
export const UserControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllUserInfo(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(configuration).getAllUserInfo(options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} userID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserInfo(userID: string, options?: AxiosRequestConfig): Promise<AxiosResponse<any>> {
return UserControllerApiFp(configuration).getUserInfo(userID, options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async modifyUserInfo(options?: AxiosRequestConfig): Promise<AxiosResponse<any>> {
return UserControllerApiFp(configuration).modifyUserInfo(options).then((request) => request(axios, basePath));
},
/**
*
* @param {UserRegisterRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async registerUser(body: UserRegisterRequireVO, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOUserRegisterResponseVO>> {
return UserControllerApiFp(configuration).registerUser(body, options).then((request) => request(axios, basePath));
},
};
};
/**
* UserControllerApi - object-oriented interface
* @export
* @class UserControllerApi
* @extends {BaseAPI}
*/
export class UserControllerApi extends BaseAPI {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getAllUserInfo(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(this.configuration).getAllUserInfo(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} userID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getUserInfo(userID: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<any>> {
return UserControllerApiFp(this.configuration).getUserInfo(userID, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async modifyUserInfo(options?: AxiosRequestConfig) : Promise<AxiosResponse<any>> {
return UserControllerApiFp(this.configuration).modifyUserInfo(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {UserRegisterRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async registerUser(body: UserRegisterRequireVO, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOUserRegisterResponseVO>> {
return UserControllerApiFp(this.configuration).registerUser(body, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import globalAxios, { AxiosRequestConfig, AxiosInstance } from 'axios';
export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, "");
/**
*
* @export
*/
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
/**
*
* @export
* @interface RequestArgs
*/
export interface RequestArgs {
url: string;
options: AxiosRequestConfig;
}
/**
*
* @export
* @class BaseAPI
*/
export class BaseAPI {
protected configuration: Configuration | undefined;
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
};
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
}
}

View File

@@ -0,0 +1,74 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
export interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
username?: string;
password?: string;
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
basePath?: string;
baseOptions?: any;
}
export class Configuration {
/**
* parameter for apiKey security
* @param name security name
* @memberof Configuration
*/
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
username?: string;
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
password?: string;
/**
* parameter for oauth2 security
* @param name security name
* @param scopes oauth2 scope
* @memberof Configuration
*/
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
/**
* override base path
*
* @type {string}
* @memberof Configuration
*/
basePath?: string;
/**
* base options for axios calls
*
* @type {any}
* @memberof Configuration
*/
baseOptions?: any;
constructor(param: ConfigurationParameters = {}) {
this.apiKey = param.apiKey;
this.username = param.username;
this.password = param.password;
this.accessToken = param.accessToken;
this.basePath = param.basePath;
this.baseOptions = param.baseOptions;
}
}

View File

@@ -0,0 +1,17 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
export * from "./api";
export * from "./configuration";
export * from "./models";

View File

@@ -0,0 +1,51 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { UserEntity } from './user-entity';
/**
*
* @export
* @interface AttachEntity
*/
export interface AttachEntity {
/**
*
* @type {number}
* @memberof AttachEntity
*/
id?: number;
/**
*
* @type {Array<string>}
* @memberof AttachEntity
*/
data?: Array<string>;
/**
*
* @type {UserEntity}
* @memberof AttachEntity
*/
uploader?: UserEntity;
/**
*
* @type {Date}
* @memberof AttachEntity
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof AttachEntity
*/
updateTime?: Date;
}

View File

@@ -0,0 +1,51 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { BlogEntity } from './blog-entity';
/**
*
* @export
* @interface BlogAttachEntity
*/
export interface BlogAttachEntity {
/**
*
* @type {number}
* @memberof BlogAttachEntity
*/
id?: number;
/**
*
* @type {Array<string>}
* @memberof BlogAttachEntity
*/
data?: Array<string>;
/**
*
* @type {BlogEntity}
* @memberof BlogAttachEntity
*/
blogEntity?: BlogEntity;
/**
*
* @type {Date}
* @memberof BlogAttachEntity
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof BlogAttachEntity
*/
updateTime?: Date;
}

View File

@@ -0,0 +1,64 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { BlogAttachEntity } from './blog-attach-entity';
import { UserEntity } from './user-entity';
/**
*
* @export
* @interface BlogEntity
*/
export interface BlogEntity {
/**
*
* @type {number}
* @memberof BlogEntity
*/
id?: number;
/**
*
* @type {string}
* @memberof BlogEntity
*/
password?: string;
/**
*
* @type {string}
* @memberof BlogEntity
*/
content?: string;
/**
*
* @type {Array<BlogAttachEntity>}
* @memberof BlogEntity
*/
attachEntities?: Array<BlogAttachEntity>;
/**
*
* @type {UserEntity}
* @memberof BlogEntity
*/
uploader?: UserEntity;
/**
*
* @type {Date}
* @memberof BlogEntity
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof BlogEntity
*/
updateTime?: Date;
}

View File

@@ -0,0 +1,9 @@
export * from './attach-entity';
export * from './blog-attach-entity';
export * from './blog-entity';
export * from './response-volist-blog-entity';
export * from './response-vouser-register-response-vo';
export * from './response-vovoid';
export * from './user-entity';
export * from './user-register-require-vo';
export * from './user-register-response-vo';

View File

@@ -0,0 +1,39 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { BlogEntity } from './blog-entity';
/**
*
* @export
* @interface ResponseVOListBlogEntity
*/
export interface ResponseVOListBlogEntity {
/**
*
* @type {number}
* @memberof ResponseVOListBlogEntity
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOListBlogEntity
*/
msg?: string;
/**
*
* @type {Array<BlogEntity>}
* @memberof ResponseVOListBlogEntity
*/
data?: Array<BlogEntity>;
}

View File

@@ -0,0 +1,39 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { UserRegisterResponseVO } from './user-register-response-vo';
/**
*
* @export
* @interface ResponseVOUserRegisterResponseVO
*/
export interface ResponseVOUserRegisterResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOUserRegisterResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOUserRegisterResponseVO
*/
msg?: string;
/**
*
* @type {UserRegisterResponseVO}
* @memberof ResponseVOUserRegisterResponseVO
*/
data?: UserRegisterResponseVO;
}

View File

@@ -0,0 +1,38 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
* @export
* @interface ResponseVOVoid
*/
export interface ResponseVOVoid {
/**
*
* @type {number}
* @memberof ResponseVOVoid
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOVoid
*/
msg?: string;
/**
*
* @type {any}
* @memberof ResponseVOVoid
*/
data?: any;
}

View File

@@ -0,0 +1,93 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { AttachEntity } from './attach-entity';
import { BlogEntity } from './blog-entity';
/**
*
* @export
* @interface UserEntity
*/
export interface UserEntity {
/**
*
* @type {string}
* @memberof UserEntity
*/
id?: string;
/**
*
* @type {string}
* @memberof UserEntity
*/
email?: string;
/**
*
* @type {string}
* @memberof UserEntity
*/
nickname?: string;
/**
*
* @type {string}
* @memberof UserEntity
*/
password?: string;
/**
*
* @type {Array<string>}
* @memberof UserEntity
*/
permissions?: Array<string>;
/**
*
* @type {string}
* @memberof UserEntity
*/
role?: UserEntityRoleEnum;
/**
*
* @type {Array<AttachEntity>}
* @memberof UserEntity
*/
attachEntities?: Array<AttachEntity>;
/**
*
* @type {Array<BlogEntity>}
* @memberof UserEntity
*/
blogEntities?: Array<BlogEntity>;
/**
*
* @type {Date}
* @memberof UserEntity
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof UserEntity
*/
updateTime?: Date;
}
/**
* @export
* @enum {string}
*/
export enum UserEntityRoleEnum {
GUEST = 'GUEST',
AUTHOR = 'AUTHOR',
ADMINISTRATOR = 'ADMINISTRATOR'
}

View File

@@ -0,0 +1,38 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
* @export
* @interface UserRegisterRequireVO
*/
export interface UserRegisterRequireVO {
/**
*
* @type {string}
* @memberof UserRegisterRequireVO
*/
email?: string;
/**
*
* @type {string}
* @memberof UserRegisterRequireVO
*/
nickname?: string;
/**
*
* @type {string}
* @memberof UserRegisterRequireVO
*/
password?: string;
}

View File

@@ -0,0 +1,56 @@
/* tslint:disable */
/* eslint-disable */
/**
* OpenAPI definition
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
* @export
* @interface UserRegisterResponseVO
*/
export interface UserRegisterResponseVO {
/**
*
* @type {string}
* @memberof UserRegisterResponseVO
*/
id?: string;
/**
*
* @type {string}
* @memberof UserRegisterResponseVO
*/
email?: string;
/**
*
* @type {string}
* @memberof UserRegisterResponseVO
*/
nickname?: string;
/**
*
* @type {Array<string>}
* @memberof UserRegisterResponseVO
*/
permissions?: Array<string>;
/**
*
* @type {Date}
* @memberof UserRegisterResponseVO
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof UserRegisterResponseVO
*/
updateTime?: Date;
}

View File

@@ -0,0 +1,21 @@
{
"compilerOptions": {
"declaration": true,
"target": "es5",
"module": "commonjs",
"noImplicitAny": true,
"outDir": "dist",
"rootDir": ".",
"lib": [
"es6",
"dom"
],
"typeRoots": [
"node_modules/@types"
]
},
"exclude": [
"dist",
"node_modules"
]
}

View File

@@ -71,4 +71,4 @@ body {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}

View File

@@ -1,35 +1,14 @@
@import './base.css';
html,
body {
height: 100%;
width: 100%;
}
#app {
max-width: 1280px;
height: 100%;
width: 100%;
margin: 0 auto;
padding: 2rem;
font-weight: normal;
}
a,
.green {
text-decoration: none;
color: hsla(160, 100%, 37%, 1);
transition: 0.4s;
}
@media (hover: hover) {
a:hover {
background-color: hsla(160, 100%, 37%, 0.2);
}
}
@media (min-width: 1024px) {
body {
display: flex;
place-items: center;
}
#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}
}

View File

@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
</template>

View File

@@ -0,0 +1,82 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
</script>
<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
<div class="wrapper">
<HelloWorld msg="You did it!" />
<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>
</template>
<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>