8 changed files with 1446 additions and 10 deletions
@ -0,0 +1,9 @@ |
|||
package stock |
|||
|
|||
type ApiMethod struct{} |
|||
|
|||
// 获取天干地址
|
|||
type GainHeavenlyEarthly struct { |
|||
HeavenlyStems string `json:"heavenlyStems"` //天干
|
|||
EarthlyBranches string `json:"earthlyBranches"` //地支
|
|||
} |
|||
@ -0,0 +1,69 @@ |
|||
package stock |
|||
|
|||
import ( |
|||
"appNewPlatform/generalmethod" |
|||
"appNewPlatform/utils" |
|||
"appNewPlatform/utils/formatoutput" |
|||
|
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-02-26 08:52:39 |
|||
@ 功能: 入口 |
|||
*/ |
|||
func (a *ApiMethod) Index(c *gin.Context) { |
|||
sendMap := generalmethod.MapOut[string]() |
|||
token, _ := utils.ReleaseToken("300450") |
|||
sendMap["token"] = token |
|||
sendMap["tokenStr"], sendMap["claims"], sendMap["err"] = utils.ParseToken(token) |
|||
formatoutput.Result(0, sendMap, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-02-26 08:51:04 |
|||
@ 功能: 天干地址选股法 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
|
|||
func (a *ApiMethod) appNewPlatform(c *gin.Context) { |
|||
var request GainHeavenlyEarthly |
|||
err := c.ShouldBindJSON(&request) |
|||
if err != nil { |
|||
formatoutput.Result(10, err, c) |
|||
return |
|||
} |
|||
if request.HeavenlyStems == "" || request.EarthlyBranches == "" { |
|||
formatoutput.Result(102, request, c) |
|||
return |
|||
} |
|||
// HeavenlyStemsStarIndex := 0 //天干起始计算位置
|
|||
// for i, v := range formatoutput.HeavenlyStems {
|
|||
// if v == request.HeavenlyStems {
|
|||
// HeavenlyStemsStarIndex = i
|
|||
// return
|
|||
// }
|
|||
// }
|
|||
// EarthlyBranchesStarIndex := 0 //地支起始计算位置
|
|||
// for i, v := range formatoutput.EarthlyBranches {
|
|||
// if v == request.EarthlyBranches {
|
|||
// EarthlyBranchesStarIndex = i
|
|||
// return
|
|||
// }
|
|||
// }
|
|||
// theSameDay := time.Now().Unix()
|
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,61 @@ |
|||
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 |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package formatoutput |
|||
|
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-02-26 08:41:30 |
|||
@ 功能: 天干地址 |
|||
*/ |
|||
var HeavenlyStems = []string{"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"} |
|||
var EarthlyBranches = []string{"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"} |
|||
var BackgroundColor = []string{"红", "绿"} |
|||
Loading…
Reference in new issue