当前位置: 首页>>代码示例>>Golang>>正文


Golang PersonalService.Params方法代码示例

本文整理汇总了Golang中One/Service/PersonalService.PersonalService.Params方法的典型用法代码示例。如果您正苦于以下问题:Golang PersonalService.Params方法的具体用法?Golang PersonalService.Params怎么用?Golang PersonalService.Params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在One/Service/PersonalService.PersonalService的用法示例。


在下文中一共展示了PersonalService.Params方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: HandlePersonFollowingGet

func HandlePersonFollowingGet(c *gin.Context) {
	var result = make(map[string]interface{}, 16)
	var userid string
	var cookieid string

	userid = c.Request.Header.Get("userid")
	if userid == "" {
		cookie, err := c.Request.Cookie("one")
		if err != nil {
			tools.Info(err.Error())
		}

		if cookie != nil {
			cookieid = cookie.Value
			tools.Info(cookieid)
		}

	}

	ser := new(Service.PersonalService)
	ser.ServerType = Service.PERSONAAL_FOLLOWING_SERVICE_TYPE
	ser.Userid = tools.ToInt64(userid)
	ser.ActionType = 1
	ser.Params = make(map[string]interface{}, 16)
	ok, _ := ser.ProcessService()

	result["code"] = ok
	result["result"] = ser.Container

	if ok == false {
		tools.Info(result)
	}
	c.JSON(200, result)

}
开发者ID:oldtree,项目名称:One,代码行数:35,代码来源:personal.go

示例2: HandleLoginPost

func HandleLoginPost(c *gin.Context) {
	var userid string
	var cookieid string
	var cookie = new(http.Cookie)

	userid = c.Request.Header.Get("email")

	password := c.Request.Header.Get("password")
	if userid == "" {
		cookie, err := c.Request.Cookie("one")
		if err != nil {
			tools.Info(err.Error())
		}

		if cookie != nil {
			cookieid = cookie.Value
			tools.Info(cookieid)
		}

	}

	ser := new(Service.PersonalService)
	ser.ServerType = Service.PERSONAAL_LOGINLOGOUT_SERVICE_TYPE
	ser.ActionType = Service.PERSONAL_POST_ACTION
	ser.Params = make(map[string]interface{})
	ser.Params["userid"] = userid
	ser.Params["password"] = password
	ser.ProcessService()

	cookie.Name = "one"
	cookie.Value = userid
	cookie.MaxAge = 3600
	c.Request.AddCookie(cookie)
	if ser.Result["data"] != nil {
		tools.Info("user login success")
		c.Redirect(301, "/people/"+userid)
	} else {
		tools.Info("user login failed")
		c.JSON(200, ser.Result)
	}

}
开发者ID:oldtree,项目名称:One,代码行数:42,代码来源:login.go

示例3: HandlePersonFollowingPost

func HandlePersonFollowingPost(c *gin.Context) {
	var result = make(map[string]interface{}, 16)
	var userid string
	var cookieid string

	userid = c.Request.Header.Get("userid")

	if userid == "" {
		cookie, err := c.Request.Cookie("one")
		if err != nil {
			tools.Info(err.Error())
		}

		if cookie != nil {
			cookieid = cookie.Value
			tools.Info(cookieid)
		}

	}

	followingid := c.Request.Header.Get("followingid")

	ser := new(Service.PersonalService)
	ser.ServerType = Service.PERSONAAL_FOLLOWING_SERVICE_TYPE
	ser.Userid = tools.ToInt64(userid)
	ser.ActionType = 2
	ser.Params = make(map[string]interface{}, 16)
	ser.Params["up_personid"] = followingid
	ser.Params["down_personid"] = userid
	ok, re := ser.ProcessService()

	result["code"] = ok
	result["result"] = re

	if ok == false {
		tools.Info(result)
	}
	c.Redirect(302, "/people/"+followingid+"/following")
}
开发者ID:oldtree,项目名称:One,代码行数:39,代码来源:personal.go

示例4: HandlePersonActiveGet

func HandlePersonActiveGet(c *gin.Context) {
	var result = make(map[string]interface{}, 16)
	var userid string
	var cookieid string

	userid = c.Params.ByName("personid")

	if userid == "" {
		cookie, err := c.Request.Cookie("one")
		if err != nil {
			tools.Info(err.Error())
		}

		if cookie != nil {
			cookieid = cookie.Value
			tools.Info(cookieid)
		}

	}

	ser := new(Service.PersonalService)
	ser.ServerType = Service.PERSONAAL_ACTIVE_SERVICE_TYPE
	ser.Userid = tools.ToInt64(userid)
	ser.ActionType = 1
	ser.Params = make(map[string]interface{}, 16)
	ser.Params["personid"] = userid
	ok, _ := ser.ProcessService()

	result["code"] = ok
	result["result"] = ser.Container

	if ok == false {
		c.Redirect(302, "/people/"+userid)
		return
	}
	c.JSON(200, result)
}
开发者ID:oldtree,项目名称:One,代码行数:37,代码来源:personal.go

示例5: HandlePersonActivePost

func HandlePersonActivePost(c *gin.Context) {
	var result = make(map[string]interface{}, 16)
	var userid string

	userid = c.Params.ByName("personid")

	ser := new(Service.PersonalService)
	ser.ServerType = Service.PERSONAAL_ACTIVE_SERVICE_TYPE
	ser.Userid = tools.ToInt64(userid)
	ser.ActionType = 2
	ser.Params = make(map[string]interface{}, 16)

	ok, re := ser.ProcessService()

	result["code"] = ok
	result["result"] = re

	if ok == false {
		tools.Info(result)
		c.Redirect(302, "/people/"+userid)
		return
	}
	c.Redirect(302, "/people/"+userid+"/active")
}
开发者ID:oldtree,项目名称:One,代码行数:24,代码来源:personal.go


注:本文中的One/Service/PersonalService.PersonalService.Params方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。