新的应用平台采用国密SM4算法进行加解密
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.2 KiB

package publicmethod
// 全局函数处理
// 时间相关处理类
var (
timeLayoutMap = map[string]string{
"y": "2006",
"m": "2006-01",
"d": "2006-01-02",
"h": "2006-01-02 15",
"i": "2006-01-02 15:04",
"s": "2006-01-02 15:04:05",
}
weekDay = map[string]int{
"Monday": 1,
"Tuesday": 2,
"Wednesday": 3,
"Thursday": 4,
"Friday": 5,
"Saturday": 6,
"Sunday": 7,
}
)
// 泛型基础变量类型
type GenericityVariable interface {
int | int8 | int16 | int32 | int64 | float32 | float64 | string
}
// 数值泛型基础变量类型
type GenericityVariableNumber interface {
int | int8 | int16 | int32 | int64 | float32 | float64
}
/*
*加密算法
*/
type Md5Encryption struct {
Code string `json:"code"`
AppKey string `json:"appKey"`
}
//时间转换
type DateTimeTotimes struct {
Years string `json:"years"`
Quarter string `json:"quarter"`
Months string `json:"months"`
Week string `json:"week"`
Days string `json:"days"`
Hours string `json:"hours"`
Minutes string `json:"minutes"`
Second string `json:"second"`
AllTime int64 `json:"alltime"`
AllTimeString string `json:"alltimeStr"`
}
type BirthdayAge struct {
Birthday string
Age int
}