Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Siwonpada/issue143 #147

Merged
merged 10 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update Kubernetes Cluster (Dev)
on:
push:
paths:
- src/**
- apps/api/**
- prisma/schema.prisma
branches:
- main
Expand Down Expand Up @@ -52,6 +52,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@
"gitops",
"gsainfoteam",
"infoteam",
"libheif",
"linuxmusl",
"localtime",
"LOGGABLE",
"metatype",
"nestjs",
"noreply",
"openai",
"prisma",
"rxjs",
"ziggle"
"ziggle",
"zoneinfo"
],
"git.branchProtection": ["main"]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
ApiOperation,
ApiTags,
} from '@nestjs/swagger';
import { IdPGuard } from 'src/user/guard/idp.guard';
import { TranslateDto } from './dto/req/translate.dto';
import { TranslateResDto } from './dto/res/translateRes.dto';
import { IdPGuard } from '../user/guard/idp.guard';

@ApiTags('ai')
@ApiOAuth2(['email', 'profile', 'openid'], 'oauth2')
Expand Down
2 changes: 1 addition & 1 deletion src/ai/ai.module.ts → apps/api/src/ai/ai.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Module } from '@nestjs/common';
import { AiService } from './ai.service';
import { AiController } from './ai.controller';
import { UserModule } from 'src/user/user.module';
import { LoggerModule } from '@lib/logger';
import { CustomConfigModule } from '@lib/custom-config';
import { UserModule } from '../user/user.module';

@Module({
imports: [CustomConfigModule, UserModule, LoggerModule],
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app.controller.ts → apps/api/src/api.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Controller, Get } from '@nestjs/common';
import { ApiResponse } from '@nestjs/swagger';

@Controller()
export class AppController {
export class ApiController {
@ApiResponse({
status: 200,
description: 'Send the message "pong" when the server is active.',
Expand Down
6 changes: 3 additions & 3 deletions src/app.module.ts → apps/api/src/api.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { FileModule } from './file/file.module';
import { UserModule } from './user/user.module';
import { TagModule } from './tag/tag.module';
Expand All @@ -14,6 +13,7 @@ import { AiModule } from './ai/ai.module';
import { CustomConfigModule, CustomConfigService } from '@lib/custom-config';
import { HealthModule } from './health/health.module';
import { RedisModule } from '@nestjs-modules/ioredis';
import { ApiController } from './api.controller';

@Module({
imports: [
Expand Down Expand Up @@ -51,6 +51,6 @@ import { RedisModule } from '@nestjs-modules/ioredis';
AiModule,
HealthModule,
],
controllers: [AppController],
controllers: [ApiController],
})
export class AppModule {}
export class ApiModule {}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { Module } from '@nestjs/common';
import { CrawlService } from './crawl.service';
import { CrawlController } from './crawl.controller';
import { CrawlRepository } from './crawl.repository';
import { UserModule } from 'src/user/user.module';
import { AiModule } from 'src/ai/ai.module';
import { FcmModule } from 'src/fcm/fcm.module';
import { PrismaModule } from '@lib/prisma';
import { LoggerModule } from '@lib/logger';
import { CustomConfigModule } from '@lib/custom-config';
import { UserModule } from '../user/user.module';
import { AiModule } from '../ai/ai.module';
import { FcmModule } from '../fcm/fcm.module';

@Module({
imports: [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {
} from '@nestjs/common';
import { CrawlRepository } from './crawl.repository';
import { CreateCrawlDto } from './dto/req/createCrawl.dto';
import { UserService } from 'src/user/user.service';
import { Crawl } from '@prisma/client';
import { GetCrawlDto } from './dto/req/getCrawl.dto';
import { AiService } from 'src/ai/ai.service';
import { FcmService } from 'src/fcm/fcm.service';
import { FcmTargetUser } from 'src/fcm/types/fcmTargetUser.type';
import { Loggable } from '@lib/logger/decorator/loggable';
import { CustomConfigService } from '@lib/custom-config';
import { UserService } from '../user/user.service';
import { FcmService } from '../fcm/fcm.service';
import { AiService } from '../ai/ai.service';
import { FcmTargetUser } from '../fcm/types/fcmTargetUser.type';

@Injectable()
@Loggable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Module } from '@nestjs/common';
import { DocumentController } from './document.controller';
import { DocumentService } from './document.service';
import { FileModule } from 'src/file/file.module';
import { LoggerModule } from '@lib/logger';
import { FileModule } from '../file/file.module';

@Module({
imports: [FileModule, LoggerModule],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Loggable } from '@lib/logger/decorator/loggable';
import { Injectable, Logger } from '@nestjs/common';
import path from 'path';
import { FileService } from 'src/file/file.service';
import { FileService } from '../file/file.service';

@Injectable()
@Loggable()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Get, Post, Query, UseGuards } from '@nestjs/common';
import { GroupService } from './group.service';
import { IdPGuard } from 'src/user/guard/idp.guard';
import {
ApiCreatedResponse,
ApiInternalServerErrorResponse,
Expand All @@ -10,10 +9,11 @@ import {
ApiTags,
ApiUnauthorizedResponse,
} from '@nestjs/swagger';
import { GetToken } from 'src/user/decorator/get-token.decorator';
import { GroupsTokenRes } from './dto/res/GroupsTokenRes.dto';
import { GroupListResDto } from './dto/res/GroupsRes.dto';
import { GetGroupByNameQueryDto } from './dto/req/getGroup.dto';
import { IdPGuard } from '../user/guard/idp.guard';
import { GetToken } from '../user/decorator/get-token.decorator';

@ApiTags('Group')
@ApiOAuth2(['email', 'profile', 'openid'], 'oauth2')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Module } from '@nestjs/common';
import { GroupService } from './group.service';
import { HttpModule } from '@nestjs/axios';
import { GroupController } from './group.controller';
import { UserModule } from 'src/user/user.module';
import { PrismaModule } from '@lib/prisma';
import { LoggerModule } from '@lib/logger';
import { CustomConfigModule } from '@lib/custom-config';
import { UserModule } from '../user/user.module';

@Module({
imports: [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Module } from '@nestjs/common';
import { ImageService } from './image.service';
import { ImageController } from './image.controller';
import { FileModule } from 'src/file/file.module';
import { LoggerModule } from '@lib/logger';
import { FileModule } from '../file/file.module';

@Module({
imports: [FileModule, LoggerModule],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import {
BadRequestException,
Injectable,
InternalServerErrorException,
Logger,
} from '@nestjs/common';
import path from 'path';
import { FileService } from 'src/file/file.service';
import sharp from 'sharp';
import { Loggable } from '@lib/logger/decorator/loggable';
import { FileService } from '../file/file.service';

@Injectable()
@Loggable()
export class ImageService {
private readonly logger = new Logger(ImageService.name);
constructor(private readonly fileService: FileService) {}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts → apps/api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import cookieParser from 'cookie-parser';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import expressBasicAuth from 'express-basic-auth';
import { json } from 'express';
import { CustomConfigService } from '@lib/custom-config';
import { ApiModule } from './api.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(ApiModule);
const customConfigService = app.get(CustomConfigService);
// swagger auth config
app.use(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsDate,
IsEnum,
IsOptional,
IsString,
MaxLength,
} from 'class-validator';
export class AdditionalNoticeDto {
@ApiProperty({
example: '제목',
description: '바뀐 제목 (현재 진짜로 바뀌지는 않음)',
required: false,
})
@IsString()
@IsOptional()
@MaxLength(200)
title?: string;
@ApiProperty({
example: '추가 내용',
description: '추가된 내용',
required: true,
})
@IsString()
@MaxLength(100000)
body: string;
@ApiProperty({
example: '2021-08-01T00:00:00.000Z',
description: '마감일, 가장 최근에 post한 것을 기준으로 설정됨',
required: false,
})
@Type(() => Date)
@IsDate()
@IsOptional()
deadline?: Date;
@ApiProperty({
example: 'all',
description: '공지 알림을 받을 사람들',
required: false,
})
@IsString()
@IsEnum(['all', 'reminder'])
@IsOptional()
to?: string;
}
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsDate,
IsEnum,
IsOptional,
IsString,
MaxLength,
} from 'class-validator';

export class AdditionalNoticeDto {
@ApiProperty({
example: '제목',
description: '바뀐 제목 (현재 진짜로 바뀌지는 않음)',
required: false,
})
@IsString()
@IsOptional()
@MaxLength(200)
title?: string;

@ApiProperty({
example: '추가 내용',
description: '추가된 내용',
required: true,
})
@IsString()
@MaxLength(100000)
body: string;

@ApiProperty({
example: '2021-08-01T00:00:00.000Z',
description: '마감일, 가장 최근에 post한 것을 기준으로 설정됨',
required: false,
})
@Type(() => Date)
@IsDate()
@IsOptional()
deadline?: Date;

@ApiProperty({
example: 'all',
description: '공지 알림을 받을 사람들',
required: false,
})
@IsString()
@IsEnum(['all', 'reminder'])
@IsOptional()
to?: string;
}
Loading