Skip to content

Commit

Permalink
feat: add device
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Jan 2, 2024
1 parent 8e3b3f6 commit 51a8bb5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `device` to the `coverage` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "coverage" ADD COLUMN device TEXT DEFAULT '-' NOT NULL;
1 change: 1 addition & 0 deletions packages/canyon-backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ model Coverage {
key String?
commitSha String @map("commit_sha")
branch String
device String
compareTarget String @map("compare_target")
projectID String @map("project_id")
instrumentCwd String? @map("instrument_cwd")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export class CoverageClientDto {
@IsOptional({ message: 'branch 可以为空' })
branch: string;

@IsString()
@MinLength(1, { message: 'device长度最小为1' })
@IsOptional({ message: 'device 可以为空' })
device: string;

// 允许为空,但是最小长度为1
@IsString()
@MinLength(1, { message: 'compareTarget长度最小为1' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class CoverageClientService {
reportID,
compareTarget,
branch,
device,
} = coverageReport;
const dataFormatAndCheckTimeEnd = new Date().getTime();
// ******************************************************
Expand All @@ -94,6 +95,7 @@ export class CoverageClientService {
compareTarget,
commitSha,
branch: branch || '-', //branch可能为空
device: device || '-', //device可能为空
reporter: Number(currentUserDb.id),
projectID,
instrumentCwd,
Expand Down

0 comments on commit 51a8bb5

Please sign in to comment.