【问题标题】:Hiding property from Endpoint API从端点 API 隐藏属性
【发布时间】:2014-03-04 15:44:55
【问题描述】:

我正在使用 Google App Engine 后端和端点解决方案。我创建了一个类,其中有几个我不想向 API 公开的属性,因此无法设置它。例如,主键或“活动”状态。如何隐藏它们?

公共类用户{

public static final String NAME="User";

@PrimaryKey
@Persistent
private String userKey; <------- want to hide this from user

@Persistent
private String email_address; <----- expose this only

@Persistent
private boolean active; <---- want to hide this from user

}

【问题讨论】:

    标签: api google-app-engine properties hide endpoint


    【解决方案1】:
    @Persistent
    @ApiResourceProperty(ignored = AnnotationBoolean.FALSE)
    private String userKey;
    

    【讨论】:

      猜你喜欢
      • 2020-06-05
      • 1970-01-01
      • 2015-04-02
      • 2018-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多