Commit c99e4b7b authored by nanahira's avatar nanahira

fix openapi things

parent ac2b9f65
Pipeline #15212 passed with stages
in 2 minutes and 7 seconds
webpack.config.js
dist/*
build/*
*.js
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
......@@ -64,28 +64,28 @@ export class AdminController {
@Post('app/:id/assign')
@ApiOperation({ summary: '设置 app 管理者' })
@ApiOkResponse({ type: BlankReturnMessageDto })
@ApiCreatedResponse({ type: BlankReturnMessageDto })
async assignApp(@Param('id') id: string, @Body(new ValidationPipe({ transform: true })) assignAppData: AssignAppDto) {
return this.appService.assignApp(id, assignAppData.author);
}
@Post('app/:id/prefix')
@ApiOperation({ summary: '设置 app 打包前缀' })
@ApiOkResponse({ type: BlankReturnMessageDto })
@ApiCreatedResponse({ type: BlankReturnMessageDto })
async setAppPrefix(@Param('id') id: string, @Body(new ValidationPipe({ transform: true })) appPrefix: AppPrefixDto) {
return this.appService.setAppPrefix(id, appPrefix._prefix);
}
@Post('purge')
@ApiOperation({ summary: '清理没有用的 app 包' })
@ApiOkResponse({ type: BlankReturnMessageDto })
@ApiCreatedResponse({ type: BlankReturnMessageDto })
async purgeOldArchives() {
return new ReturnMessageDto(201, 'success', await this.appService.purgeOldArchives());
}
@Post('mirror')
@ApiOperation({ summary: '触发镜像' })
@ApiOkResponse({ type: BlankReturnMessageDto })
@ApiCreatedResponse({ type: BlankReturnMessageDto })
async triggerMirror() {
this.mirrorService.triggerMirror();
return new ReturnMessageDto(201, 'success');
......
......@@ -83,7 +83,6 @@ export class AppController {
})
@ApiParam({ name: 'id', description: 'APP 的 id' })
@ApiParam({ name: 'version', description: 'APP 的版本号' })
@ApiQuery({ type: DepotDto, description: 'APP 的类型' })
async removeBuild(
@FetchMyCardUser() user: MyCardUser,
@Param('id') id: string,
......@@ -101,7 +100,6 @@ export class AppController {
@ApiConsumes('multipart/form-data')
@ApiParam({ name: 'id', description: 'APP 的 id' })
@ApiParam({ name: 'version', description: 'APP 的版本号' })
@ApiQuery({ type: DepotDto, description: 'APP 的类型' })
@ApiBody({
description: 'app 的 tar.zst 文件',
type: FileUploadDto,
......
import { Body, Controller, Get, Header, Param, ParseArrayPipe, Post, Query, Render, ValidationPipe } from '@nestjs/common';
import { UpdateService } from './update.service';
import { ApiBody, ApiOkResponse, ApiOperation, ApiParam, ApiQuery, ApiTags } from '@nestjs/swagger';
import { ApiBody, ApiCreatedResponse, ApiOkResponse, ApiOperation, ApiParam, ApiQuery, ApiTags } from '@nestjs/swagger';
import { DepotDto } from '../dto/Depot.dto';
@Controller('update')
......@@ -19,7 +19,6 @@ export class UpdateController {
@ApiOperation({ summary: '获取 app 校验和', description: '是 shasum 的格式' })
@ApiParam({ name: 'id', description: 'APP 的 id' })
@ApiParam({ name: 'version', description: 'APP 的版本号' })
@ApiQuery({ type: DepotDto, description: 'APP 的类型' })
@ApiOkResponse({ type: String })
@Header('Cache-Control', 'public, max-age=31536000, immutable')
async getChecksum(
......@@ -35,7 +34,6 @@ export class UpdateController {
@ApiOperation({ summary: '获取 app 完整包 metalink', description: '只包含完整包的' })
@ApiParam({ name: 'id', description: 'APP 的 id' })
@ApiParam({ name: 'version', description: 'APP 的版本号' })
@ApiQuery({ type: DepotDto, description: 'APP 的类型' })
@ApiOkResponse({ type: String })
@Header('Cache-Control', 'public, max-age=31536000, immutable')
async getFullPackageMetalink(
......@@ -51,9 +49,8 @@ export class UpdateController {
@ApiOperation({ summary: '获取 app 部分包 metalink', description: '根据文件返回需要下载什么文件' })
@ApiParam({ name: 'id', description: 'APP 的 id' })
@ApiParam({ name: 'version', description: 'APP 的版本号' })
@ApiQuery({ type: DepotDto, description: 'APP 的类型' })
@ApiBody({ type: [String], description: '需要什么文件' })
@ApiOkResponse({ type: String })
@ApiCreatedResponse({ type: String })
async getPartPackageMetalink(
@Param('id') id: string,
@Query(new ValidationPipe({ transform: true })) depot: DepotDto,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment