Skip to content
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

SexEnum.UNKNOWN.value 与 memeber_user.sex 的默认值不一致 #508

Closed
DevDengChao opened this issue May 7, 2024 · 4 comments · Fixed by #509
Closed

SexEnum.UNKNOWN.value 与 memeber_user.sex 的默认值不一致 #508

DevDengChao opened this issue May 7, 2024 · 4 comments · Fixed by #509
Assignees
Labels
bug Something isn't working

Comments

@DevDengChao
Copy link
Contributor

基本信息

  • ruoyi-vue-pro 版本:2.1.0
  • 操作系统:不相关
  • 数据库:不相关

你猜测可能的原因

不相关

复现步骤

public enum SexEnum {
/** 男 */
MALE(1),
/** 女 */
FEMALE(2),
/* 未知 */
UNKNOWN(3);
/**
* 性别
*/
private final Integer sex;
}

image

报错信息

member-2024-01-18.sql 中对于 sex 字段的默认值是 0 , 但 SexEnum.UNKNOWN.value 的值是 3.

改进建议

新增 SexEnum.UNSPECIFED (0), 并废弃 SexEnum.UNKNOWN .

@YunaiV
Copy link
Owner

YunaiV commented May 7, 2024

建议把 UNKNOWN 改成 0 哈

@DevDengChao
Copy link
Contributor Author

建议把 UNKNOWN 改成 0 哈

不太好吧, 现在又没有发大版本, 直接修改存量枚举的值可能会导致部分实时跟进代码库改动的用户出现线上故障.

@YunaiV
Copy link
Owner

YunaiV commented May 9, 2024

这块是之前搞的不对,应该就是 0 是未知哈。

@YunaiV YunaiV added the bug Something isn't working label May 9, 2024
@DevDengChao
Copy link
Contributor Author

删除了 UNSPECIFIED, 更换了 UNKNOWN 的值

@YunaiV YunaiV closed this as completed May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants