1
2
3
4
5
6
7
8
9
10
11
12
13
  | package com.dy.common.mybatis.envm; 
 |    
 |  import com.alibaba.fastjson2.JSONObject; 
 |  import com.alibaba.fastjson2.annotation.JSONField; 
 |    
 |  public interface IEnum { 
 |      Byte getCode(); 
 |      String getName(); 
 |      @JSONField 
 |      default JSONObject toJson() { 
 |          return JSONObject.of("code", getCode(), "name", getName()); 
 |      } 
 |  } 
 |  
  |