更新对应交易的代码实现

This commit is contained in:
2024-04-16 18:00:05 +08:00
parent b2185f7784
commit 798f566542
18 changed files with 858 additions and 43 deletions

View File

@@ -9,28 +9,28 @@ import (
)
func TestCaseInsert(t *testing.T) {
c, err := model.Models.KillaraCustomerModel.GetCustomer(1)
c, err := model.Models.KillaraCustomerModel.GetCustomer(nil, 1)
if err != nil {
panic(err)
}
log.Printf("%#v", c)
c.CustomerId = nil
c.Email = basic.StringPtr("474420502@qq.com")
model.Models.KillaraCustomerModel.InsertCustomer(c)
model.Models.KillaraCustomerModel.InsertCustomer(nil, c)
}
func TestUpdate(t *testing.T) {
c, err := model.Models.KillaraCustomerModel.GetCustomer(6)
c, err := model.Models.KillaraCustomerModel.GetCustomer(nil, 6)
if err != nil {
panic(err)
}
uc := &model.KillaraCustomer{}
uc.CustomerId = c.CustomerId
uc.Email = basic.StringPtr("474420502@gmail.com")
log.Println(model.Models.KillaraCustomerModel.UpdateCustomer(uc))
log.Println(model.Models.KillaraCustomerModel.UpdateCustomer(nil, uc))
}
func TestExist(t *testing.T) {
log.Println(model.Models.KillaraCustomerModel.CheckEmailExists("474420502@gmail.com"))
log.Println(model.Models.KillaraCustomerModel.CheckEmailExists("474420502@qq.com"))
log.Println(model.Models.KillaraCustomerModel.CheckEmailExists(nil, "474420502@gmail.com"))
log.Println(model.Models.KillaraCustomerModel.CheckEmailExists(nil, "474420502@qq.com"))
}