当前位置: 首页>>代码示例>>Python>>正文


Python UserEntityManager.findUserEntityByDeviceCode方法代码示例

本文整理汇总了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)
开发者ID:bropony,项目名称:gamit,代码行数:27,代码来源:ipostoperimpl.py

示例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)
开发者ID:bropony,项目名称:gamit,代码行数:25,代码来源:ipostoperimpl.py

示例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)
开发者ID:bropony,项目名称:gamit,代码行数:25,代码来源:ipostoperimpl.py

示例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)
开发者ID:bropony,项目名称:gamit,代码行数:26,代码来源:ipostoperimpl.py


注:本文中的user.userentitymanager.UserEntityManager.findUserEntityByDeviceCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。