Exemplo n.º 1
0
// 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()
}
Exemplo n.º 2
0
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"
}