enums\CodeEnums.java
/** * 订单状态 */ @Getter public enum OrderStatusEnums implements CodeEnums<Integer>{ 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 @DynamicUpdate public class OrderMaster { @Id /**订单id*/ private String orderId; /**买家姓名*/ private String buyerName;
/**订单状态*/ private Integer orderStatus = OrderStatusEnums.NEW.getCode(); /**支付状态*/ private Integer payStatus = PayStatusEnums.NEW.getCode(); }