Skip to content
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
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ steps:
- set
- image
- deployment/groomeong-logstash
- logstash-sha256-1=asia.gcr.io/project-groomeong/logstash:1.1
- logstash-sha256-1=asia.gcr.io/project-groomeong/logstash:1.2
env:
- CLOUDSDK_COMPUTE_ZONE=asia-northeast3
- CLOUDSDK_CONTAINER_CLUSTER=autopilot-cluster-5
2 changes: 1 addition & 1 deletion docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
dockerfile: Dockerfile.prod

logstash:
image: asia.gcr.io/project-groomeong/logstash:1.1
image: asia.gcr.io/project-groomeong/logstash:1.2
platform: linux/x86_64
build:
context: .
Expand Down
6 changes: 3 additions & 3 deletions elk/logstash/logstash.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ input {
jdbc {
jdbc_driver_library => "/usr/share/logstash/mysql-connector-java-8.0.28.jar"
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://10.42.208.3:3306/groomeongprod" # jdbc:mysql://SQL인스턴스비공개IP주소:포트번호/db이름
jdbc_connection_string => "jdbc:mysql://10.42.208.3:3306/prod" # jdbc:mysql://SQL인스턴스비공개IP주소:포트번호/db이름
jdbc_user => "root"
jdbc_password => "root"
schedule => "*/30 * * * *"
use_column_value => true
tracking_column => "updatedat"
tracking_column_type => "numeric"
last_run_metadata_path => "./updatedat_auto.txt"
last_run_metadata_path => "./updatedat_auto2.txt"
statement => "select *, unix_timestamp(updatedat) as updatedat from shop inner join shop_image on shop.id = shop_image.shopid where unix_timestamp(updatedat) > :sql_last_value or shop_image.isthumbnail = 1 order by updatedat asc"
}
}
Expand All @@ -27,7 +27,7 @@ output {
hosts => "https://search-groomeong-elasticsearch-7mvk7xnf5m2a6tcx6p5ro5qste.ap-southeast-2.es.amazonaws.com:443"
user => "groomeong11"
password => "QKQHwngus1!"
index => "auto_shop_1"
index => "auto_shop_2"
document_id => "%{shopid}"
manage_template => true
template => "/usr/share/logstash/auto_template3.json"
Expand Down
1 change: 1 addition & 0 deletions src/apis/auth/strategies/jwt-social-kakao.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class JwtKakaoStrategy extends PassportStrategy(Strategy, 'kakao') {
clientID: process.env.KAKAO_CLIENT_ID,
clientSecret: process.env.KAKAO_CLIENT_SECRET,
callbackURL: 'https://groomeong.shop/login/kakao',
// callbackURL: 'https://localhost:3000/login/kakao',
scope: ['account_email', 'profile_nickname'],
});
}
Expand Down
12 changes: 0 additions & 12 deletions src/apis/dogs/dogs.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Args, Context, Mutation, Query, Resolver } from '@nestjs/graphql';
import { CreateDogInput } from './dto/create-dog.input';
import { DogsService } from './dogs.service';
import { Dog } from './entities/dog.entity';
import { UpdateDogInput } from './dto/update-dog.input';
import { UseGuards } from '@nestjs/common';
import { GqlAuthGuard } from '../auth/guards/gql-auth.guard';
import { IContext } from 'src/commons/interface/context';
Expand Down Expand Up @@ -47,17 +46,6 @@ export class DogsResolver {
return this.dogsService.create({ createDogInput, userId });
}

@Mutation(
() => Dog,
{ description: ' Return: 업데이트한 강아지 데이터 ' }, //
)
updateDog(
@Args('id') id: string, //
@Args('updateDogInput') updateDogInput: UpdateDogInput, //
): Promise<Dog> {
return this.dogsService.updateOneById({ id, updateDogInput });
}

@Mutation(
() => Boolean,
{ description: ' Return: id로 강아지 데이터 삭제 후 삭제 여부 반환 ' }, //
Expand Down
13 changes: 0 additions & 13 deletions src/apis/dogs/dogs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
IDogsServiceDeleteById,
IDogsServiceFindByUserId,
IDogsServiceFindOneById,
IDogsServiceUpdateOneById,
} from './interfaces/dogs-service.interface';
import { Repository } from 'typeorm';

Expand Down Expand Up @@ -49,18 +48,6 @@ export class DogsService {
return dog;
}

async updateOneById({
id,
updateDogInput,
}: IDogsServiceUpdateOneById): Promise<Dog> {
const founded = await this.findOneById({ id });
const updated = await this.dogsRepository.save({
...founded,
...updateDogInput,
});
return updated;
}

