- 일정 관련 기능 구현 중
This commit is contained in:
36
src/modules/schedule/dto/create/create-request.dto.ts
Normal file
36
src/modules/schedule/dto/create/create-request.dto.ts
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { IsArray, IsDate, IsString } from '@nestjs/class-validator';
|
||||||
|
|
||||||
|
export class CreateRequestDto {
|
||||||
|
@IsString()
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
startDate: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
endDate: Date;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
status: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
content: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
type: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
style: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
startTime: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
endTime: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
dayList: string;
|
||||||
|
|
||||||
|
@IsArray()
|
||||||
|
participantList: string[];
|
||||||
|
}
|
||||||
0
src/modules/schedule/schedule.controller.ts
Normal file
0
src/modules/schedule/schedule.controller.ts
Normal file
0
src/modules/schedule/schedule.module.ts
Normal file
0
src/modules/schedule/schedule.module.ts
Normal file
43
src/modules/schedule/schedule.repo.ts
Normal file
43
src/modules/schedule/schedule.repo.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
|
import * as schema from 'drizzle/schema';
|
||||||
|
import { countDistinct, and, eq } from 'drizzle-orm';
|
||||||
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ScheduleRepo {
|
||||||
|
constructor(@Inject('DRIZZLE') private readonly db: NodePgDatabase<typeof schema>) {}
|
||||||
|
|
||||||
|
async getList(accountId: string) {
|
||||||
|
const result = await this
|
||||||
|
.db
|
||||||
|
.select()
|
||||||
|
.from(schema.schedule)
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(schema.schedule.owner, accountId),
|
||||||
|
eq(schema.schedule.isDeleted, false)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDetail(id: string) {
|
||||||
|
const result = await this
|
||||||
|
.db
|
||||||
|
.select()
|
||||||
|
.from(schema.schedule)
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(schema.schedule.id, id),
|
||||||
|
eq(schema.schedule.isDeleted, false)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return result[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
async create() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
0
src/modules/schedule/schedule.service.ts
Normal file
0
src/modules/schedule/schedule.service.ts
Normal file
Reference in New Issue
Block a user