Compare commits
2 Commits
13b5e967bb
...
db0a29dd9c
Author | SHA1 | Date |
---|---|---|
|
db0a29dd9c | |
|
e2e66f8a54 |
|
@ -11,7 +11,7 @@ class Service:
|
|||
# 普通用户操作:
|
||||
# 请求一条场地使用信息(普通用户自动传入自己的用户id,管理员用户手动选择传入用户id) #redis
|
||||
# 参数:cs_fieldRecord(用户id,场地id,开始时间,结束时间) 返回:bool 是否预约成功
|
||||
def AddAppointment(self, cs_fieldRecord) -> bool:
|
||||
def add_appointment(self, cs_fieldRecord) -> bool:
|
||||
fieldRecord = FieldRecord(cs_fieldRecord)
|
||||
records = self.layer.find_record("Fid", fieldRecord.fid)
|
||||
# 如果用户已经有预约了,就不能再提交预约
|
||||
|
@ -28,7 +28,7 @@ class Service:
|
|||
|
||||
# 提前结束场地的使用 正在使用时提前结束 #finished
|
||||
# 参数:cs_user //cs_fieldRecord 返回:bool 是否结束成功
|
||||
def EndAppointment(self, cs_user) -> bool:
|
||||
def end_appointment(self, cs_user) -> bool:
|
||||
user = User(cs_user)
|
||||
records = self.layer.find_record("Uid", user.id)
|
||||
if len(records) == 0:
|
||||
|
@ -52,7 +52,7 @@ class Service:
|
|||
|
||||
# 取消预约
|
||||
# 参数:cs_user //cs_fieldRecord(用户id,场地id,开始时间,结束时间) 返回:bool 是否取消成功
|
||||
def CancelAppointment(self, cs_user) -> bool:
|
||||
def cancel_appointment(self, cs_user) -> bool:
|
||||
user = User(cs_user)
|
||||
records = self.layer.find_record("Uid", user.id)
|
||||
if len(records) == 0:
|
||||
|
@ -69,7 +69,7 @@ class Service:
|
|||
|
||||
# 延长场地的使用时间 #redis
|
||||
# 参数:cs_fieldRecord(用户id,场地id(null),开始时间(null),结束时间) 返回:bool 是否延长成功
|
||||
def ExtendAppointment(self, cs_fieldRecord) -> bool:
|
||||
def extend_appointment(self, cs_fieldRecord) -> bool:
|
||||
field_Record = FieldRecord(cs_fieldRecord)
|
||||
records = self.layer.find_record("Uid", field_Record.uid)
|
||||
if len(records) == 0:
|
||||
|
@ -89,7 +89,7 @@ class Service:
|
|||
|
||||
# 查询场地占用
|
||||
# 参数:cs_fieldRecord(用户id(null),场地id,开始时间(null),结束时间(null)) 返回:list_time [(start_time,end_time),(...),(...),...]
|
||||
def QueryFieldUsage(self, cs_fieldRecord) -> []:
|
||||
def query_fieldUsage(self, cs_fieldRecord) -> []:
|
||||
fid = FieldRecord(cs_fieldRecord).fid
|
||||
records = self.layer.find_record("Fid", fid)
|
||||
list_time: List[(Time, Time)] = []
|
||||
|
@ -110,7 +110,7 @@ class Service:
|
|||
|
||||
# 查询用户的预约记录
|
||||
# 参数:cs_user(id) 返回:array_cs_fieldRecord
|
||||
def QueryAppointmentRecord(self, cs_user) -> []:
|
||||
def query_appointment_record(self, cs_user) -> []:
|
||||
user = User(cs_user)
|
||||
cs_fieldRecords = []
|
||||
fieldRecords = self.layer.find_record("Uid", user.id)
|
||||
|
@ -128,7 +128,7 @@ class Service:
|
|||
|
||||
# 添加一个场地
|
||||
# 参数:cs_field(id,name,position,open_time,type) 返回:bool 是否添加成功
|
||||
def AddField(self, cs_field) -> bool:
|
||||
def add_field(self, cs_field) -> bool:
|
||||
field = Field(cs_field)
|
||||
fields = self.layer.find_field("Name", field.name)
|
||||
if len(fields) > 0:
|
||||
|
@ -138,7 +138,7 @@ class Service:
|
|||
|
||||
# 删除一个场地
|
||||
# 参数:cs_field(id,name,position(null),open_time(null),type(null)) 返回:bool 是否删除成功
|
||||
def RemoveField(self, cs_field) -> bool:
|
||||
def remove_field(self, cs_field) -> bool:
|
||||
field = Field(cs_field)
|
||||
fields = self.layer.find_field("Id", field.id)
|
||||
if len(fields) == 0:
|
||||
|
|
Loading…
Reference in New Issue