class OAuth2ClientEntity extends GenericEntity<String> {

    @Column(length = 1024)
    @Schema(description = "Logo地址")
    private String logoUrl;

    @Column(length = 64, nullable = false)
    @Schema(description = "客户端名称")
    @NotBlank
    private String name;

    @Column(length = 128, nullable = false)
    @Schema(description = "密钥")
    @NotBlank
    @ToString.Ignore
    private String secret;

    @Column(length = 64, nullable = false)
    @Schema(description = "绑定用户ID")
    @NotBlank
    private String userId;

    @Column(length = 1024, nullable = false)
    @Schema(description = "回调地址")
    @NotBlank
    private String callbackUri;

    @Column(length = 1024, nullable = false)
    @Schema(description = "首页地址")
    @NotBlank
    private String homeUri;

    @Column
    @Schema(description = "说明")
    private String description;

    @Column(length = 32)
    @EnumCodec
    @ColumnType(javaType = String.class)
    @DefaultValue("enabled")
    @Schema(description = "状态")
    private OAuth2ClientState state;

    @Column(nullable = false)
    @Schema(description = "创建时间")
    @DefaultValue(generator = Generators.CURRENT_TIME)
    private Long createTime;

    public boolean enabled() {
        return state == OAuth2ClientState.enabled;
    }

    public OAuth2Client toOAuth2Client() {<FILL_FUNCTION_BODY>}
}

        OAuth2Client client = new OAuth2Client();
        client.setClientSecret(secret);
        client.setClientId(getId());
        client.setName(getName());
        client.setRedirectUrl(callbackUri);
        client.setDescription(description);
        client.setUserId(userId);
        return client;
    
<methods>public non-sealed void <init>() ,public transient java.lang.String toString(java.lang.String[]) ,public java.lang.String toString() <variables>private java.lang.String id