コード例 #1
0
ファイル: project.go プロジェクト: oldtree/One
func HandleProjectAllGet(c *gin.Context) {
	var result = make(map[string]interface{}, 16)
	var userid string
	//var cookieid string
	var projectid string
	userid = c.Params.ByName("personid")

	if userid == "" {
		result["code"] = 400
		result["descrip"] = "userid is empty"
		result["data"] = nil
		c.JSON(200, result)
		return
	}

	ser := new(Service.ProjectService)
	ser.Userid = tools.ToInt64(userid)
	ser.Projectid = tools.ToInt64(projectid)

	ser.ActionType = Service.PROJECT_GET_ACTION
	ser.ServerType = Service.PROJECT_ALL_SERVICE_TYPE
	ok, _ := ser.ProcessService()
	result["code"] = 0
	result["descrip"] = "ok"
	result["data"] = ser.Container
	if ok == false {
		tools.Info(result)
		c.JSON(200, result)
		return
	}
	c.JSON(200, result)
	return

}
コード例 #2
0
ファイル: project.go プロジェクト: oldtree/One
func HandleProjectStaticsGet(c *gin.Context) {
	var result = make(map[string]interface{}, 16)
	var userid string
	var projectid string
	//	var cookieid string

	ser := new(Service.ProjectService)
	ser.Userid = tools.ToInt64(userid)
	ser.Projectid = tools.ToInt64(projectid)
	ser.ActionType = Service.PROJECT_GET_ACTION
	ok, _ := ser.ProcessService()
	result["code"] = ok
	result["result"] = ser.Container
	if ok == false {
		tools.Info(result)
	}

}