Skip to content

Commit

Permalink
Merge pull request #99 from RECODE01/feat/#68/AddChattingServerAPIs
Browse files Browse the repository at this point in the history
remove console,log
  • Loading branch information
gchoi96 authored Jun 6, 2022
2 parents 9fc9b35 + 8bbcab9 commit 11da616
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 27 deletions.
1 change: 0 additions & 1 deletion with-chat-server/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
} );

socket.on( 'test', ( data ) => {
console.log( data )
} );
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export class ChannelHistoryController {
@Query('channelId') channelId: string,
@CurrentUser() currentUser,
) {
console.log(lastIdx, channelId);
return this.channelHistoryService
.getChannelHistory(lastIdx, channelId)
.then((result) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export class ChannelHistoryService {
.limit(20)
.getMany();

console.log(result);

if (!result) return [];

return result.map((el) => {
Expand Down Expand Up @@ -100,8 +98,6 @@ export class ChannelHistoryService {
.andWhere('channelHistory.idx = :idx', { idx: currIdx })
.getMany();

console.log(result);

return result.map((el) => {
const { password, year, month, day, certified, deletedAt, ...writer } =
el.writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export class ChattingChannelController {
return await this.chattingChannelService
.createChattingChannel(createChattingChannelDto, currentUser)
.then((channel) => {
console.log(channel);
return res
.status(HttpStatus.OK)
.json({ success: true, chattingChannel: channel });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export class ChattingRoomInviteService {
});

if (isSent) throw new ConflictException('이미 요청된 데이터가 존재합니다.');
console.log(chattingServerId, targetId);
return await this.chattingRoomInviteRepository.save({
chattingServer: { id: chattingServerId },
user: { id: targetId },
Expand Down Expand Up @@ -67,7 +66,6 @@ export class ChattingRoomInviteService {
})
.then((invite) => invite.chattingServer.id);

console.log(chattingRoomId, 'chattingRoomId');
const result = await queryRunner.manager.save(ChattingServerUserDetail, {
master: { id: chattingRoomId },
user: { id: currentUser.id },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class ChattingServerService {
})
.getMany();

console.log(result);
return result;
}

Expand Down Expand Up @@ -146,7 +145,6 @@ export class ChattingServerService {
users: users,
channels: result.channels,
};
console.log(returnVal);

return returnVal;
}
Expand Down
2 changes: 0 additions & 2 deletions with-chat-server/src/apis/file/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ export class FileService {
const blobStream = blob.createWriteStream();

blobStream.on('error', (err) => {
console.log(err);
res.status(HttpStatus.BAD_REQUEST).json({
success: false,
url: `파일 업로드 실패`,
});
});
blobStream.on('finish', () => {
console.log('isDone');
res.status(HttpStatus.CREATED).json({
success: true,
url: `https://storage.googleapis.com/wthchat/${blob.name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export class FriendRequestService {
const queryRunner = this.connection.createQueryRunner();
await queryRunner.connect();
await queryRunner.startTransaction('SERIALIZABLE');
console.log(currentUser.id);
console.log(requestId);
try {
const request = await queryRunner.manager.findOne(FriendRequest, {
where: { id: requestId, isAccepted: false },
Expand Down
1 change: 0 additions & 1 deletion with-chat-server/src/apis/friend/friend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class FriendService {
})
.getMany();

console.log(friendList);
return friendList;
}
}
6 changes: 0 additions & 6 deletions with-chat-server/src/apis/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class UsersService {
try {
// const result = this.userRepository.save({ ...createUserDto });
const salt = await bcrypt.genSalt();
console.log(salt);

const user = new User();
user.email = createUserDto.email;
Expand Down Expand Up @@ -181,7 +180,6 @@ export class UsersService {
inviteList,
serverList,
]).then((values) => {
console.log(values[3], '===================');
return {
user: values[0],
friendList: values[1],
Expand Down Expand Up @@ -215,7 +213,6 @@ export class UsersService {
const user = await this.userRepository.findOne({
where: { email: email },
});
console.log(user);
return user !== null;
};

Expand Down Expand Up @@ -303,8 +300,6 @@ export class UsersService {
{ ...updateUserDto },
);

console.log(updateUserDto);
console.log(result, 'result');
if (result.affected < 0) throw new ConflictException('회원정보 수정 실패');

return this.userRepository.findOne({ where: { id: currentUser.id } });
Expand Down Expand Up @@ -347,7 +342,6 @@ export class UsersService {
};
});
});
console.log(result);
return result;
}
}
9 changes: 5 additions & 4 deletions with-chat-server/src/chat/chat.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export class ChatGateway {
@SubscribeMessage('join')
connectSomeone(@MessageBody() data) {
const [user, channelId] = data;
console.log(`${user}님이 코드: ${channelId}방에 접속했습니다.`);
const comeOn = `${user}님이 입장했습니다.`;
this.server.emit('comeOn' + channelId, comeOn);
}
Expand All @@ -28,12 +27,14 @@ export class ChatGateway {
return client;
}

@SubscribeMessage('message')
sendMessage2(@MessageBody() data: string, @ConnectedSocket() client: Socket) {
console.log(data);
}

@SubscribeMessage('send')
sendMessage(@MessageBody() data: string, @ConnectedSocket() client: Socket) {
console.log(data);
const [user, channelId, contents] = data;
console.log(`${client.id} : ${data}`);
console.log('broadcast.emit');
client.broadcast.emit('message' + channelId, [user, contents]);
}
}
2 changes: 1 addition & 1 deletion with-chat-server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ async function bootstrap() {
});
setupSwagger(app);
app.useWebSocketAdapter(new SocketIoAdapter(app));
await app.listen(4000);
await app.listen(3000);
}
bootstrap();

0 comments on commit 11da616

Please sign in to comment.