diff --git a/api_event_callback_v2_elearning_course_registration_updated_v2.go b/api_event_callback_v2_elearning_course_registration_updated_v2.go new file mode 100644 index 00000000..485933ee --- /dev/null +++ b/api_event_callback_v2_elearning_course_registration_updated_v2.go @@ -0,0 +1,61 @@ +// Code generated by lark_sdk_gen. DO NOT EDIT. +/** + * Copyright 2022 chyroc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package lark + +import ( + "context" +) + +// EventV2ElearningCourseRegistrationUpdatedV2 课程学习进度更新时触发{使用示例}(url=/api/tools/api_explore/api_explore_config?project=elearning&version=v2&resource=course_registration&event=updated) +// +// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/elearning-v2/course_registration/events/updated +func (r *EventCallbackService) HandlerEventV2ElearningCourseRegistrationUpdatedV2(f EventV2ElearningCourseRegistrationUpdatedV2Handler) { + r.cli.eventHandler.eventV2ElearningCourseRegistrationUpdatedV2Handler = f +} + +// EventV2ElearningCourseRegistrationUpdatedV2Handler event EventV2ElearningCourseRegistrationUpdatedV2 handler +type EventV2ElearningCourseRegistrationUpdatedV2Handler func(ctx context.Context, cli *Lark, schema string, header *EventHeaderV2, event *EventV2ElearningCourseRegistrationUpdatedV2) (string, error) + +// EventV2ElearningCourseRegistrationUpdatedV2 ... +type EventV2ElearningCourseRegistrationUpdatedV2 struct { + CourseID string `json:"course_id,omitempty"` // 课程ID + Learner *EventV2ElearningCourseRegistrationUpdatedV2Learner `json:"learner,omitempty"` // 课程学员信息 + EnrollAt int64 `json:"enroll_at,omitempty"` // 加入学习时间戳(秒), 取值范围: `0` ~ `4294967295` + EnrollType int64 `json:"enroll_type,omitempty"` // 注册类型, 可选值有: 1: 被管理员指派, 2: 学员自主加入, 3: 按照规则自动加入, 4: 学员申请被批准加入 + LearningDuration int64 `json:"learning_duration,omitempty"` // 学习时长, 单位: 秒, 取值范围: `0` ~ `4294967295` + FinishedAt int64 `json:"finished_at,omitempty"` // 完成时间戳(秒), 取值范围: `0` ~ `4294967295` + LearningState int64 `json:"learning_state,omitempty"` // 完成状态, 可选值有: 0: 课程未开始, 1: 课程学习中, 2: 课程已通过, 3: 课程不合格 + CompulsoryLessonIDs []string `json:"compulsory_lesson_ids,omitempty"` // 必修章节id列表, 长度范围: `0` ~ `65535` + LearnedCompulsoryLessonIDs []string `json:"learned_compulsory_lesson_ids,omitempty"` // 已完成的必修章节id列表, 长度范围: `0` ~ `65535` + OptionalLessonIDs []string `json:"optional_lesson_ids,omitempty"` // 选修章节id列表, 长度范围: `0` ~ `65535` + LearnedOptionalLessonIDs []string `json:"learned_optional_lesson_ids,omitempty"` // 已完成的选修章节id列表, 长度范围: `0` ~ `65535` +} + +// EventV2ElearningCourseRegistrationUpdatedV2Learner ... +type EventV2ElearningCourseRegistrationUpdatedV2Learner struct { + UserID *EventV2ElearningCourseRegistrationUpdatedV2LearnerUserID `json:"user_id,omitempty"` // 用户 ID + Email string `json:"email,omitempty"` // 用户的 email + Phone string `json:"phone,omitempty"` // 用户的手机号 +} + +// EventV2ElearningCourseRegistrationUpdatedV2LearnerUserID ... +type EventV2ElearningCourseRegistrationUpdatedV2LearnerUserID struct { + UnionID string `json:"union_id,omitempty"` // 用户的 union id + UserID string `json:"user_id,omitempty"` // 用户的 user id, 字段权限要求: 获取用户 user ID + OpenID string `json:"open_id,omitempty"` // 用户的 open id +}