我计划使用课堂分配的课程id在我们的服务器上存储一个许可证(不管本课程是否有许可证)。我是否可以假设课堂分配的课程id在所有领域都是唯一的,即以下情况不能出现-
A区->学校B门课程C(课堂分配id = 35595)
地区B->学校D课程F(课堂分配id = 35595)
发布于 2016-07-20 15:51:38
根据以下文件,您是正确的:
API概述 https://developers.google.com/classroom/guides/get-started#course_metadata_and_aliases
每个课程都由服务器分配的唯一ID标识。此外,名称可能与课程相关联,并用于替代唯一的ID。每个名称(称为别名 )都存在于一个名称空间中,该名称空间限制了谁可以创建和查看它。
基于示例Java代码:
Course course = new Course()
.setName("10th Grade Biology")
.setSection("Period 2")
.setDescriptionHeading("Welcome to 10th Grade Biology")
.setDescription("We'll be learning about about the structure of living creatures "
+ "from a combination of textbooks, guest lectures, and lab work. Expect "
+ "to be excited!")
.setRoom("301")
.setOwnerId("me")
.setCourseState("PROVISIONED");
course = service.courses().create(course).execute();
System.out.printf("Course created: %s (%s)\n", course.getName(), course.getId());它是由服务器生成的。希望能帮上忙!
https://stackoverflow.com/questions/38471735
复制相似问题