Grails 谷歌日历API事件位置
我继承了一些Groovy代码,看起来它是使用v2谷歌日历API构建的。它本质上是从日历中获取所有事件的列表,并构建一个显示屏幕。以前,它使用的URL类似于:Grails 谷歌日历API事件位置,grails,groovy,google-calendar-api,Grails,Groovy,Google Calendar Api,我继承了一些Groovy代码,看起来它是使用v2谷歌日历API构建的。它本质上是从日历中获取所有事件的列表,并构建一个显示屏幕。以前,它使用的URL类似于: /full?alt=json&max-results=25&orderby=starttime&sortorder=ascending&futureevents=true&end-max=" + dateEnd 我知道/full URL已被弃用,因此我将其替换为/basic,并为我的一个日历提供了专
/full?alt=json&max-results=25&orderby=starttime&sortorder=ascending&futureevents=true&end-max=" + dateEnd
我知道/full URL已被弃用,因此我将其替换为/basic,并为我的一个日历提供了专用URL,因此它看起来像:
/basic?alt=json&max-results=25&orderby=starttime&sortorder=ascending&futureevents=true&end-max=" + dateEnd
这样就可以恢复数据。但是,在解析数据时,他们试图使用每个提要条目的gd$where属性获取每个事件的位置。据我所知,gd$where属性现在只在基本日历级别可用,我没有看到可以用来提取事件位置的属性
下面是他们目前拥有的代码的一小段
data.feed.entry.each{ event ->
def eventResponse = [
title: '',
start: '',
end: '',
updated: '',
description: '',
location:'',
attendees: []
]
eventResponse.title = event.title.$t
eventResponse.description = event.content.$t
eventResponse.location = event.gd$where[0].valueString
eventResponse.start = event.gd$when[0].startTime
eventResponse.end = event.gd$when[0].endTime
eventResponse.updated = event.updated.$t
我是否可以不再使用日历的URL来获取这些信息,或者我只是遗漏了什么?这是我第一次使用谷歌日历功能,所以我在这里完全是绿色的。您可能想调查一下如何使用谷歌日历。我建议这样做的原因是,包含位置信息:
{
"kind": "calendar#event",
"etag": etag,
"id": string,
"status": string,
"htmlLink": string,
"created": datetime,
"updated": datetime,
"summary": string,
"description": string,
"location": string,
...
}
请问你是如何解决这个问题的?我也有类似的问题!试图让它与/basic一起工作,但失败了(永远挂起),我运行了以下代码:
newevent(开始:newlocaldatetime(entry.getTimes().get(0.getStartTime().getValue(),)
我遇到了一个类似于OP did的情况。似乎位置
键是可选的,在使用空位置创建事件时不会添加该键。