public IResponse Validate(ShopModel model) { var errors = new List <string>(); if (string.IsNullOrEmpty(model.ShopName) || model.ShopName.Length > 20) { errors.Add("门店名称不能为空且不能大于20个字符"); } return(VerifyResponse.CreateSuccessInstance()); }
public IResponse Validate(MerchantModel model) { var errors = new List <string>(); if (string.IsNullOrEmpty(model.BrandName) || model.BrandName.Length > 20) { errors.Add("商户名称不能为空且不能大于20个汉字"); } if (string.IsNullOrEmpty(model.AgreementMediaId)) { errors.Add("没有上传营业执照"); } if (string.IsNullOrEmpty(model.OperatorMediaId)) { errors.Add("没有上传法人身份证"); } if (errors.Count > 0) { return(new VerifyResponse(Constants.VerifyFailed, errors.ToArray())); } return(VerifyResponse.CreateSuccessInstance()); }