feiyu02
2022-11-15 23bd719cebe5feeff4e48fde925b0b39755eea93
src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt
@@ -1,11 +1,15 @@
package cn.flightfeather.supervision
import cn.flightfeather.supervision.common.nlp.NlpController
import cn.flightfeather.supervision.websocket.MsgType
import cn.flightfeather.supervision.websocket.PersonalServerMsgVo
import cn.flightfeather.supervision.websocket.WebSocketMsg
import com.google.gson.Gson
import org.junit.Test
import org.springframework.boot.json.GsonJsonParser
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
import java.util.regex.Pattern
@@ -71,4 +75,32 @@
        d.time = 1666262747
        println(d)
    }
    @Test
    fun foo5() {
        val n = NlpController()
        n.execute("吃苹果")
    }
    @Test
    fun foo6() {
        var a = 1667377808L
        a*=1000
        println(a)
    }
    @Test
    fun foo7() {
        var s = "2022/10-12"
        val list = s.split("-")
        val endM = list[1].toInt()
        val list2 = list[0].split("/")
        val year = list2[0].toInt()
        val startM = list2[1].toInt()
//        s = s.replace("/", "-")
        val st = LocalDateTime.of(year, startM, 1, 0, 0, 0, 0)
        val et = LocalDateTime.of(year, endM, 1, 0, 0, 0, 0).plusMonths(1)
        println(st)
        println(et)
    }
}