feat 初始化

This commit is contained in:
2026-10-29 10:12:22 +08:00
parent 332d812347
commit 09c1df8a22
81 changed files with 2211 additions and 7821 deletions

26
utils/time.go Normal file
View File

@@ -0,0 +1,26 @@
package utils
import (
"math"
"time"
)
// CalcDaysDiff 计算两个日期相差多少天
func CalcDaysDiff(one, two time.Time) int32 {
oneZero := time.Date(
one.Year(),
one.Month(),
one.Day(),
0, 0, 0, 0,
time.Local,
)
twoZero := time.Date(
two.Year(),
two.Month(),
two.Day(),
0, 0, 0, 0,
time.Local,
)
// 计算相差天数
return int32(math.Abs(oneZero.Sub(twoZero).Hours() / 24))
}