类ActionType {
static expose = 'action-type'
String name
String description
static constraints = {
name blank: false, unique: true
}
静态映射= {
ID生成器:“增量”,列:“ID”
}
}
在击中http://localhost:8090/api/v1.0/action-type
这给出了以下错误:
HTTP代码:500
回应:{
“成功”:错误,
“message”:“找不到实体null”
}
最佳答案
您是否尝试过不使用v1.0?另外,您还需要确保“上下文”正确无误。通常,如果您的应用程序名为“foo”,则grails将为您提供类似于http://localhost:8090/foo
所以使用插件的方法是http://localhost:8090/foo/api/action-type
(这将为您提供数据库中当前存在的操作类型的列表)
文档为here。
关于json - 使用grails-json-rest-api-plugin时获取请求失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33118909/