示例#1
0
 def freeBook(self, start_time, end_time, seat_id, date, multiply=True):
     # 预约座位
     if multiply:
         start = float(start_time) * 60
         end = float(end_time) * 60
     post_data = {
         'startTime': str(int(start)),
         'endTime': str(int(end)),
         'seat': seat_id,
         'date': date
     }
     r = self.requests('POST', self.api["freeBook"], data=post_data)
     return parse_json(r.text)
示例#2
0
 def reservations(self):
     # 查看预约
     r = self.requests('GET', self.api['reservations'])
     return parse_json(r.text)
示例#3
0
 def getToken(self):
     # 获取token
     r = self.requests_call("GET",
                            self.api['token'].format(self.ac, self.pw))
     return parse_json(r.text)
示例#4
0
 def cancelRes(self, res_id):
     r = self.requests('GET', self.api['cancelRes'].format(res_id))
     return parse_json(r.text)
示例#5
0
 def history(self, page=1, count=10):
     # 获取预约历史
     # 1是页数从1开始 10为每页显示个数
     url = self.api['history'].format(page, count)
     r = self.requests('GET', url)
     return parse_json(r.text)
示例#6
0
 def checkIn(self):
     # 签到
     r = self.requests('GET', self.api['checkIn'])
     return parse_json(r.text)
示例#7
0
 def layoutByDate(self, room_id, date):
     url = self.api['layoutByDate'].format(room_id, date)
     r = self.requests('GET', url)
     return parse_json(r.text)
示例#8
0
 def seatEndTime(self, seat_id, date, start_time):
     # 结束时间
     url = self.api['seatEndTime'].format(seat_id, date, start_time)
     r = self.requests('GET', url)
     return parse_json(r.text)
示例#9
0
 def seatStartTime(self, seat_id, date):
     # 可开始时间
     url = self.api['seatStartTime'].format(seat_id, date)
     r = self.requests('GET', url)
     return parse_json(r.text)
示例#10
0
 def roomStats(self, building_id):
     # 获取楼层信息
     r = self.requests("GET", self.api['roomStats'].format(building_id))
     return parse_json(r.text)
示例#11
0
 def filters(self):
     # 图书馆信息
     r = self.requests('GET', self.api['filters'])
     return parse_json(r.text)
示例#12
0
 def user(self):
     # 用户信息
     r = self.requests('GET', self.api['user'])
     return parse_json(r.text)