コード例 #1
0
ファイル: personalService.go プロジェクト: oldtree/One
func (ps *PersonalService) UpdataPersonInfo() (bool, string) {
	tools.Info("updata personal info")
	user := Person.NewPerson()
	user.Personid = ps.Userid
	ok, result := user.Update()
	if ok == false {
		if result == 0 {
			tools.Error("this user is not exist")
			return false, "this user is not exist"
		} else {
			return false, "please try again later"
		}

	}
	ps.Container["personalinfo"] = user
	return true, "ok"
}
コード例 #2
0
ファイル: personalService.go プロジェクト: oldtree/One
func (ps *PersonalService) PostLogin() (bool, string) {
	newcoming := Person.NewPerson()

	newcoming.Email = ps.Params["userid"].(string)
	newcoming.Password = ps.Params["password"].(string)

	ok, result := newcoming.Get()
	if ok {
		ps.Result["data"] = newcoming
		ps.PostPersonActive()
		return true, "ok"
	} else {
		if result == 0 {
			ps.Result["data"] = nil
			return false, "Need register"
		}
	}
	return ok, "ok"
}
コード例 #3
0
ファイル: registerService.go プロジェクト: oldtree/One
func (ls *RegisterService) ProcessService() (bool, string) {
	newcoming := Person.NewPerson()
	newcoming.Personid = 0
	newcoming.Nickname = ls.UsreNickName
	newcoming.Password = ls.UserPassword
	newcoming.Email = ls.UserContact

	ok, _ := newcoming.Get()

	if ok == false {
		okre, num := newcoming.Insert()
		log.Println("register new user ")
		if num == -1 {
			return okre, "register user error"
		}
		return okre, "register ok"
	} else {
		return false, "this user has been exist"
	}
}