entity.go 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package calendar
  2. // 基本结构体
  3. type DingParams struct {
  4. UserId string
  5. }
  6. type DingAddScheduleParams struct {
  7. DingParams
  8. TimeZone string
  9. Summary string
  10. Description string
  11. BeginTime string
  12. EndTime string
  13. UserIds []string
  14. }
  15. type DingGetScheduleParams struct {
  16. DingParams
  17. EventId string
  18. }
  19. type DingIsUserBusyParams struct {
  20. DingParams
  21. UserIds []string
  22. BeginTime string
  23. EndTime string
  24. }
  25. type EventStart struct {
  26. // 日程开始日期,如果是全天日程必须有值,非全天日程必须留空,格式:yyyy-MM-dd
  27. Date *string `json:"date,omitempty" xml:"date,omitempty"`
  28. // 日程开始时间,非全天日程必须有值,全天日程必须留空,格式为ISO-8601的date-time格式
  29. DateTime *string `json:"dateTime,omitempty" xml:"dateTime,omitempty"`
  30. // 日程开始时间所属时区,非全天日程必须有值,全天日程必须留空,tz database name格式,参考:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  31. TimeZone *string `json:"timeZone,omitempty" xml:"timeZone,omitempty"`
  32. }
  33. type EventEnd struct {
  34. // 日程结束日期,如果是全天日程必须有值,非全天日程必须留空,格式:yyyy-MM-dd
  35. Date *string `json:"date,omitempty" xml:"date,omitempty"`
  36. // 日程结束时间,非全天日程必须有值,全天日程必须留空,格式为ISO-8601的date-time格式
  37. DateTime *string `json:"dateTime,omitempty" xml:"dateTime,omitempty"`
  38. // 日程结束时间所属时区,非全天日程必须有值,全天日程必须留空,tz database name格式,参考:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  39. TimeZone *string `json:"timeZone,omitempty" xml:"timeZone,omitempty"`
  40. }
  41. type EventAttendees struct {
  42. Id *string `json:"id,omitempty" xml:"id,omitempty"`
  43. // 用户名
  44. DisplayName *string `json:"displayName,omitempty" xml:"displayName,omitempty"`
  45. // 是否是当前登陆用户
  46. Self *bool `json:"self,omitempty" xml:"self,omitempty"`
  47. }
  48. type EventOrganizer struct {
  49. // 用户名
  50. DisplayName *string `json:"displayName,omitempty" xml:"displayName,omitempty"`
  51. Id *string `json:"id,omitempty" xml:"id,omitempty"`
  52. // 回复状态
  53. ResponseStatus *string `json:"responseStatus,omitempty" xml:"responseStatus,omitempty"`
  54. // 是否是当前登陆用户
  55. Self *bool `json:"self,omitempty" xml:"self,omitempty"`
  56. }
  57. type ScheduleInformation struct {
  58. // 异常描述
  59. Error *string `json:"error,omitempty" xml:"error,omitempty"`
  60. ScheduleItems []*ScheduleInformationScheduleItems `json:"scheduleItems,omitempty" xml:"scheduleItems,omitempty" type:"Repeated"`
  61. // 用户userId
  62. UserId *string `json:"userId,omitempty" xml:"userId,omitempty"`
  63. }
  64. type ScheduleInformationScheduleItems struct {
  65. // 结束时间,表示一个日期,或者一个带时区的时间戳
  66. End *ScheduleInformationScheduleItemsEnd `json:"end,omitempty" xml:"end,omitempty" type:"Struct"`
  67. // 开始时间,表示一个日期,或者一个带时区的时间戳
  68. Start *ScheduleInformationScheduleItemsStart `json:"start,omitempty" xml:"start,omitempty" type:"Struct"`
  69. // 状态: - BUSY:繁忙, - TENTATIVE:暂定繁忙
  70. Status *string `json:"status,omitempty" xml:"status,omitempty"`
  71. }
  72. type ScheduleInformationScheduleItemsStart struct {
  73. // 开始日期
  74. Date *string `json:"date,omitempty" xml:"date,omitempty"`
  75. // 开始时间戳,按照ISO 8601格式
  76. DateTime *string `json:"dateTime,omitempty" xml:"dateTime,omitempty"`
  77. // 所属时区
  78. TimeZone *string `json:"timeZone,omitempty" xml:"timeZone,omitempty"`
  79. }
  80. type ScheduleInformationScheduleItemsEnd struct {
  81. // 结束日期
  82. Date *string `json:"date,omitempty" xml:"date,omitempty"`
  83. // 结束时间戳,按照ISO 8601格式
  84. DateTime *string `json:"dateTime,omitempty" xml:"dateTime,omitempty"`
  85. // 时间戳所属时区
  86. TimeZone *string `json:"timeZone,omitempty" xml:"timeZone,omitempty"`
  87. }
  88. // 请求结构体
  89. type EventRequest struct {
  90. Attendees []*EventAttendees `json:"attendees,omitempty" xml:"attendees,omitempty" type:"Repeated"`
  91. // 日程描述
  92. Description *string `json:"description,omitempty" xml:"description,omitempty"`
  93. // 日程结束时间
  94. End *EventEnd `json:"end,omitempty" xml:"end,omitempty" type:"Struct"`
  95. // 扩展信息
  96. Extra map[string]*string `json:"extra,omitempty" xml:"extra,omitempty"`
  97. // 是否为全天日程
  98. IsAllDay *bool `json:"isAllDay,omitempty" xml:"isAllDay,omitempty"`
  99. // 日程开始时间
  100. Start *EventStart `json:"start,omitempty" xml:"start,omitempty" type:"Struct"`
  101. // 日程标题
  102. Summary *string `json:"summary,omitempty" xml:"summary,omitempty"`
  103. }
  104. type GetScheduleRequest struct {
  105. // 查询结束时间
  106. EndTime *string `json:"endTime,omitempty" xml:"endTime,omitempty"`
  107. // 查询开始时间
  108. StartTime *string `json:"startTime,omitempty" xml:"startTime,omitempty"`
  109. // 待查询的用户列表
  110. UserIds []*string `json:"userIds,omitempty" xml:"userIds,omitempty" type:"Repeated"`
  111. }
  112. // 响应结构体
  113. type CreateEventResponse struct {
  114. Attendees []*EventAttendees `json:"attendees,omitempty" xml:"attendees,omitempty" type:"Repeated"`
  115. // 创建时间
  116. CreateTime *string `json:"createTime,omitempty" xml:"createTime,omitempty"`
  117. Description *string `json:"description,omitempty" xml:"description,omitempty"`
  118. End *EventEnd `json:"end,omitempty" xml:"end,omitempty" type:"Struct"`
  119. Id *string `json:"id,omitempty" xml:"id,omitempty"`
  120. // 日程开始时间
  121. Start *EventStart `json:"start,omitempty" xml:"start,omitempty" type:"Struct"`
  122. Summary *string `json:"summary,omitempty" xml:"summary,omitempty"`
  123. // 更新时间
  124. UpdateTime *string `json:"updateTime,omitempty" xml:"updateTime,omitempty"`
  125. }
  126. type GetEventResponse struct {
  127. Attendees []*EventAttendees `json:"attendees,omitempty" xml:"attendees,omitempty" type:"Repeated"`
  128. // 创建时间
  129. CreateTime *string `json:"createTime,omitempty" xml:"createTime,omitempty"`
  130. // 日程描述
  131. Description *string `json:"description,omitempty" xml:"description,omitempty"`
  132. // 日程结束时间
  133. End *EventEnd `json:"end,omitempty" xml:"end,omitempty" type:"Struct"`
  134. Id *string `json:"id,omitempty" xml:"id,omitempty"`
  135. Organizer *EventOrganizer `json:"organizer,omitempty" xml:"organizer,omitempty" type:"Struct"`
  136. // 重复日程的主日程id,非重复日程为空
  137. SeriesMasterId *string `json:"seriesMasterId,omitempty" xml:"seriesMasterId,omitempty"`
  138. // 日程开始时间
  139. Start *EventStart `json:"start,omitempty" xml:"start,omitempty" type:"Struct"`
  140. // 日程状态
  141. Status *string `json:"status,omitempty" xml:"status,omitempty"`
  142. // 日程标题
  143. Summary *string `json:"summary,omitempty" xml:"summary,omitempty"`
  144. // 更新时间
  145. UpdateTime *string `json:"updateTime,omitempty" xml:"updateTime,omitempty"`
  146. }
  147. type GetScheduleResponse struct {
  148. // 闲忙信息
  149. ScheduleInformation []*ScheduleInformation `json:"scheduleInformation,omitempty" xml:"scheduleInformation,omitempty" type:"Repeated"`
  150. }