no message
parent
e2ca2baa65
commit
e8cfa46cf8
6
main.go
6
main.go
|
@ -37,7 +37,7 @@ func CORSMiddleware(c *gin.Context) {
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "https://testingcloud.club")
|
c.Writer.Header().Set("Access-Control-Allow-Origin", "https://testingcloud.club")
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
|
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:8080")
|
||||||
}
|
}
|
||||||
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
||||||
|
@ -98,7 +98,6 @@ func main() {
|
||||||
InitLogs()
|
InitLogs()
|
||||||
InitRedisConfig()
|
InitRedisConfig()
|
||||||
InitMysql()
|
InitMysql()
|
||||||
// InitElasticSearch()
|
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
store := sessions.NewCookieStore([]byte("secret123"))
|
store := sessions.NewCookieStore([]byte("secret123"))
|
||||||
|
@ -182,7 +181,8 @@ func main() {
|
||||||
api.DELETE("/plan", planController.DelPlan) // 删除计划
|
api.DELETE("/plan", planController.DelPlan) // 删除计划
|
||||||
api.POST("/plan_days", planController.PlanDay) // 获取本月有计划天数
|
api.POST("/plan_days", planController.PlanDay) // 获取本月有计划天数
|
||||||
api.GET("/plan_types", planController.Types)
|
api.GET("/plan_types", planController.Types)
|
||||||
api.GET("planDays")
|
|
||||||
|
api.PUT("/undo",planController.CreateUndo)
|
||||||
}
|
}
|
||||||
|
|
||||||
openapi := r.Group("openapi")
|
openapi := r.Group("openapi")
|
||||||
|
|
|
@ -32,6 +32,9 @@ type PlanType struct {
|
||||||
TypeName string `gorm:"column:type_name;" json:"type_name"`
|
TypeName string `gorm:"column:type_name;" json:"type_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Undo) TableName() string {
|
||||||
|
return "undo"
|
||||||
|
}
|
||||||
func (m *PlanType) TableName() string {
|
func (m *PlanType) TableName() string {
|
||||||
return "plan_type"
|
return "plan_type"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue