|
@@ -10,6 +10,7 @@ import { CommentDto } from './dto/comment.dto'
|
|
|
import { LikesService } from 'src/likes/likes.service'
|
|
import { LikesService } from 'src/likes/likes.service'
|
|
|
import { Likes } from 'src/likes/entities/likes.entity'
|
|
import { Likes } from 'src/likes/entities/likes.entity'
|
|
|
import { Moments } from 'src/moments/entities/moments.entity'
|
|
import { Moments } from 'src/moments/entities/moments.entity'
|
|
|
|
|
+import { ConditionService } from 'src/condition/condition.service'
|
|
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|
|
|
export class CommentService {
|
|
export class CommentService {
|
|
@@ -21,7 +22,8 @@ export class CommentService {
|
|
|
private readonly likesRepository: Repository<Likes>,
|
|
private readonly likesRepository: Repository<Likes>,
|
|
|
@InjectRepository(Moments)
|
|
@InjectRepository(Moments)
|
|
|
private readonly momentsRepository: Repository<Moments>,
|
|
private readonly momentsRepository: Repository<Moments>,
|
|
|
- private readonly likesService: LikesService
|
|
|
|
|
|
|
+ private readonly likesService: LikesService,
|
|
|
|
|
+ private readonly conditionService: ConditionService
|
|
|
) { }
|
|
) { }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -140,9 +142,11 @@ export class CommentService {
|
|
|
moments.commentNum += 1
|
|
moments.commentNum += 1
|
|
|
await this.momentsRepository.save(moments)
|
|
await this.momentsRepository.save(moments)
|
|
|
const newComment = await this.commentRepository.save(commentDto)
|
|
const newComment = await this.commentRepository.save(commentDto)
|
|
|
-
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (false) {
|
|
|
|
|
+ await this.conditionService.reply(newComment, moments)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return newComment
|
|
return newComment
|
|
|
}
|
|
}
|
|
|
|
|
|