diff --git a/packages/canyon-backend/src/app.module.ts b/packages/canyon-backend/src/app.module.ts index 98a574f5..1e54e5eb 100755 --- a/packages/canyon-backend/src/app.module.ts +++ b/packages/canyon-backend/src/app.module.ts @@ -1,6 +1,5 @@ import { Module } from "@nestjs/common"; import { AppController } from "./app.controller"; -import { AppService } from "./app.service"; import { PrismaModule } from "./prisma/prisma.module"; import { CoverageModule } from "./coverage/coverage.module"; import { ScheduleModule } from "@nestjs/schedule"; @@ -44,6 +43,6 @@ import { CoveragediskEntity } from "./coverage/entity/coveragedisk.entity"; }), ], controllers: [AppController, SourcecodeController], - providers: [AppService, SourcecodeService], + providers: [SourcecodeService], }) export class AppModule {} diff --git a/packages/canyon-backend/src/app.service.ts b/packages/canyon-backend/src/app.service.ts deleted file mode 100755 index b00a6679..00000000 --- a/packages/canyon-backend/src/app.service.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Injectable } from "@nestjs/common"; - -@Injectable() -export class AppService { - getHello(): string { - return "Hello World!"; - } -} diff --git a/packages/canyon-backend/src/coverage/services/core/consumer-coverage.service.ts b/packages/canyon-backend/src/coverage/services/core/consumer-coverage.service.ts index e7a07ffe..43499a98 100644 --- a/packages/canyon-backend/src/coverage/services/core/consumer-coverage.service.ts +++ b/packages/canyon-backend/src/coverage/services/core/consumer-coverage.service.ts @@ -2,12 +2,11 @@ import { Injectable } from "@nestjs/common"; import { PrismaService } from "../../../prisma/prisma.service"; import { genSummaryMapByCoverageMap, getSummaryByPath } from "canyon-data"; import { mergeCoverageMap, resetCoverageData } from "../../../utils/coverage"; -import { removeNullKeys } from "../../../utils/utils"; +import { removeNullKeys, resolveProjectID } from "../../../utils/utils"; import { PullChangeCodeAndInsertDbService } from "../common/pull-change-code-and-insert-db.service"; import { logger } from "../../../logger"; import { CoveragediskService } from "./coveragedisk.service"; import { TestExcludeService } from "../common/test-exclude.service"; -import { resolveProjectID } from "../../../utils"; import { PullFilePathAndInsertDbService } from "../common/pull-file-path-and-insert-db.service"; import { compressedData, decompressedData } from "../../../utils/zstd"; diff --git a/packages/canyon-backend/src/global-exception.filter.ts b/packages/canyon-backend/src/filter/global-exception.filter.ts similarity index 96% rename from packages/canyon-backend/src/global-exception.filter.ts rename to packages/canyon-backend/src/filter/global-exception.filter.ts index 259780d2..d45fd3b3 100644 --- a/packages/canyon-backend/src/global-exception.filter.ts +++ b/packages/canyon-backend/src/filter/global-exception.filter.ts @@ -5,7 +5,7 @@ import { HttpException, } from "@nestjs/common"; import { Request, Response } from "express"; -import { logger } from "./logger"; +import { logger } from "../logger"; @Catch() export class GlobalExceptionFilter implements ExceptionFilter { diff --git a/packages/canyon-backend/src/main.ts b/packages/canyon-backend/src/main.ts index 1b3e9026..66ce4f48 100755 --- a/packages/canyon-backend/src/main.ts +++ b/packages/canyon-backend/src/main.ts @@ -3,7 +3,7 @@ import { json } from "express"; import { ValidationPipe } from "@nestjs/common"; import * as dotenv from "dotenv"; import * as path from "node:path"; -import { GlobalExceptionFilter } from "./global-exception.filter"; +import { GlobalExceptionFilter } from "./filter/global-exception.filter"; dotenv.config({ path: path.resolve(__dirname, "../../../.env"), diff --git a/packages/canyon-backend/src/utils.ts b/packages/canyon-backend/src/utils.ts deleted file mode 100644 index 9c3399b5..00000000 --- a/packages/canyon-backend/src/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function resolveProjectID(projectID) { - return projectID.split("-")[1] || projectID; -} diff --git a/packages/canyon-backend/src/utils/utils.ts b/packages/canyon-backend/src/utils/utils.ts index f8666421..c139ef3f 100755 --- a/packages/canyon-backend/src/utils/utils.ts +++ b/packages/canyon-backend/src/utils/utils.ts @@ -54,3 +54,7 @@ export const within30days = (time) => { // 判断是否在30天以内 return differenceInDays <= 30; }; + +export function resolveProjectID(projectID) { + return projectID.split("-")[1] || projectID; +}