-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpEL动态消息的实现 #38
Comments
请补充几个具体的场景。 |
在Excel导入的数据中,经常校验数据的准确性,需要将不正确的数据在message提示出来 |
请写详细一点,并提供一个具体的例子。关键是你期望的message是什么样的? |
根据当前SpEL规则来定制,例如我们得提示是“上传失败,仓库编码:%s未匹配到仓库信息,请检查导入数据”,可以通过咱们组件中改成“上传失败,仓库编码:{#this.areaCode}未匹配到仓库信息,请检查导入数据” |
涉及业务信息的校验,一般建议在业务逻辑中抛出具体异常信息。 在你这个例子中,应该是需要通过调用 Spring Bean 的方式来查询仓库编码是否存在,这种情况下你可以直接在业务方法中抛出对应的异常进行处理。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
通过SpEL对注解中的message消息进行动态替换,适用于一些特殊数据校验提示的场景
The text was updated successfully, but these errors were encountered: