We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
版本:v1.5.1
application.yml:
application.yml
log-record: # Diff 时忽略新对象中 null 值字段,默认为 false diff-ignore-new-object-null-value: true # Diff 格式 diff-msg-format: 【${_fieldName}】:【${_oldValue}】->【${_newValue}】 # Diff 分隔符 diff-msg-separator: ;
UserController:
UserController
@OperationLog(bizId = "#id", bizType = "'user:update'", msg = "'更新用户:' + #_DIFF(#oldObj, #obj)") public ApiResponse update(@Min(value = 1, message = "参数错误") @PathVariable Long id, @Validated @RequestBody UserUpdateQO obj) { User user = userService.getById(id); if (user == null) { throw new ServiceException("用户不存在"); } LogRecordContext.putVariable("oldObj", user); // …… }
User:
User
@LogRecordDiffObject(alias = "用户") public class User { @LogRecordDiffField(alias = "用户名") private String username; // …… }
UserUpdateQO:
UserUpdateQO
@LogRecordDiffObject public class UserUpdateQO { @LogRecordDiffField(alias = "用户名") private String username; // …… }
结果:更新用户:?电话?:?18888888887?->?18888888888?;?昵称?:?234?->?23?;?角色?:?2,1671440885033914373?->?2?
更新用户:?电话?:?18888888887?->?18888888888?;?昵称?:?234?->?23?;?角色?:?2,1671440885033914373?->?2?
我所有的文件编码都是UTF-8。 我试过给diff-msg-format的内容前后加单引号也没用。
UTF-8
diff-msg-format
The text was updated successfully, but these errors were encountered:
晚点我看下
Sorry, something went wrong.
我复现了你的问题,和你的properties文件编码有关,带中文括号的话就得用UTF-8了
我 IDEA 的“新项目的设置”就是全部都是 UTF-8,我在提 issue 之前也检查过。我又按照你图片里的“”将application.yml将其编码改成 ISO-8859-1 也不行。我再试了下将application.yml改成 UTF-8 的application.properties也不行。
application.properties
我建了一个最简单的项目,调用http://localhost:8080/a?name=%E5%BC%A0%E4%B8%89测试之后仍然不行。 demo.zip
http://localhost:8080/a?name=%E5%BC%A0%E4%B8%89
No branches or pull requests
版本:v1.5.1
application.yml
:UserController
:User
:UserUpdateQO
:结果:
更新用户:?电话?:?18888888887?->?18888888888?;?昵称?:?234?->?23?;?角色?:?2,1671440885033914373?->?2?
我所有的文件编码都是
UTF-8
。我试过给
diff-msg-format
的内容前后加单引号也没用。The text was updated successfully, but these errors were encountered: