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 }