本文整理匯總了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)