| | |
| | | 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 |
| | | |
| | | /** |
| | |
| | | |
| | | @Test |
| | | fun foo4() { |
| | | val d = Date() |
| | | println(d.time) |
| | | 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) |
| | | } |
| | | } |