import com.alibaba.fastjson.JSON;
import lombok.Data;

/**
 * @author: zxfei
 * @date: 2022/4/22 10:20
 * @description:
 **/
@Data
public class Test implements ITest {

    private Integer userId;
    @Override
    public boolean isAdmin() {
        return userId == 1 ? true : false;
    }

    @Override
    public void setIsAdmin(Boolean bool) {

    }


    public static void main(String[] args) {
        Test test = new Test();
        test.setUserId(1);
        String json = JSON.toJSONString(test);
        System.out.println(json);

        ITest iTest = JSON.parseObject(json, ITest.class);

        System.out.println("bool:"+iTest.isAdmin());

    }

}
