public void TestAdd() { var customerService = Cicada.CicadaFacade.Container.Resolve<ICustomerService>(); var customer = new CustomerPostParam { Name = "张三1", Phone = "18610170816" }; var ret = customerService.Add(customer); Assert.IsNotNull(ret); }
public Cicada.Core.Ret <int> Add(Bll.Dtos.CustomerPostParam item) { if (item == null || string.IsNullOrWhiteSpace(item.Name)) { return new Cicada.Core.Ret <int> { Status = 1, Message = "用户名无效" } } ; if (string.IsNullOrWhiteSpace(item.Phone)) { return new Cicada.Core.Ret <int> { Status = 2, Message = "手机号无效" } } ; return(new Cicada.Core.Ret <int>()); } } }
public Ret<int> Post(CustomerPostParam item) { return _customerService.Add(item); }