entity.go 7.0 KB

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