feat: 开发中...

This commit is contained in:
2023-03-29 21:16:22 +08:00
parent 4199c3a56b
commit 0675cdc58a
45 changed files with 2357 additions and 301 deletions

View File

@@ -18,10 +18,8 @@ public class DevSecurityConfig {
.anyRequest().permitAll())
.cors().and()
.csrf().disable()
.formLogin()
.and()
.httpBasic()
.and()
.formLogin().and()
.httpBasic().and()
.build();
}

View File

@@ -21,10 +21,8 @@ public class SecurityConfig {
.anyRequest().authenticated())
.cors().and()
.csrf().disable()
.formLogin()
.and()
.httpBasic()
.and()
.formLogin().and()
.httpBasic().and()
.build();
}

View File

@@ -2,12 +2,13 @@ package cn.hamster3.application.blog.controller;
import cn.hamster3.application.blog.vo.ResponseVO;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@Tag(name = "附件接口", description = "附件相关接口")
@Tag(name = "AttachController", description = "附件相关接口")
@RestController
@RequestMapping("/api/v1/attach")
@RequestMapping(value = "/api/v1/attach",produces = MediaType.APPLICATION_JSON_VALUE)
public class AttachController {
@PostMapping("/")
public ResponseVO<Void> createAttach(@RequestBody MultipartFile file) {

View File

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
@Tag(name = "博文接口", description = "博文相关接口")
@Tag(name = "BlogController", description = "博文相关接口")
@RestController
@RequestMapping(value = "/api/v1/blog", produces = MediaType.APPLICATION_JSON_VALUE)
public class BlogController {

View File

@@ -14,7 +14,7 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
@Tag(name = "网站设置接口", description = "网站设置相关接口")
@Tag(name = "SettingController", description = "网站设置相关接口")
@RestController
@RequestMapping(value = "/api/v1/settings", produces = MediaType.APPLICATION_JSON_VALUE)
public class SettingController {

View File

@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.UUID;
@Tag(name = "用户接口", description = "用户相关接口")
@Tag(name = "UserController", description = "用户相关接口")
@RestController
@RequestMapping(value = "/api/v1/user", produces = MediaType.APPLICATION_JSON_VALUE)
public class UserController {
@@ -41,7 +41,7 @@ public class UserController {
@PostMapping("/")
@Operation(summary = "注册用户")
public ResponseVO<UserInfoResponseVO> createUser(@RequestBody @Valid UserCreateRequireVO requireVO) {
public ResponseVO<UserInfoResponseVO> register(@RequestBody @Valid UserCreateRequireVO requireVO) {
return userService.createUser(requireVO);
}

View File

@@ -22,7 +22,7 @@ public class SettingEntity {
@Column(name = "id", nullable = false, updatable = false, length = 64)
@NotBlank(message = "网站设置 ID 不能为空!")
@Length(message = "网站设置 ID 长度不能超过 64 字符!", max = 64)
@Pattern(message = "网站设置 ID 只能包含字母、数字和下划线!", regexp = "[a-zA-Z0-9-_]+")
@Pattern(message = "网站设置 ID 只能包含字母、数字、点、横线和下划线!", regexp = "[a-zA-Z0-9-_.]+")
private String id;
@Setter

View File

@@ -15,6 +15,7 @@ public interface SettingRepository extends JpaRepository<SettingEntity, String>,
SettingEntity findByIdIgnoreCase(String id);
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
boolean existsByIdIgnoreCase(String id);
@Transactional

View File

@@ -1,38 +1,70 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { RouterLink, RouterView } from 'vue-router'
import * as api from '@/api-base/index'
import { SettingControllerApiFactory, UserControllerApiFactory, UserInfoResponseVORoleEnum, type UserInfoResponseVO } from '@/api-base';
let title = ref("网站标题")
let title = ref<string>()
let navigationMenu = ref([{
url: "/about",
text: "关于我"
}])
let currentUserInfo = ref<UserInfoResponseVO | null>(null)
onMounted(() => {
api.SiteSettingControllerApiFactory().getSiteTitle()
SettingControllerApiFactory().getSettingContent("site.title")
.then(response => {
console.log(response.data)
title.value = response.data.data || "网站标题"
let vo = response.data;
title.value = vo.data ?? "网站标题"
})
.catch(err => {
console.error(err);
})
})
const activeIndex = ref('index')
const handleSelect = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
SettingControllerApiFactory().getSettingContent("site.navigation.menus")
.then(response => {
let vo = response.data;
if (vo.code === 200) {
let navigationMenuObject = JSON.parse(vo.data || "{}")
navigationMenu.value = navigationMenuObject
}
})
UserControllerApiFactory().getCurrentUserInfo()
.then(response => {
let vo = response.data;
if (vo.code === 200) {
console.log(vo.data);
}
})
});
</script>
<template>
<el-container>
<el-header>
<el-menu :default-active="activeIndex" mode="horizontal" :ellipsis="false" @select="handleSelect">
<el-menu-item index="index"> {{ title }} </el-menu-item>
<el-menu-item index="categorize"> 分类 </el-menu-item>
<el-menu-item index="tags"> 标签 </el-menu-item>
<el-menu default-active="index" mode="horizontal" :ellipsis="false">
<el-menu-item index="index">
<router-link to="/">{{ title }}</router-link>
</el-menu-item>
<el-menu-item index="tags">
<router-link to="/tags">标签</router-link>
</el-menu-item>
<el-menu-item v-for="customMenu in navigationMenu">
<router-link :to="customMenu.url">{{ customMenu.text }}</router-link>
</el-menu-item>
<div class="flex-grow" />
<el-menu-item index="login">登录 </el-menu-item>
<el-menu-item index="register"> 注册 </el-menu-item>
<el-menu-item index="login" v-if="!currentUserInfo">
<router-link to="/login">登录</router-link>
</el-menu-item>
<el-menu-item index="register" v-if="!currentUserInfo">
<router-link to="/register">注册</router-link>
</el-menu-item>
<el-menu-item index="register" v-if="currentUserInfo?.role === UserInfoResponseVORoleEnum.ADMIN">
<router-link to="/register">设置</router-link>
</el-menu-item>
</el-menu>
</el-header>
<el-main>

View File

@@ -12,6 +12,6 @@
* Do not edit the class manually.
*/export * from './apis/attach-controller-api';
export * from './apis/blog-controller-api';
export * from './apis/site-setting-controller-api';
export * from './apis/setting-controller-api';
export * from './apis/user-controller-api';

View File

@@ -67,6 +67,117 @@ export const AttachControllerApiAxiosParamCreator = function (configuration?: Co
options: localVarRequestOptions,
};
},
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAttach: async (attachID: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'attachID' is not null or undefined
if (attachID === null || attachID === undefined) {
throw new RequiredError('attachID','Required parameter attachID was null or undefined when calling deleteAttach.');
}
const localVarPath = `/api/v1/attach/{attachID}/`
.replace(`{${"attachID"}}`, encodeURIComponent(String(attachID)));
// 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: 'DELETE', ...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} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAttach: async (attachID: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'attachID' is not null or undefined
if (attachID === null || attachID === undefined) {
throw new RequiredError('attachID','Required parameter attachID was null or undefined when calling getAttach.');
}
const localVarPath = `/api/v1/attach/{attachID}/`
.replace(`{${"attachID"}}`, encodeURIComponent(String(attachID)));
// 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}
*/
getAttachList: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/attach/`;
// 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 {AttachAttachIDBody} body
@@ -137,6 +248,44 @@ export const AttachControllerApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteAttach(attachID: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await AttachControllerApiAxiosParamCreator(configuration).deleteAttach(attachID, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAttach(attachID: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await AttachControllerApiAxiosParamCreator(configuration).getAttach(attachID, 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 getAttachList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await AttachControllerApiAxiosParamCreator(configuration).getAttachList(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {AttachAttachIDBody} body
@@ -169,6 +318,32 @@ export const AttachControllerApiFactory = function (configuration?: Configuratio
async createAttach(body: V1AttachBody, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(configuration).createAttach(body, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteAttach(attachID: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(configuration).deleteAttach(attachID, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAttach(attachID: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(configuration).getAttach(attachID, options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAttachList(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(configuration).getAttachList(options).then((request) => request(axios, basePath));
},
/**
*
* @param {AttachAttachIDBody} body
@@ -199,6 +374,35 @@ export class AttachControllerApi extends BaseAPI {
public async createAttach(body: V1AttachBody, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(this.configuration).createAttach(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttachControllerApi
*/
public async deleteAttach(attachID: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(this.configuration).deleteAttach(attachID, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} attachID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttachControllerApi
*/
public async getAttach(attachID: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(this.configuration).getAttach(attachID, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AttachControllerApi
*/
public async getAttachList(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return AttachControllerApiFp(this.configuration).getAttachList(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {AttachAttachIDBody} body

View File

@@ -16,7 +16,10 @@ 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';
import { BlogUpdateRequireVO } from '../models';
import { ResponseVOBlogInfoResponseVO } from '../models';
import { ResponseVOListBlogInfoResponseVO } from '../models';
import { ResponseVOLong } from '../models';
import { ResponseVOVoid } from '../models';
/**
* BlogControllerApi - axios parameter creator
@@ -26,10 +29,16 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
return {
/**
*
* @summary 创建博文
* @param {BlogUpdateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createBlog: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
createBlog: async (body: BlogUpdateRequireVO, 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 createBlog.');
}
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');
@@ -41,6 +50,8 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
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]);
@@ -51,6 +62,8 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
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,
@@ -59,11 +72,18 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
},
/**
*
* @summary 获取博文信息
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBlogList: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/blog/`;
getBlogInfo: async (blogID: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'blogID' is not null or undefined
if (blogID === null || blogID === undefined) {
throw new RequiredError('blogID','Required parameter blogID was null or undefined when calling getBlogInfo.');
}
const localVarPath = `/api/v1/blog/{blogID}/`
.replace(`{${"blogID"}}`, encodeURIComponent(String(blogID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
@@ -92,14 +112,67 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
},
/**
*
* @param {string} blogID
* @summary 获取博文列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyBlog: async (blogID: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
getBlogInfoList: async (page: number, size: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'page' is not null or undefined
if (page === null || page === undefined) {
throw new RequiredError('page','Required parameter page was null or undefined when calling getBlogInfoList.');
}
// verify required parameter 'size' is not null or undefined
if (size === null || size === undefined) {
throw new RequiredError('size','Required parameter size was null or undefined when calling getBlogInfoList.');
}
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;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
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,
};
},
/**
*
* @summary 删除博文
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeBlog: async (blogID: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'blogID' is not null or undefined
if (blogID === null || blogID === undefined) {
throw new RequiredError('blogID','Required parameter blogID was null or undefined when calling modifyBlog.');
throw new RequiredError('blogID','Required parameter blogID was null or undefined when calling removeBlog.');
}
const localVarPath = `/api/v1/blog/{blogID}/`
.replace(`{${"blogID"}}`, encodeURIComponent(String(blogID)));
@@ -109,7 +182,7 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
@@ -124,6 +197,55 @@ export const BlogControllerApiAxiosParamCreator = function (configuration?: Conf
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary 更新博文
* @param {BlogUpdateRequireVO} body
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateBlog: async (body: BlogUpdateRequireVO, blogID: number, 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 updateBlog.');
}
// verify required parameter 'blogID' is not null or undefined
if (blogID === null || blogID === undefined) {
throw new RequiredError('blogID','Required parameter blogID was null or undefined when calling updateBlog.');
}
const localVarPath = `/api/v1/blog/{blogID}/`
.replace(`{${"blogID"}}`, encodeURIComponent(String(blogID)));
// 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;
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,
@@ -140,11 +262,13 @@ export const BlogControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary 创建博文
* @param {BlogUpdateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createBlog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).createBlog(options);
async createBlog(body: BlogUpdateRequireVO, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOLong>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).createBlog(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@@ -152,11 +276,13 @@ export const BlogControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @summary 获取博文信息
* @param {number} blogID
* @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);
async getBlogInfo(blogID: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOBlogInfoResponseVO>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).getBlogInfo(blogID, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@@ -164,12 +290,43 @@ export const BlogControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} blogID
* @summary 获取博文列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async modifyBlog(blogID: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).modifyBlog(blogID, options);
async getBlogInfoList(page: number, size: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOListBlogInfoResponseVO>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).getBlogInfoList(page, size, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 删除博文
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async removeBlog(blogID: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).removeBlog(blogID, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 更新博文
* @param {BlogUpdateRequireVO} body
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateBlog(body: BlogUpdateRequireVO, blogID: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await BlogControllerApiAxiosParamCreator(configuration).updateBlog(body, blogID, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@@ -186,28 +343,55 @@ export const BlogControllerApiFactory = function (configuration?: Configuration,
return {
/**
*
* @summary 创建博文
* @param {BlogUpdateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createBlog(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(configuration).createBlog(options).then((request) => request(axios, basePath));
async createBlog(body: BlogUpdateRequireVO, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOLong>> {
return BlogControllerApiFp(configuration).createBlog(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 获取博文信息
* @param {number} blogID
* @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));
async getBlogInfo(blogID: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOBlogInfoResponseVO>> {
return BlogControllerApiFp(configuration).getBlogInfo(blogID, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} blogID
* @summary 获取博文列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async modifyBlog(blogID: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(configuration).modifyBlog(blogID, options).then((request) => request(axios, basePath));
async getBlogInfoList(page: number, size: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOListBlogInfoResponseVO>> {
return BlogControllerApiFp(configuration).getBlogInfoList(page, size, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 删除博文
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async removeBlog(blogID: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(configuration).removeBlog(blogID, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 更新博文
* @param {BlogUpdateRequireVO} body
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateBlog(body: BlogUpdateRequireVO, blogID: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(configuration).updateBlog(body, blogID, options).then((request) => request(axios, basePath));
},
};
};
@@ -221,30 +405,59 @@ export const BlogControllerApiFactory = function (configuration?: Configuration,
export class BlogControllerApi extends BaseAPI {
/**
*
* @summary 创建博文
* @param {BlogUpdateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlogControllerApi
*/
public async createBlog(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(this.configuration).createBlog(options).then((request) => request(this.axios, this.basePath));
public async createBlog(body: BlogUpdateRequireVO, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOLong>> {
return BlogControllerApiFp(this.configuration).createBlog(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 获取博文信息
* @param {number} blogID
* @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));
public async getBlogInfo(blogID: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOBlogInfoResponseVO>> {
return BlogControllerApiFp(this.configuration).getBlogInfo(blogID, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} blogID
* @summary 获取博文列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlogControllerApi
*/
public async modifyBlog(blogID: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(this.configuration).modifyBlog(blogID, options).then((request) => request(this.axios, this.basePath));
public async getBlogInfoList(page: number, size: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOListBlogInfoResponseVO>> {
return BlogControllerApiFp(this.configuration).getBlogInfoList(page, size, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 删除博文
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlogControllerApi
*/
public async removeBlog(blogID: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(this.configuration).removeBlog(blogID, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 更新博文
* @param {BlogUpdateRequireVO} body
* @param {number} blogID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlogControllerApi
*/
public async updateBlog(body: BlogUpdateRequireVO, blogID: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return BlogControllerApiFp(this.configuration).updateBlog(body, blogID, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@@ -0,0 +1,460 @@
/* 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 { ResponseVOPageableVOSettingInfoResponseVO } from '../models';
import { ResponseVOSettingInfoResponseVO } from '../models';
import { ResponseVOString } from '../models';
import { ResponseVOVoid } from '../models';
import { SettingUpdateRequireVO } from '../models';
/**
* SettingControllerApi - axios parameter creator
* @export
*/
export const SettingControllerApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary 删除网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteSetting: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling deleteSetting.');
}
const localVarPath = `/api/v1/settings/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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: 'DELETE', ...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,
};
},
/**
*
* @summary 获取网站设置
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSetting: async (page: number, size: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'page' is not null or undefined
if (page === null || page === undefined) {
throw new RequiredError('page','Required parameter page was null or undefined when calling getSetting.');
}
// verify required parameter 'size' is not null or undefined
if (size === null || size === undefined) {
throw new RequiredError('size','Required parameter size was null or undefined when calling getSetting.');
}
const localVarPath = `/api/v1/settings/`;
// 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;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
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,
};
},
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSettingContent: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getSettingContent.');
}
const localVarPath = `/api/v1/settings/{id}/content/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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,
};
},
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSettingInfo: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getSettingInfo.');
}
const localVarPath = `/api/v1/settings/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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,
};
},
/**
*
* @summary 更改网站设置
* @param {SettingUpdateRequireVO} body
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSetting: async (body: SettingUpdateRequireVO, id: string, 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 updateSetting.');
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling updateSetting.');
}
const localVarPath = `/api/v1/settings/{id}/`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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;
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,
};
},
}
};
/**
* SettingControllerApi - functional programming interface
* @export
*/
export const SettingControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary 删除网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteSetting(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await SettingControllerApiAxiosParamCreator(configuration).deleteSetting(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 获取网站设置
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSetting(page: number, size: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOPageableVOSettingInfoResponseVO>>> {
const localVarAxiosArgs = await SettingControllerApiAxiosParamCreator(configuration).getSetting(page, size, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSettingContent(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOString>>> {
const localVarAxiosArgs = await SettingControllerApiAxiosParamCreator(configuration).getSettingContent(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSettingInfo(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOSettingInfoResponseVO>>> {
const localVarAxiosArgs = await SettingControllerApiAxiosParamCreator(configuration).getSettingInfo(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 更改网站设置
* @param {SettingUpdateRequireVO} body
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateSetting(body: SettingUpdateRequireVO, id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await SettingControllerApiAxiosParamCreator(configuration).updateSetting(body, id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* SettingControllerApi - factory interface
* @export
*/
export const SettingControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @summary 删除网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteSetting(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return SettingControllerApiFp(configuration).deleteSetting(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 获取网站设置
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSetting(page: number, size: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOPageableVOSettingInfoResponseVO>> {
return SettingControllerApiFp(configuration).getSetting(page, size, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSettingContent(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOString>> {
return SettingControllerApiFp(configuration).getSettingContent(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSettingInfo(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOSettingInfoResponseVO>> {
return SettingControllerApiFp(configuration).getSettingInfo(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 更改网站设置
* @param {SettingUpdateRequireVO} body
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateSetting(body: SettingUpdateRequireVO, id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return SettingControllerApiFp(configuration).updateSetting(body, id, options).then((request) => request(axios, basePath));
},
};
};
/**
* SettingControllerApi - object-oriented interface
* @export
* @class SettingControllerApi
* @extends {BaseAPI}
*/
export class SettingControllerApi extends BaseAPI {
/**
*
* @summary 删除网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SettingControllerApi
*/
public async deleteSetting(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return SettingControllerApiFp(this.configuration).deleteSetting(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 获取网站设置
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SettingControllerApi
*/
public async getSetting(page: number, size: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOPageableVOSettingInfoResponseVO>> {
return SettingControllerApiFp(this.configuration).getSetting(page, size, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SettingControllerApi
*/
public async getSettingContent(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOString>> {
return SettingControllerApiFp(this.configuration).getSettingContent(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 获取网站设置
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SettingControllerApi
*/
public async getSettingInfo(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOSettingInfoResponseVO>> {
return SettingControllerApiFp(this.configuration).getSettingInfo(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 更改网站设置
* @param {SettingUpdateRequireVO} body
* @param {string} id 设置ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SettingControllerApi
*/
public async updateSetting(body: SettingUpdateRequireVO, id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return SettingControllerApiFp(this.configuration).updateSetting(body, id, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@@ -1,116 +0,0 @@
/* 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 { ResponseVOString } from '../models';
/**
* SiteSettingControllerApi - axios parameter creator
* @export
*/
export const SiteSettingControllerApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSiteTitle: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/settings/title`;
// 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,
};
},
}
};
/**
* SiteSettingControllerApi - functional programming interface
* @export
*/
export const SiteSettingControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSiteTitle(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOString>>> {
const localVarAxiosArgs = await SiteSettingControllerApiAxiosParamCreator(configuration).getSiteTitle(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* SiteSettingControllerApi - factory interface
* @export
*/
export const SiteSettingControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSiteTitle(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOString>> {
return SiteSettingControllerApiFp(configuration).getSiteTitle(options).then((request) => request(axios, basePath));
},
};
};
/**
* SiteSettingControllerApi - object-oriented interface
* @export
* @class SiteSettingControllerApi
* @extends {BaseAPI}
*/
export class SiteSettingControllerApi extends BaseAPI {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SiteSettingControllerApi
*/
public async getSiteTitle(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOString>> {
return SiteSettingControllerApiFp(this.configuration).getSiteTitle(options).then((request) => request(this.axios, this.basePath));
}
}

View File

@@ -16,12 +16,14 @@ 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 { ResponseVOListUserInfoResponseVO } from '../models';
import { ResponseVOPageableVOAttachInfoResponseVO } from '../models';
import { ResponseVOPageableVOBlogInfoResponseVO } from '../models';
import { ResponseVOPageableVOUserInfoResponseVO } from '../models';
import { ResponseVOUserInfoResponseVO } from '../models';
import { ResponseVOUserRegisterResponseVO } from '../models';
import { ResponseVOVoid } from '../models';
import { UserModifyRequireVO } from '../models';
import { UserRegisterRequireVO } from '../models';
import { UserCreateRequireVO } from '../models';
import { UserLoginRequireVO } from '../models';
import { UserUpdateRequireVO } from '../models';
/**
* UserControllerApi - axios parameter creator
* @export
@@ -30,10 +32,16 @@ export const UserControllerApiAxiosParamCreator = function (configuration?: Conf
return {
/**
*
* @summary 注册用户
* @param {UserCreateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllUserInfo: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
createUser: async (body: UserCreateRequireVO, 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 createUser.');
}
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');
@@ -41,6 +49,96 @@ export const UserControllerApiAxiosParamCreator = function (configuration?: Conf
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,
};
},
/**
*
* @summary 查询用户列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllUserInfo: async (page: number, size: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'page' is not null or undefined
if (page === null || page === undefined) {
throw new RequiredError('page','Required parameter page was null or undefined when calling getAllUserInfo.');
}
// verify required parameter 'size' is not null or undefined
if (size === null || size === undefined) {
throw new RequiredError('size','Required parameter size was null or undefined when calling getAllUserInfo.');
}
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;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
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,
};
},
/**
*
* @summary 查询当前用户
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentUserInfo: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/user/current`;
// 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;
@@ -63,7 +161,124 @@ export const UserControllerApiAxiosParamCreator = function (configuration?: Conf
},
/**
*
* @param {string} userID
* @summary 查询用户所有附件
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserAttachList: async (userID: string, page: number, size: number, 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 getUserAttachList.');
}
// verify required parameter 'page' is not null or undefined
if (page === null || page === undefined) {
throw new RequiredError('page','Required parameter page was null or undefined when calling getUserAttachList.');
}
// verify required parameter 'size' is not null or undefined
if (size === null || size === undefined) {
throw new RequiredError('size','Required parameter size was null or undefined when calling getUserAttachList.');
}
const localVarPath = `/api/v1/user/{userID}/attach/`
.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;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
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,
};
},
/**
*
* @summary 查询用户所有博文
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserBlogList: async (userID: string, page: number, size: number, 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 getUserBlogList.');
}
// verify required parameter 'page' is not null or undefined
if (page === null || page === undefined) {
throw new RequiredError('page','Required parameter page was null or undefined when calling getUserBlogList.');
}
// verify required parameter 'size' is not null or undefined
if (size === null || size === undefined) {
throw new RequiredError('size','Required parameter size was null or undefined when calling getUserBlogList.');
}
const localVarPath = `/api/v1/user/{userID}/blog/`
.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;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
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,
};
},
/**
*
* @summary 查询用户
* @param {string} userID 用户ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -102,23 +317,24 @@ export const UserControllerApiAxiosParamCreator = function (configuration?: Conf
},
/**
*
* @param {UserModifyRequireVO} body
* @summary 登录用户
* @param {UserLoginRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyUserInfo: async (body: UserModifyRequireVO, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
loginUser: async (body: UserLoginRequireVO, 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 modifyUserInfo.');
throw new RequiredError('body','Required parameter body was null or undefined when calling loginUser.');
}
const localVarPath = `/api/v1/user/`;
const localVarPath = `/api/v1/user/login`;
// 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 localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
@@ -144,23 +360,30 @@ export const UserControllerApiAxiosParamCreator = function (configuration?: Conf
},
/**
*
* @param {UserRegisterRequireVO} body
* @summary 更新用户信息
* @param {UserUpdateRequireVO} body
* @param {string} userID 用户ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
registerUser: async (body: UserRegisterRequireVO, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
updateUser: async (body: UserUpdateRequireVO, userID: string, 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.');
throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.');
}
const localVarPath = `/api/v1/user/`;
// 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 updateUser.');
}
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: 'POST', ...baseOptions, ...options};
const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
@@ -195,11 +418,13 @@ export const UserControllerApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary 注册用户
* @param {UserCreateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllUserInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOListUserInfoResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getAllUserInfo(options);
async createUser(body: UserCreateRequireVO, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOUserInfoResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).createUser(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@@ -207,7 +432,68 @@ export const UserControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {string} userID
* @summary 查询用户列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllUserInfo(page: number, size: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOPageableVOUserInfoResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getAllUserInfo(page, size, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 查询当前用户
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCurrentUserInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOUserInfoResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getCurrentUserInfo(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 查询用户所有附件
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserAttachList(userID: string, page: number, size: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOPageableVOAttachInfoResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getUserAttachList(userID, page, size, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 查询用户所有博文
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserBlogList(userID: string, page: number, size: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOPageableVOBlogInfoResponseVO>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).getUserBlogList(userID, page, size, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 查询用户
* @param {string} userID 用户ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -220,12 +506,13 @@ export const UserControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {UserModifyRequireVO} body
* @summary 登录用户
* @param {UserLoginRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async modifyUserInfo(body: UserModifyRequireVO, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).modifyUserInfo(body, options);
async loginUser(body: UserLoginRequireVO, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).loginUser(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@@ -233,12 +520,14 @@ export const UserControllerApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {UserRegisterRequireVO} body
* @summary 更新用户信息
* @param {UserUpdateRequireVO} body
* @param {string} userID 用户ID
* @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);
async updateUser(body: UserUpdateRequireVO, userID: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ResponseVOVoid>>> {
const localVarAxiosArgs = await UserControllerApiAxiosParamCreator(configuration).updateUser(body, userID, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@@ -255,15 +544,62 @@ export const UserControllerApiFactory = function (configuration?: Configuration,
return {
/**
*
* @summary 注册用户
* @param {UserCreateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllUserInfo(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOListUserInfoResponseVO>> {
return UserControllerApiFp(configuration).getAllUserInfo(options).then((request) => request(axios, basePath));
async createUser(body: UserCreateRequireVO, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOUserInfoResponseVO>> {
return UserControllerApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} userID
* @summary 查询用户列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllUserInfo(page: number, size: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOPageableVOUserInfoResponseVO>> {
return UserControllerApiFp(configuration).getAllUserInfo(page, size, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 查询当前用户
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCurrentUserInfo(options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOUserInfoResponseVO>> {
return UserControllerApiFp(configuration).getCurrentUserInfo(options).then((request) => request(axios, basePath));
},
/**
*
* @summary 查询用户所有附件
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserAttachList(userID: string, page: number, size: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOPageableVOAttachInfoResponseVO>> {
return UserControllerApiFp(configuration).getUserAttachList(userID, page, size, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 查询用户所有博文
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserBlogList(userID: string, page: number, size: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOPageableVOBlogInfoResponseVO>> {
return UserControllerApiFp(configuration).getUserBlogList(userID, page, size, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 查询用户
* @param {string} userID 用户ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@@ -272,21 +608,24 @@ export const UserControllerApiFactory = function (configuration?: Configuration,
},
/**
*
* @param {UserModifyRequireVO} body
* @summary 登录用户
* @param {UserLoginRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async modifyUserInfo(body: UserModifyRequireVO, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(configuration).modifyUserInfo(body, options).then((request) => request(axios, basePath));
async loginUser(body: UserLoginRequireVO, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(configuration).loginUser(body, options).then((request) => request(axios, basePath));
},
/**
*
* @param {UserRegisterRequireVO} body
* @summary 更新用户信息
* @param {UserUpdateRequireVO} body
* @param {string} userID 用户ID
* @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));
async updateUser(body: UserUpdateRequireVO, userID: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(configuration).updateUser(body, userID, options).then((request) => request(axios, basePath));
},
};
};
@@ -300,16 +639,67 @@ export const UserControllerApiFactory = function (configuration?: Configuration,
export class UserControllerApi extends BaseAPI {
/**
*
* @summary 注册用户
* @param {UserCreateRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getAllUserInfo(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOListUserInfoResponseVO>> {
return UserControllerApiFp(this.configuration).getAllUserInfo(options).then((request) => request(this.axios, this.basePath));
public async createUser(body: UserCreateRequireVO, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOUserInfoResponseVO>> {
return UserControllerApiFp(this.configuration).createUser(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} userID
* @summary 查询用户列表
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getAllUserInfo(page: number, size: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOPageableVOUserInfoResponseVO>> {
return UserControllerApiFp(this.configuration).getAllUserInfo(page, size, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 查询当前用户
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getCurrentUserInfo(options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOUserInfoResponseVO>> {
return UserControllerApiFp(this.configuration).getCurrentUserInfo(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 查询用户所有附件
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getUserAttachList(userID: string, page: number, size: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOPageableVOAttachInfoResponseVO>> {
return UserControllerApiFp(this.configuration).getUserAttachList(userID, page, size, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 查询用户所有博文
* @param {string} userID 用户ID
* @param {number} page 页码
* @param {number} size 大小
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async getUserBlogList(userID: string, page: number, size: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOPageableVOBlogInfoResponseVO>> {
return UserControllerApiFp(this.configuration).getUserBlogList(userID, page, size, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 查询用户
* @param {string} userID 用户ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
@@ -319,22 +709,25 @@ export class UserControllerApi extends BaseAPI {
}
/**
*
* @param {UserModifyRequireVO} body
* @summary 登录用户
* @param {UserLoginRequireVO} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserControllerApi
*/
public async modifyUserInfo(body: UserModifyRequireVO, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(this.configuration).modifyUserInfo(body, options).then((request) => request(this.axios, this.basePath));
public async loginUser(body: UserLoginRequireVO, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(this.configuration).loginUser(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {UserRegisterRequireVO} body
* @summary 更新用户信息
* @param {UserUpdateRequireVO} body
* @param {string} userID 用户ID
* @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));
public async updateUser(body: UserUpdateRequireVO, userID: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ResponseVOVoid>> {
return UserControllerApiFp(this.configuration).updateUser(body, userID, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@@ -16,7 +16,7 @@ import { Configuration } from "./configuration";
// @ts-ignore
import globalAxios, { AxiosRequestConfig, AxiosInstance } from 'axios';
export const BASE_PATH = "http://192.168.1.100:8080".replace(/\/+$/, "");
export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, "");
/**
*

View File

@@ -35,7 +35,13 @@ export interface AttachEntity {
* @type {UserEntity}
* @memberof AttachEntity
*/
uploader?: UserEntity;
creator?: UserEntity;
/**
*
* @type {UserEntity}
* @memberof AttachEntity
*/
updater?: UserEntity;
/**
*
* @type {Date}

View File

@@ -0,0 +1,44 @@
/* 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 AttachInfoResponseVO
*/
export interface AttachInfoResponseVO {
/**
*
* @type {number}
* @memberof AttachInfoResponseVO
*/
id?: number;
/**
*
* @type {string}
* @memberof AttachInfoResponseVO
*/
creator?: string;
/**
*
* @type {Date}
* @memberof AttachInfoResponseVO
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof AttachInfoResponseVO
*/
updateTime?: Date;
}

View File

@@ -12,6 +12,7 @@
* Do not edit the class manually.
*/
import { BlogEntity } from './blog-entity';
import { UserEntity } from './user-entity';
/**
*
* @export
@@ -36,6 +37,18 @@ export interface BlogAttachEntity {
* @memberof BlogAttachEntity
*/
blogEntity?: BlogEntity;
/**
*
* @type {UserEntity}
* @memberof BlogAttachEntity
*/
creator?: UserEntity;
/**
*
* @type {UserEntity}
* @memberof BlogAttachEntity
*/
updater?: UserEntity;
/**
*
* @type {Date}

View File

@@ -25,6 +25,18 @@ export interface BlogEntity {
* @memberof BlogEntity
*/
id?: number;
/**
*
* @type {string}
* @memberof BlogEntity
*/
title?: string;
/**
*
* @type {string}
* @memberof BlogEntity
*/
abstracts?: string;
/**
*
* @type {string}
@@ -37,6 +49,24 @@ export interface BlogEntity {
* @memberof BlogEntity
*/
content?: string;
/**
*
* @type {boolean}
* @memberof BlogEntity
*/
top?: boolean;
/**
*
* @type {boolean}
* @memberof BlogEntity
*/
publish?: boolean;
/**
*
* @type {Array<string>}
* @memberof BlogEntity
*/
tags?: Array<string>;
/**
*
* @type {Array<BlogAttachEntity>}
@@ -48,7 +78,13 @@ export interface BlogEntity {
* @type {UserEntity}
* @memberof BlogEntity
*/
uploader?: UserEntity;
creator?: UserEntity;
/**
*
* @type {UserEntity}
* @memberof BlogEntity
*/
updater?: UserEntity;
/**
*
* @type {Date}

View File

@@ -0,0 +1,100 @@
/* 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 BlogInfoResponseVO
*/
export interface BlogInfoResponseVO {
/**
*
* @type {number}
* @memberof BlogInfoResponseVO
*/
id?: number;
/**
*
* @type {string}
* @memberof BlogInfoResponseVO
*/
title?: string;
/**
*
* @type {string}
* @memberof BlogInfoResponseVO
*/
abstracts?: string;
/**
*
* @type {string}
* @memberof BlogInfoResponseVO
*/
password?: string;
/**
*
* @type {string}
* @memberof BlogInfoResponseVO
*/
content?: string;
/**
*
* @type {boolean}
* @memberof BlogInfoResponseVO
*/
top?: boolean;
/**
*
* @type {boolean}
* @memberof BlogInfoResponseVO
*/
publish?: boolean;
/**
*
* @type {Array<string>}
* @memberof BlogInfoResponseVO
*/
tags?: Array<string>;
/**
*
* @type {Array<BlogAttachEntity>}
* @memberof BlogInfoResponseVO
*/
attachEntities?: Array<BlogAttachEntity>;
/**
*
* @type {UserEntity}
* @memberof BlogInfoResponseVO
*/
creator?: UserEntity;
/**
*
* @type {UserEntity}
* @memberof BlogInfoResponseVO
*/
updater?: UserEntity;
/**
*
* @type {Date}
* @memberof BlogInfoResponseVO
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof BlogInfoResponseVO
*/
updateTime?: Date;
}

View File

@@ -0,0 +1,62 @@
/* 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 BlogUpdateRequireVO
*/
export interface BlogUpdateRequireVO {
/**
*
* @type {string}
* @memberof BlogUpdateRequireVO
*/
title: string;
/**
*
* @type {string}
* @memberof BlogUpdateRequireVO
*/
abstracts?: string;
/**
*
* @type {string}
* @memberof BlogUpdateRequireVO
*/
password?: string;
/**
*
* @type {string}
* @memberof BlogUpdateRequireVO
*/
content: string;
/**
*
* @type {boolean}
* @memberof BlogUpdateRequireVO
*/
top?: boolean;
/**
*
* @type {boolean}
* @memberof BlogUpdateRequireVO
*/
publish?: boolean;
/**
*
* @type {Array<string>}
* @memberof BlogUpdateRequireVO
*/
tags: Array<string>;
}

View File

@@ -1,16 +1,30 @@
export * from './attach-attach-idbody';
export * from './attach-entity';
export * from './attach-info-response-vo';
export * from './blog-attach-entity';
export * from './blog-entity';
export * from './response-volist-blog-entity';
export * from './response-volist-user-info-response-vo';
export * from './blog-info-response-vo';
export * from './blog-update-require-vo';
export * from './pageable-voattach-info-response-vo';
export * from './pageable-voblog-info-response-vo';
export * from './pageable-vosetting-info-response-vo';
export * from './pageable-vouser-info-response-vo';
export * from './response-voblog-info-response-vo';
export * from './response-volist-blog-info-response-vo';
export * from './response-volong';
export * from './response-vopageable-voattach-info-response-vo';
export * from './response-vopageable-voblog-info-response-vo';
export * from './response-vopageable-vosetting-info-response-vo';
export * from './response-vopageable-vouser-info-response-vo';
export * from './response-vosetting-info-response-vo';
export * from './response-vostring';
export * from './response-vouser-info-response-vo';
export * from './response-vouser-register-response-vo';
export * from './response-vovoid';
export * from './setting-info-response-vo';
export * from './setting-update-require-vo';
export * from './user-create-require-vo';
export * from './user-entity';
export * from './user-info-response-vo';
export * from './user-modify-require-vo';
export * from './user-register-require-vo';
export * from './user-register-response-vo';
export * from './user-login-require-vo';
export * from './user-update-require-vo';
export * from './v1-attach-body';

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 { AttachInfoResponseVO } from './attach-info-response-vo';
/**
*
* @export
* @interface PageableVOAttachInfoResponseVO
*/
export interface PageableVOAttachInfoResponseVO {
/**
*
* @type {number}
* @memberof PageableVOAttachInfoResponseVO
*/
page?: number;
/**
*
* @type {number}
* @memberof PageableVOAttachInfoResponseVO
*/
size?: number;
/**
*
* @type {number}
* @memberof PageableVOAttachInfoResponseVO
*/
totalElements?: number;
/**
*
* @type {number}
* @memberof PageableVOAttachInfoResponseVO
*/
totalPage?: number;
/**
*
* @type {Array<AttachInfoResponseVO>}
* @memberof PageableVOAttachInfoResponseVO
*/
data?: Array<AttachInfoResponseVO>;
}

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 { BlogInfoResponseVO } from './blog-info-response-vo';
/**
*
* @export
* @interface PageableVOBlogInfoResponseVO
*/
export interface PageableVOBlogInfoResponseVO {
/**
*
* @type {number}
* @memberof PageableVOBlogInfoResponseVO
*/
page?: number;
/**
*
* @type {number}
* @memberof PageableVOBlogInfoResponseVO
*/
size?: number;
/**
*
* @type {number}
* @memberof PageableVOBlogInfoResponseVO
*/
totalElements?: number;
/**
*
* @type {number}
* @memberof PageableVOBlogInfoResponseVO
*/
totalPage?: number;
/**
*
* @type {Array<BlogInfoResponseVO>}
* @memberof PageableVOBlogInfoResponseVO
*/
data?: Array<BlogInfoResponseVO>;
}

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 { SettingInfoResponseVO } from './setting-info-response-vo';
/**
*
* @export
* @interface PageableVOSettingInfoResponseVO
*/
export interface PageableVOSettingInfoResponseVO {
/**
*
* @type {number}
* @memberof PageableVOSettingInfoResponseVO
*/
page?: number;
/**
*
* @type {number}
* @memberof PageableVOSettingInfoResponseVO
*/
size?: number;
/**
*
* @type {number}
* @memberof PageableVOSettingInfoResponseVO
*/
totalElements?: number;
/**
*
* @type {number}
* @memberof PageableVOSettingInfoResponseVO
*/
totalPage?: number;
/**
*
* @type {Array<SettingInfoResponseVO>}
* @memberof PageableVOSettingInfoResponseVO
*/
data?: Array<SettingInfoResponseVO>;
}

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 { UserInfoResponseVO } from './user-info-response-vo';
/**
*
* @export
* @interface PageableVOUserInfoResponseVO
*/
export interface PageableVOUserInfoResponseVO {
/**
*
* @type {number}
* @memberof PageableVOUserInfoResponseVO
*/
page?: number;
/**
*
* @type {number}
* @memberof PageableVOUserInfoResponseVO
*/
size?: number;
/**
*
* @type {number}
* @memberof PageableVOUserInfoResponseVO
*/
totalElements?: number;
/**
*
* @type {number}
* @memberof PageableVOUserInfoResponseVO
*/
totalPage?: number;
/**
*
* @type {Array<UserInfoResponseVO>}
* @memberof PageableVOUserInfoResponseVO
*/
data?: Array<UserInfoResponseVO>;
}

View File

@@ -11,29 +11,29 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { UserInfoResponseVO } from './user-info-response-vo';
import { BlogInfoResponseVO } from './blog-info-response-vo';
/**
*
* @export
* @interface ResponseVOListUserInfoResponseVO
* @interface ResponseVOBlogInfoResponseVO
*/
export interface ResponseVOListUserInfoResponseVO {
export interface ResponseVOBlogInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOListUserInfoResponseVO
* @memberof ResponseVOBlogInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOListUserInfoResponseVO
* @memberof ResponseVOBlogInfoResponseVO
*/
msg?: string;
/**
*
* @type {Array<UserInfoResponseVO>}
* @memberof ResponseVOListUserInfoResponseVO
* @type {BlogInfoResponseVO}
* @memberof ResponseVOBlogInfoResponseVO
*/
data?: Array<UserInfoResponseVO>;
data?: BlogInfoResponseVO;
}

View File

@@ -11,29 +11,29 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import type { UserRegisterResponseVO } from './user-register-response-vo';
import { BlogInfoResponseVO } from './blog-info-response-vo';
/**
*
* @export
* @interface ResponseVOUserRegisterResponseVO
* @interface ResponseVOListBlogInfoResponseVO
*/
export interface ResponseVOUserRegisterResponseVO {
export interface ResponseVOListBlogInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOUserRegisterResponseVO
* @memberof ResponseVOListBlogInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOUserRegisterResponseVO
* @memberof ResponseVOListBlogInfoResponseVO
*/
msg?: string;
/**
*
* @type {UserRegisterResponseVO}
* @memberof ResponseVOUserRegisterResponseVO
* @type {Array<BlogInfoResponseVO>}
* @memberof ResponseVOListBlogInfoResponseVO
*/
data?: UserRegisterResponseVO;
data?: Array<BlogInfoResponseVO>;
}

View File

@@ -11,29 +11,28 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { BlogEntity } from './blog-entity';
/**
*
* @export
* @interface ResponseVOListBlogEntity
* @interface ResponseVOLong
*/
export interface ResponseVOListBlogEntity {
export interface ResponseVOLong {
/**
*
* @type {number}
* @memberof ResponseVOListBlogEntity
* @memberof ResponseVOLong
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOListBlogEntity
* @memberof ResponseVOLong
*/
msg?: string;
/**
*
* @type {Array<BlogEntity>}
* @memberof ResponseVOListBlogEntity
* @type {number}
* @memberof ResponseVOLong
*/
data?: Array<BlogEntity>;
data?: number;
}

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 { PageableVOAttachInfoResponseVO } from './pageable-voattach-info-response-vo';
/**
*
* @export
* @interface ResponseVOPageableVOAttachInfoResponseVO
*/
export interface ResponseVOPageableVOAttachInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOPageableVOAttachInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOPageableVOAttachInfoResponseVO
*/
msg?: string;
/**
*
* @type {PageableVOAttachInfoResponseVO}
* @memberof ResponseVOPageableVOAttachInfoResponseVO
*/
data?: PageableVOAttachInfoResponseVO;
}

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 { PageableVOBlogInfoResponseVO } from './pageable-voblog-info-response-vo';
/**
*
* @export
* @interface ResponseVOPageableVOBlogInfoResponseVO
*/
export interface ResponseVOPageableVOBlogInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOPageableVOBlogInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOPageableVOBlogInfoResponseVO
*/
msg?: string;
/**
*
* @type {PageableVOBlogInfoResponseVO}
* @memberof ResponseVOPageableVOBlogInfoResponseVO
*/
data?: PageableVOBlogInfoResponseVO;
}

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 { PageableVOSettingInfoResponseVO } from './pageable-vosetting-info-response-vo';
/**
*
* @export
* @interface ResponseVOPageableVOSettingInfoResponseVO
*/
export interface ResponseVOPageableVOSettingInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOPageableVOSettingInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOPageableVOSettingInfoResponseVO
*/
msg?: string;
/**
*
* @type {PageableVOSettingInfoResponseVO}
* @memberof ResponseVOPageableVOSettingInfoResponseVO
*/
data?: PageableVOSettingInfoResponseVO;
}

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 { PageableVOUserInfoResponseVO } from './pageable-vouser-info-response-vo';
/**
*
* @export
* @interface ResponseVOPageableVOUserInfoResponseVO
*/
export interface ResponseVOPageableVOUserInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOPageableVOUserInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOPageableVOUserInfoResponseVO
*/
msg?: string;
/**
*
* @type {PageableVOUserInfoResponseVO}
* @memberof ResponseVOPageableVOUserInfoResponseVO
*/
data?: PageableVOUserInfoResponseVO;
}

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 { SettingInfoResponseVO } from './setting-info-response-vo';
/**
*
* @export
* @interface ResponseVOSettingInfoResponseVO
*/
export interface ResponseVOSettingInfoResponseVO {
/**
*
* @type {number}
* @memberof ResponseVOSettingInfoResponseVO
*/
code?: number;
/**
*
* @type {string}
* @memberof ResponseVOSettingInfoResponseVO
*/
msg?: string;
/**
*
* @type {SettingInfoResponseVO}
* @memberof ResponseVOSettingInfoResponseVO
*/
data?: SettingInfoResponseVO;
}

View File

@@ -14,43 +14,31 @@
/**
*
* @export
* @interface UserRegisterResponseVO
* @interface SettingInfoResponseVO
*/
export interface UserRegisterResponseVO {
export interface SettingInfoResponseVO {
/**
*
* @type {string}
* @memberof UserRegisterResponseVO
* @memberof SettingInfoResponseVO
*/
id?: string;
/**
*
* @type {string}
* @memberof UserRegisterResponseVO
* @memberof SettingInfoResponseVO
*/
email?: string;
/**
*
* @type {string}
* @memberof UserRegisterResponseVO
*/
nickname?: string;
/**
*
* @type {Array<string>}
* @memberof UserRegisterResponseVO
*/
permissions?: Array<string>;
content?: string;
/**
*
* @type {Date}
* @memberof UserRegisterResponseVO
* @memberof SettingInfoResponseVO
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof UserRegisterResponseVO
* @memberof SettingInfoResponseVO
*/
updateTime?: Date;
}

View File

@@ -14,7 +14,13 @@
/**
*
* @export
* @interface UserModifyRequireVO
* @interface SettingUpdateRequireVO
*/
export interface UserModifyRequireVO {
export interface SettingUpdateRequireVO {
/**
*
* @type {string}
* @memberof SettingUpdateRequireVO
*/
content: string;
}

View File

@@ -14,25 +14,25 @@
/**
*
* @export
* @interface UserRegisterRequireVO
* @interface UserCreateRequireVO
*/
export interface UserRegisterRequireVO {
export interface UserCreateRequireVO {
/**
*
* @type {string}
* @memberof UserRegisterRequireVO
* @memberof UserCreateRequireVO
*/
email?: string;
email: string;
/**
*
* @type {string}
* @memberof UserRegisterRequireVO
* @memberof UserCreateRequireVO
*/
nickname?: string;
nickname: string;
/**
*
* @type {string}
* @memberof UserRegisterRequireVO
* @memberof UserCreateRequireVO
*/
password?: string;
}

View File

@@ -11,8 +11,8 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import type { AttachEntity } from './attach-entity';
import type { BlogEntity } from './blog-entity';
import { AttachEntity } from './attach-entity';
import { BlogEntity } from './blog-entity';
/**
*
* @export
@@ -30,43 +30,37 @@ export interface UserEntity {
* @type {string}
* @memberof UserEntity
*/
email?: string;
email: string;
/**
*
* @type {string}
* @memberof UserEntity
*/
nickname?: string;
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 {Array<AttachEntity>}
* @memberof UserEntity
*/
attachEntities?: Array<AttachEntity>;
/**
*
* @type {Date}
@@ -88,6 +82,6 @@ export interface UserEntity {
export enum UserEntityRoleEnum {
GUEST = 'GUEST',
AUTHOR = 'AUTHOR',
ADMINISTRATOR = 'ADMINISTRATOR'
ADMIN = 'ADMIN'
}

View File

@@ -11,10 +11,71 @@
* 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 UserInfoResponseVO
*/
export interface UserInfoResponseVO {
/**
*
* @type {string}
* @memberof UserInfoResponseVO
*/
id?: string;
/**
*
* @type {string}
* @memberof UserInfoResponseVO
*/
email?: string;
/**
*
* @type {string}
* @memberof UserInfoResponseVO
*/
nickname?: string;
/**
*
* @type {string}
* @memberof UserInfoResponseVO
*/
role?: UserInfoResponseVORoleEnum;
/**
*
* @type {Array<BlogEntity>}
* @memberof UserInfoResponseVO
*/
blogEntities?: Array<BlogEntity>;
/**
*
* @type {Array<AttachEntity>}
* @memberof UserInfoResponseVO
*/
attachEntities?: Array<AttachEntity>;
/**
*
* @type {Date}
* @memberof UserInfoResponseVO
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof UserInfoResponseVO
*/
updateTime?: Date;
}
/**
* @export
* @enum {string}
*/
export enum UserInfoResponseVORoleEnum {
GUEST = 'GUEST',
AUTHOR = 'AUTHOR',
ADMIN = 'ADMIN'
}

View File

@@ -0,0 +1,32 @@
/* 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 UserLoginRequireVO
*/
export interface UserLoginRequireVO {
/**
*
* @type {string}
* @memberof UserLoginRequireVO
*/
email: string;
/**
*
* @type {string}
* @memberof UserLoginRequireVO
*/
password?: string;
}

View File

@@ -0,0 +1,55 @@
/* 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 UserUpdateRequireVO
*/
export interface UserUpdateRequireVO {
/**
*
* @type {string}
* @memberof UserUpdateRequireVO
*/
email?: string;
/**
*
* @type {string}
* @memberof UserUpdateRequireVO
*/
nickname?: string;
/**
*
* @type {string}
* @memberof UserUpdateRequireVO
*/
password?: string;
/**
*
* @type {string}
* @memberof UserUpdateRequireVO
*/
role?: UserUpdateRequireVORoleEnum;
}
/**
* @export
* @enum {string}
*/
export enum UserUpdateRequireVORoleEnum {
GUEST = 'GUEST',
AUTHOR = 'AUTHOR',
ADMIN = 'ADMIN'
}

View File

@@ -17,6 +17,11 @@ const router = createRouter({
path: '/login',
name: 'login',
component: () => import('@/views/LoginView.vue')
},
{
path: '/settings',
name: 'settings',
component: () => import('@/views/SettingsView.vue')
}
]
})

View File

@@ -1,11 +1,56 @@
<script setup lang="ts">
import { UserControllerApiFactory } from '@/api-base';
import type UserLoginRequireVO from '@/api-base';
import { reactive } from 'vue';
const form = reactive({
email: '',
password: ''
})
const onSubmit = () => {
UserControllerApiFactory().loginUser(form)
.then(resp => {
let vo = resp.data;
if (vo.data === 200) {
console.log('login success!')
}else{
}
})
}
</script>
<template>
<div>
<el-alert title="error alert" type="error" show-icon />
<div class="login-div">
<el-card>
<el-form :model="form" label-width="60px">
<el-form-item label="邮箱">
<el-input v-model="form.email" />
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.password" type="password" />
</el-form-item>
<el-form-item>
<el-button class="login-button" type="primary" @click="onSubmit">登录</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<style scoped></style>
<style scoped>
.login-div {
height: 100%;
}
.el-card {
width: 480px;
margin: 0 auto;
}
.login-button {
margin: 0 auto;
width: 80%;
}
</style>

View File

@@ -0,0 +1,13 @@
<template>
<div>
</div>
</template>
<script setup lang="ts">
</script>
<style scoped>
</style>