示例#1
0
文件: member.go 项目: honj51/go2o
func (this *Member) Verify(m *jsv.Args, r *jsv.Result) error {
	_, err := Verify(m)
	if err != nil {
		r.Message = err.Error()
	} else {
		r.Result = true
	}
	return nil
}
示例#2
0
文件: member.go 项目: honj51/go2o
func (this *Member) SaveDeliverAddr(m *jsv.Args, r *jsv.Result) error {
	memberId, err := Verify(m)
	if err != nil {
		return err
	}

	var e member.DeliverAddress
	err = jsv.UnmarshalMap((*m)["json"], &e)
	if err != nil {
		return err
	}
	e.MemberId = memberId

	_, err = dps.MemberService.SaveDeliverAddr(memberId, &e)
	if err != nil {
		jsv.LogErr(err)
		r.Message = err.Error()
	} else {
		r.Result = true
	}
	return nil
}