def deleteUser(self, userid): log = Logs() log.user_id = self.__user_id log.log_type = 'DELETEUSER' log.log_content = '用户 ' + self.__user_id + ' 删除了用户 ' + userid log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def addUser(self, userid): log = Logs() log.user_id = self.__user_id log.log_type = 'ADDUSER' log.log_content = '用户 ' + self.__user_id + ' 新增用户 ' + userid log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def loginLog(self): log = Logs() log.user_id = self.__user_id log.log_type = 'LOGIN' log.log_content = '用户 ' + self.__user_id + ' 登录系统成功' log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def updateUser(self, userid): log = Logs() log.user_id = self.__user_id log.log_type = 'UPDATEUSER' log.log_content = '用户 ' + self.__user_id + ' 更新用户 ' + userid + ' 信息' log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def info(self): log = Logs() log.user_id = self.__user_id log.device_id = self.__device_id log.log_type = self.__log_type log.log_content = self.__log_content log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def returnDevice(self, lenderid): log = Logs() log.user_id = self.__user_id log.device_id = self.__device_id log.log_type = 'RETURNDEVICE' log.log_content = '用户 ' + lenderid + ' 归还设备 ' + self.__device_id + ' 操作人 ' + self.__user_id log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def deleteDevice(self): log = Logs() log.user_id = self.__user_id log.device_id = self.__device_id log.log_type = 'DELETEDEVICE' log.log_content = '用户 ' + self.__user_id + ' 删除了设备 ' + self.__device_id log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def updateDevice(self): log = Logs() log.user_id = self.__user_id log.device_id = self.__device_id log.log_type = 'UPDATEDEVICE' log.log_content = '用户 ' + self.__user_id + ' 更新了设备 ' + self.__device_id + ' 信息' log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()
def addDevice(self): log = Logs() log.user_id = self.__user_id log.device_id = self.__device_id log.log_type = 'ADDDEVICE' log.log_content = '用户 ' + self.__user_id + ' 新增设备 ' + self.__device_id log.log_time = datetime.utcnow() db.session.add(log) db.session.commit()