enums\CodeEnums.java
/** * 订单状态 */@Getterpublic enum OrderStatusEnums implements CodeEnums{ NEW(0 , "新订单"), FINISH(1 , "完成订单"), CANCEL(2 , "取消订单") ; private Integer code; private String msg; OrderStatusEnums(Integer code, String msg) { this.code = code; this.msg = msg; }}
使用 dataobject\OrderMaster.java
/** * 订单主表 */@Entity@Data@DynamicUpdatepublic class OrderMaster { @Id /**订单id*/ private String orderId; /**买家姓名*/ private String buyerName; /**订单状态*/ private Integer orderStatus = OrderStatusEnums.NEW.getCode();/**支付状态*/ private Integer payStatus = PayStatusEnums.NEW.getCode();}