本文整理汇总了Python中user.userentitymanager.UserEntityManager.findUserEntityByDeviceCode方法的典型用法代码示例。如果您正苦于以下问题:Python UserEntityManager.findUserEntityByDeviceCode方法的具体用法?Python UserEntityManager.findUserEntityByDeviceCode怎么用?Python UserEntityManager.findUserEntityByDeviceCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user.userentitymanager.UserEntityManager
的用法示例。
在下文中一共展示了UserEntityManager.findUserEntityByDeviceCode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getFormerSysTopics
# 需要导入模块: from user.userentitymanager import UserEntityManager [as 别名]
# 或者: from user.userentitymanager.UserEntityManager import findUserEntityByDeviceCode [as 别名]
def getFormerSysTopics(self, deviceCode, tagId, oldestTopicDt, targetNum, imgFormat, _request):
"""
:type deviceCode: str
:type tagId: str
:type oldestTopicDt: datetime.datetime
:type targetNum: int
:type _request: message.gate.ipostoper.IPostOper_Getformersystopics_Request
"""
tag = TopicTagConfigManager.getTagNameByTagId(tagId)
sysTopicList = SysTopicManager.getOlderSysTopicInDateOrder(tag, oldestTopicDt, targetNum, imgFormat)
_request.response(sysTopicList)
# loggings
userEntity = UserEntityManager.findUserEntityByDeviceCode(deviceCode)
if userEntity:
logUserInfo = userEntity.getLogUserInfo()
else:
logUserInfo = SLogUserInfo()
logUserInfo.deviceCode = deviceCode
tags = SeqString()
tags.append(tag)
DbLogHepler.logRefreshSysTopic(logUserInfo, tags)
示例2: viewUserPost
# 需要导入模块: from user.userentitymanager import UserEntityManager [as 别名]
# 或者: from user.userentitymanager.UserEntityManager import findUserEntityByDeviceCode [as 别名]
def viewUserPost(self, deviceCode, postId, _request):
"""
:type deviceCode: str
:type postId: str
:type _request: message.gate.ipostoper.IPostOper_Viewuserpost_Request
"""
wUserPost = PostManager.findPostByPostId(postId)
if not wUserPost:
ErrorCodeManager.raiseError("ErrorGate_noSuchPost")
wUserPost.getTUserPost().viewTimes += 1
DbSaver.saveTable(wUserPost.getTUserPost())
_request.response(wUserPost.getTUserPost().viewTimes)
# log
userEntity = UserEntityManager.findUserEntityByDeviceCode(deviceCode)
if userEntity:
DbLogHepler.logUserPostOper(userEntity.getLogUserInfo(), postId, ELogPostOperType.View)
else:
userInfo = SLogUserInfo()
userInfo.deviceCode = deviceCode
DbLogHepler.logUserPostOper(userInfo, postId, ELogPostOperType.View)
示例3: getLatestUserPosts
# 需要导入模块: from user.userentitymanager import UserEntityManager [as 别名]
# 或者: from user.userentitymanager.UserEntityManager import findUserEntityByDeviceCode [as 别名]
def getLatestUserPosts(self, deviceCode, tag, latestPostDt, targetNum, imgFormat, _request):
"""
:type deviceCode: str
:type tag: str
:type latestPostDt: datetime.datetime
:type targetNum: int
:type imgFormat: str
:type _request: message.gate.ipostoper.IPostOper_Getlatestuserposts_Request
"""
postList = PostManager.getNewestPosts(tag, latestPostDt, targetNum, imgFormat)
_request.response(postList)
# loggings
userEntity = UserEntityManager.findUserEntityByDeviceCode(deviceCode)
if userEntity:
logUserInfo = userEntity.getLogUserInfo()
else:
logUserInfo = SLogUserInfo()
logUserInfo.deviceCode = deviceCode
tags = SeqString()
tags.append(tag)
DbLogHepler.logRefreshUserPost(logUserInfo, tags)
示例4: viewSysTopic
# 需要导入模块: from user.userentitymanager import UserEntityManager [as 别名]
# 或者: from user.userentitymanager.UserEntityManager import findUserEntityByDeviceCode [as 别名]
def viewSysTopic(self, deviceCode, sysTopicId, _request):
"""
:type deviceCode: str
:type sysTopicId: str
:type _request: message.gate.ipostoper.IPostOper_Viewsystopic_Request
"""
wSysTopic = SysTopicManager.getSysTopicByTopicId(sysTopicId)
if not wSysTopic:
ErrorCodeManager.raiseError("ErrorGate_noSuchSysTopic")
wSysTopic.getTSysTopic().viewTimes += 1
_request.response(wSysTopic.getTSysTopic().viewTimes)
DbSaver.saveTable(wSysTopic.getTSysTopic())
# logging
userEntity = UserEntityManager.findUserEntityByDeviceCode(deviceCode)
if userEntity:
DbLogHepler.logSysTopicOper(userEntity.getLogUserInfo(), wSysTopic.getTopicId(), ELogPostOperType.View)
else:
logUserInfo = SLogUserInfo()
logUserInfo.deviceCode = deviceCode
DbLogHepler.logSysTopicOper(logUserInfo, wSysTopic.getTopicId(), ELogPostOperType.View)