當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。