// APIs func (c *AdminController) ParseFit() { fitBytes := c.Ctx.Input.RequestBody // fmt.Println(string(fitBytes)) fit := models.ParseFit(string(fitBytes)) c.Data["json"] = fit c.ServeJson() }
func (c *MainController) Post() { fitStr := c.Ctx.Request.FormValue("fitStr") fit := models.ParseFit(fitStr) fitLink := models.LinkOfFit(fit) fmt.Println(fitLink) c.Data["FitStr"] = fitStr c.Data["FitLink"] = fitLink c.Data["FitName"] = fit.Name c.Data["ShipName"] = fit.Ship.Name c.TplNames = "index.tpl" }