async deleteOneById({
id,
userId,
Expand Down
5 changes: 0 additions & 5 deletions src/apis/dogs/dto/update-dog.input.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/apis/dogs/interfaces/dogs-service.interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CreateDogInput } from '../dto/create-dog.input';
import { UpdateDogInput } from '../dto/update-dog.input';

export interface IDogsServiceFindOneById {
id: string;
Expand All @@ -14,11 +13,6 @@ export interface IDogsServiceCreate {
userId: string;
}

export interface IDogsServiceUpdateOneById {
id: string;
updateDogInput: UpdateDogInput;
}

export interface IDogsServiceDeleteById {
id: string;
userId: string;
Expand Down
6 changes: 3 additions & 3 deletions src/apis/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export class FilesService {
let filename = '';

if (dogId) {
filename = `origin/dog/${uuid()}/${image.filename}`; // 강아지 이미지 주소 설정
filename = `origin/dog/${uuid()}/${image.filename}`;
} else if (shopId) {
filename = `origin/shop/${uuid()}/${image.filename}`; // 미용샵 이미지 주소 설정
filename = `origin/shop/${uuid()}/${image.filename}`;
} else {
filename = `origin/profile/${uuid()}/${image.filename}`; // 프로필 이미지 주소 설정
filename = `origin/profile/${uuid()}/${image.filename}`;
}

image
Expand Down
4 changes: 2 additions & 2 deletions src/apis/reservations/__test__/reservation.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { ShopsService } from 'src/apis/shops/shops.service';
import { UsersService } from 'src/apis/users/user.service';
import { CreateReservationInput } from '../dto/create-reservation.input';
import { Reservation } from '../entities/reservation.entity';
import { ReservationsResolver } from '../reservation.resolver';
import { ReservationsService } from '../reservation.service';
import { ReservationsResolver } from '../reservations.resolver';
import { ReservationsService } from '../reservations.service';
import {
MOCK_RESERVATION,
MOCK_REVIEW,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { ShopsService } from '../shops/shops.service';
import { User } from '../users/entities/user.entity';
import { UsersService } from '../users/user.service';
import { Reservation } from './entities/reservation.entity';
import { ReservationsResolver } from './reservation.resolver';
import { ReservationsService } from './reservation.service';
import { ReservationsResolver } from './reservations.resolver';
import { ReservationsService } from './reservations.service';

@Module({
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,76 @@ import { GqlAuthGuard } from '../auth/guards/gql-auth.guard';
import { CreateReservationInput } from './dto/create-reservation.input';
import { returnUserWithReviewOutput } from './dto/return-reservation.output';
import { Reservation } from './entities/reservation.entity';
import { ReservationsService } from './reservation.service';
import { ReservationsService } from './reservations.service';

@Resolver()
export class ReservationsResolver {
constructor(
private readonly reservationsService: ReservationsService, //
) {}

//예약 생성하기
@Mutation(() => Reservation, { description: 'Return: 생성된 신규 예약 정보' })
async createReservation(
@Args('createReservationInput')
createReservationInput: CreateReservationInput, //
): Promise<Reservation> {
return await this.reservationsService.create({
createReservationInput,
});
}

// 예약ID로 예약정보 가져오기
@Query(() => Reservation, {
description: 'Return : 예약 정보',
})
@Query(
() => Reservation, //
{ description: 'Return : 예약 정보' },
)
fetchReservation(
@Args('reservationId') reservationId: string, //
): Promise<Reservation> {
return this.reservationsService.findOne({ reservationId });
}

// 회원의 모든 예약 가져오기
@UseGuards(GqlAuthGuard('access'))
@Query(() => [Reservation], {
description: 'Return : 한 회원의 예약 정보',
})
@Query(
() => [Reservation], //
{ description: 'Return : 한 회원의 모든 예약 정보' },
)
fetchReservationsByUser(
@Context() context: IContext, //
): Promise<Reservation[]> {
const userId = context.req.user.id;
console.log(userId, '@@@@');
return this.reservationsService.findAllByUserId({ userId });
}

// 가게의 모든 예약 가져오기
@Query(() => [Reservation], {
description: 'Return : 한 가게의 예약 정보',
})
@Query(
() => [Reservation], //
{ description: 'Return : 한 가게의 예약 정보' },
)
fetchReservationsByShop(
@Args('shopId') shopId: string, //
): Promise<Reservation[]> {
return this.reservationsService.findAllByShopId({ shopId });
}

// 가게의 모든 예약과 예약자 가져오기
@Query(() => [returnUserWithReviewOutput], {
description:
'Return : { profile: 회원정보 , review: 그 회원이 작성한 리뷰 } 형식의 객체들이 모인 배열',
})
@Query(
() => [returnUserWithReviewOutput], //
{
description:
'Return : { profile: 회원정보 , review: 그 회원이 작성한 리뷰 } 형식의 배열',
},
)
fetchForShopDetailPage(
@Args('shopId') shopId: string, //
): Promise<returnUserWithReviewOutput[]> {
return this.reservationsService.findForShopDetailPage({ shopId });
}

//예약 삭제하기
@Mutation(() => Boolean, { description: ' Return: 예약 삭제하기' })
@Mutation(
() => Reservation, //
{ description: 'Return: 생성된 신규 예약 정보' },
)
async createReservation(
@Args('createReservationInput')
createReservationInput: CreateReservationInput, //
): Promise<Reservation> {
return await this.reservationsService.create({
createReservationInput,
});
}

@Mutation(
() => Boolean, //
{ description: ' Return: 예약 삭제하기' },
)
deleteReservation(
@Args('reservationId') reservationId: string, //
): Promise<boolean> {
Expand Down
Loading