數(shù)據(jù)庫存儲:使用數(shù)字編碼
對接文檔字段:使用字母編碼
Bean中字段:使用枚舉類型
這樣在swagger接口文檔中會自動生成枚舉選擇項,不用單獨針對枚舉字典進行說明。
使用mybatis查詢時需要新增type-enums-package配置,否則會字段不匹配的問題
#mybatis
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
#實體掃描,多個package用逗號或者分號分隔
typeAliasesPackage: io.renren.modules.*.entity
#
type-enums-package: pro.haichuang.jyerp.constants
No enum constant pro.haichuang.jyerp.constants.DataPermissionEnum.1