You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
746 B

import { CommentItem, CommentItemList } from '~/domain/models/comment/comment'
export class CommentReadDTO {
id: number;
user: number;
username: string;
example: number;
text: string;
createdAt: string;
constructor(item: CommentItem) {
this.id = item.id;
this.user = item.user;
this.username = item.username;
this.example = item.example;
this.text = item.text;
this.createdAt = item.createdAt;
}
}
export class CommentListDTO {
count: number
next : string | null
prev : string | null
items: CommentReadDTO[]
constructor(item: CommentItemList) {
this.count = item.count
this.next = item.next
this.prev = item.prev
this.items = item.items.map(_ => new CommentReadDTO(_))
}
}