Example #1
0
func testRegister() {
	m := member.ValueMember{
		Usr:      "******",
		Pwd:      "test",
		Name:     "测试员",
		Sex:      1,
		Avatar:   "",
		Birthday: "1988-11-09",
		Phone:    "18616999822",
		Address:  "",
		Qq:       "",
		Email:    "",
		RegIp:    "127.0.0.1",
	}
	b, err := goclient.Member.Register(&m, 101, 0, "")
	if err != nil {
		jsv.LogErr(err)

	} else {
		jsv.Println("注册成功")
	}
	b, _, _ = goclient.Member.Login(m.Usr, m.Pwd)
	if b {
		jsv.Println("登录成功")
	} else {

		jsv.Printf("登录失败:Usr:%s,Pwd:%s\n", m.Usr, m.Pwd)
	}
}
Example #2
0
func testPartner() {
	p, err := goclient.Partner.GetPartner(101, "d435a520e50e960b")
	if err != nil {
		jsv.LogErr(err)
	} else {
		jsv.Println(p)
	}
}
Example #3
0
func testSubmitOrder() {
	items := "2*1|3*2|4*1"
	orderNo, err := goclient.Partner.SubmitOrder(101, "d435a520e50e960b",
		1, 0, 1, items, "")
	if err != nil {
		jsv.LogErr(err)
	} else {
		jsv.Println("[OrderNo]", orderNo)
	}
}
Example #4
0
func (this *Member) SaveBankInfo(m *jsv.Args, r *jsv.Result) error {
	memberId, err := Verify(m)
	if err != nil {
		return err
	}

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

	if err != nil {
		jsv.LogErr(err)
		return err
	} else {
		r.Result = true
	}
	return nil
}
Example #5
0
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.SaveDeliverAddress(memberId, &e)
	if err != nil {
		jsv.LogErr(err)
		r.Message = err.Error()
	} else {
		r.Result = true
	}
	return nil
}