func (u *WorkerController) Getbagreq() { workerId := u.GetString(":workerid") token := u.GetString(":token") var reworker models.ReWorker var worker models.Worker worker.WorkerId = workerId + "aaa" worker.Token = token reworker.Code = "000000" reworker.Result = worker u.Data["json"] = reworker u.ServeJson() }
func (u *WorkerController) GetbagreqList() { //workerId := u.GetString(":workerid")////----string方式 workerId, _ := u.GetInt(":workerid")//----int方式 token := u.GetString(":token") var reworker models.ReWorker var worker models.Worker workers := make([]models.Worker, 2) worker.WorkerId =strconv.Itoa(workerId) + "aaaa"//----int方式 worker.Token = token reworker.Code = "000001" workers[0] = worker workers[1] = worker reworker.Result = workers u.Data["json"] = reworker u.ServeJson() }