package com.ffii.fpsms.m18.utils

import com.ffii.fpsms.m18.M18Config
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Component
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneId

@Component
open class CommonUtils(

) {
    open fun timestampToLocalDateTime(timestamp: Long):LocalDateTime {
        val localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.of("Asia/Hong_Kong"))
        return localDateTime
    }

     fun listToString(numbers: List<Long>?, prefix: String, delimiter: String): String {
        if (numbers == null) {
            return ""
        }
        return numbers.joinToString(delimiter) { "$prefix$it" }
    }
}