Investigation.go 1014 Bytes
package Api

import (
	"encoding/json"
	"github.com/aarongao/tools"
	"github.com/gin-gonic/gin"
	"letu/DB"
)

// @Title 增加调查
// @Description 增加调查
// @Accept  json
// @Produce  json
// @Param   UserId     1111111    string     true        "UserId"
// @Param   Mobile     18616619599    string     true        "联系电话"
// @Param   type     1    string     true        "类型"
// @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":"ok"}"
// @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}"
// @Router /Investigation/Save? [post]
func SaveInvestigation(c *gin.Context) {
	c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin"))
	c.Header("Access-Control-Allow-Credentials", "true")

	var Data map[string]interface{}
	json.Unmarshal([]byte(c.PostForm("Data")), &Data)

	DB.CInvestigation.Insert(DB.SInvestigation{
		c.PostForm("UserId"),
		c.PostForm("Mobile"),
		Data,
	})

	c.JSON(200, tools.ResponseSeccess{
		0,
		"ok",
	})

}