2
嗨,我嘗試使用,開發REST API 春天開機+彈簧數據JPA +彈簧數據REST如何僅使用Spring Data REST公開可寫的REST API?
我要揭露只是我的網友寫的部分(基本沒有GET或全部搞定)實體是如下
@Entity(name = "User")
public class User implements Serializable {
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
int id;
@Column
String login;
@Column
String password;
@Column
String username;
@Column
String address1;
@Column
String address2;
@Column
String city;
@Column
String state;
@Column
String zip;
@Column
String country;
@Column
String creditcard;
}
和datarepository是如下:
@RepositoryRestResource(path = "users")
public interface UserRepository extends CrudRepository<User, String> {
}
我怎樣才能做到這一點?
請參考鏈接https://stackoverflow.com/questions/29169717/how-to-prevent-some-http-methods-from-being-exported-from-my-mongorepository –