import { environment } from "src/environments/environment"

export interface DocumentModel {
    logId: string
    thumbnail: string
    link1: string
    langSupport: string
    thDocObj: string
    engDocObj: string
    uploadBy: string
    remark: string
    status: number
    approveBy: string
    thName: string
    engName: string
    thDesc: string
    engDesc: string
}

export class DocumentModel implements DocumentModel {
    logId: string
    thumbnail: string
    link1: string
    langSupport: string
    thDocObj: string
    engDocObj: string
    uploadBy: string
    remark: string
    status: number
    approveBy: string
    thName: string
    engName: string
    thDesc: string
    engDesc: string
    constructor(data: Partial<any>) {
        this.logId = data.logId?data.logId:''
        this.thumbnail = data.thumbnail?data.thumbnail:''
        this.link1 = data.link1?data.link1:''
        this.langSupport = data.langSupport?data.langSupport:''
        this.thDocObj = data.thDocObj?data.thDocObj:''
        this.engDocObj = data.engDocObj?data.engDocObj:''
        this.uploadBy = data.uploadBy?data.uploadBy:''
        this.remark = data.remark?data.remark:''
        this.status = data.status?data.status:0
        this.approveBy = data.approveBy?data.approveBy:''
        this.thName = data.thName?data.thName:''
        this.engName = data.engName?data.engName:''
        this.thDesc = data.thDesc?data.thDesc:''
        this.engDesc = data.engDesc?data.engDesc:''

   
    }
    getImage(){
        if(this.thumbnail){
            return environment.url+"files/image/"+this.thumbnail
        }else{
            return 'assets/images/big/auth-bg.jpg'
        }
    }
}