服务资源描述 - HeraldStudio/herald-web-services GitHub Wiki
请求
GET http://herald.seu.edu.cn/ws/update
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<update
xmlns="http://herald.seu.edu.cn/ws/android-update">
<version>1.0.0</version>
<uri>http://herald.seu.edu.cn/android-update/ezherald.1.0.pkg</uri>
<info>示例更新信息</info>
<force>false</force>
</update>
请求
GET http://herald.seu.edu.cn/ws/campus/{name}
参数列表:
参数名 | 必选 | 默认值 | 说明 |
---|---|---|---|
before | 否 | 无 | 返回某条信息(GUID)前的 |
after | 否 | 无 | 返回某条信息(GUID)后的 |
limit | 否 | 10 | 返回的最大数目 |
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss version="2.0">
<channel>
<title>教务管理</title>
<link>http://jwc.seu.edu.cn/s/99/t/1600/p/1/c/6820/list.htm</link>
<lastBuildDate>Fri, 5 Jul 2013 00:00:00 CST</lastBuildDate>
<item>
<title>关于2013年暑期放假的通知</title>
<link>http://jwc.seu.edu.cn//picture/article/99/e1/76/74257dd84e0b82a521da1caa8172/298ab0a7-0afc-4127-a462-a05c41d6ebef.doc</link>
<description>...</description>
<guid>d3cc0916-e526-11e2-9cd5-005056ba7050</guid>
<pubDate>Fri, 28 Jun 2013 00:00:00 CST</pubDate>
</item>
<item>
<title>2012-2013学年第3学期期末考试情况通报</title>
<link>http://jwc.seu.edu.cn//picture/article/99/b3/1d/5caa40454d82a8eaddbb87ada7a7/31e53e11-b394-4071-bda8-96eb3699bbcb.doc</link>
<description>...</description>
<guid>d4c7481c-e526-11e2-9cd5-005056ba7050</guid>
<pubDate>Fri, 28 Jun 2013 00:00:00 CST</pubDate>
</item>
</channel>
</rss>
异常
HTTP状态码 | 描述 |
---|---|
404 | {name}对应的栏目不存在 |
请求
GET http://herald.seu.edu.cn/ws/classroom/unused
参数列表:
参数名 | 必选 | 默认值 | 说明 |
---|---|---|---|
day | 是 | 无 | 星期几(MON, TUE, WED, THU, FRI, SAT, SUN) |
from | 否 | 1 | 从第几节课开始 |
to | 否 | 13 | 到第几节课结束 |
返回示例
九龙湖九龙湖其它-大活322,九龙湖教一-109,九龙湖教七-303
CSV(半角逗号隔开)
请求
GET http://herald.seu.edu.cn/ws/curriculum
参数列表:
参数名 | 必选 | 默认值 | 说明 |
---|---|---|---|
cardNumber | 是 | 无 | 一卡通号 |
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<curriculum
xmlns="http://herald.seu.edu.cn/ws/curriculum" term="12-13-3" cardNumber="213100434">
<courses>
<course href="./curriculum/course/101169">
<name>IT新技术讲座</name>
<lecturer></lecturer>
<credit>0.5</credit>
<week from="1" to="8"/>
</course>
<course href="./curriculum/course/101178">
<name>通信原理(跨学科选课)</name>
<lecturer>冯熳</lecturer>
<credit>2.0</credit>
<week from="1" to="16"/>
</course>
</courses>
<timeTable>
<schedule day="TUE">
<attendance courseName="实用数据库系统实践" place="九龙湖计算机楼北楼239" strategy="NONE">
<period from="1" to="4"/>
</attendance>
<attendance courseName="通信原理(跨学科选课)" place="九龙湖教六-101" strategy="NONE">
<period from="11" to="12"/>
</attendance>
<attendance courseName="数据仓库与数据挖掘" place="九龙湖教三-305" strategy="NONE">
<period from="4" to="5"/>
</attendance>
</schedule>
<schedule day="THU">
<attendance courseName="就业导论" place="九龙湖教四-303" strategy="NONE">
<period from="9" to="10"/>
</attendance>
<attendance courseName="分布式系统" place="九龙湖教一-401" strategy="NONE">
<period from="3" to="8"/>
</attendance>
<attendance courseName="数据仓库与数据挖掘" place="九龙湖教三-305" strategy="NONE">
<period from="6" to="7"/>
</attendance>
</schedule>
</timeTable>
</curriculum>
异常
HTTP状态码 | 描述 |
---|---|
404 | 一卡通对应的课表不存在 |
请求
GET http://herald.seu.edu.cn/ws/curriculum/course/{courseId}
URL可以通过学生课表返回的XML中的/curriculum/courses/course[i]/@href
中直接取得
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<course
xmlns="http://herald.seu.edu.cn/ws/curriculum" href="./curriculum/course/101169">
<name>IT新技术讲座</name>
<lecturer></lecturer>
<credit>0.5</credit>
<week from="1" to="8"/>
<students>
<student curriculum="./curriculum?cardNumber=213102139">
<cardNumber>213102139</cardNumber>
<name>詹望</name>
<studentNumber>71110117</studentNumber>
</student>
<student curriculum="./curriculum?cardNumber=213102142">
<cardNumber>213102142</cardNumber>
<name>汪俊</name>
<studentNumber>71110422</studentNumber>
</student>
</students>
</course>
异常
HTTP状态码 | 描述 |
---|---|
404 | {courseId}对应的课程不存在 |
请求
GET http://herald.seu.edu.cn/ws/library/books
参数列表:
参数名 | 必选 | 默认值 | 说明 |
---|---|---|---|
keyword | 是 | 无 | 搜索图书的关键词 |
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<booklist
xmlns="http://herald.seu.edu.cn/ws/library">
<book href="/library/book/0000867044">
<name>Introduction to Java programming = Java语言程序设计 / 8th ed.</name>
<author>Y. Daniel Liang著.</author>
</book>
<book href="/library/book/0000867044">
<name>JavaScript动态网页设计教学做一体化教程</name>
<author>杨光, 孙丹编著</author>
</book>
</booklist>
请求
GET http://herald.seu.edu.cn/ws/library/book/{bookId}
URL可以通过搜索图书返回的XML中/booklist/book[i]/@href
中直接取得。
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<book
xmlns="http://herald.seu.edu.cn/ws/library">
<name>Oracle数据库开发与应用</name>
<author>郭克华, 王超主编</author>
<press>北京:清华大学出版社,2012</press>
<isbn>978-7-302-25814-8</isbn>
</book>
异常
HTTP状态码 | 描述 |
---|---|
404 | {bookId}对应的图书不存在 |
请求
GET http://herald.seu.edu.cn/ws/exercise/runtimes
参数列表:
参数名 | 必选 | 默认值 | 说明 |
---|---|---|---|
username | 是 | 无 | 体育系用户名 |
password | 是 | 无 | 体育系密码 |
返回示例
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<runTimeData>
<times>44</times>
<rate>0.45</rate>
</runTimeData>
异常
HTTP状态码 | 描述 |
---|---|
401 | {username}、{password}验证失败 |
500 | 体育系服务器连接失败 |
请求
GET http://herald.seu.edu.cn/ws/exercise/remain
返回示例
12
如果在寒暑假,会返回-1
。
对于上述所有的 服务, 都有可能返回500
的HTTP状态码,用来表示服务器当前处于错误的状态(配置错误、与其他服务连接错误等),即该服务处于不可用状态。