• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ErrorCodeManager.ErrorCodeManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中staticdata.manager.ErrorCodeManager.ErrorCodeManager的典型用法代码示例。如果您正苦于以下问题:Python ErrorCodeManager类的具体用法?Python ErrorCodeManager怎么用?Python ErrorCodeManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ErrorCodeManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: getAllMyFocuses

    def getAllMyFocuses(self, sessionKey, _request):
        """
        :type sessionKey: str
        :type _request: message.gate.ipostoper.IPostOper_Getallmyfocuses_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        tb = MongoDatabase.findTableByMessageType(TUserFan)
        if not tb:
            Logger.log("Table {} not found".format(TUserFan.__name__))
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        tFocusList = tb.findManyWithQuey({TUserFan.fn_fanUserId: userEntity.getUserId()})

        sFocusList = SeqMyFocus()

        for tFan in tFocusList:
            userEntity = UserEntityManager.findUserEntityByUserId(tFan.myUserId)
            if not userEntity:
                Logger.log("getAllMyFocuses",
                           "UserNotFound:", tFan.myUserId)
                continue

            sFocus = SMyFocus()
            sFocus.userInfo = userEntity.getUserBriefInfo()
            sFocus.operDt = tFan.createDt

            sFocusList.append(sFocus)

        _request.response(sFocusList)
开发者ID:bropony,项目名称:gamit,代码行数:32,代码来源:ipostoperimpl.py


示例2: updateAdress

    def updateAdress(self, sessionKey, addressInfo, _request):
        """
        :type sessionKey: str
        :type addressInfo: message.common.publicmsg.SAddress
        :type _request: message.gate.iuserinfo.IUserInfo_Updateadress_Request
        """

        if not addressInfo.recipientName:
            ErrorCodeManager.raiseError("ErrorGate_addressRecipentNameEmpty")

        if not addressInfo.recipientPhoneNum:
            ErrorCodeManager.raiseError("ErrorGate_addressRecipentPhoneNumEmpty")

        if not addressInfo.city:
            ErrorCodeManager.raiseError("ErrorGate_addressCityEmpty")

        if not addressInfo.details:
            ErrorCodeManager.raiseError("ErrorGate_addressDetailsEmpty")

        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        addressIndex = userEntity.updateUserAddress(addressInfo)
        DbSaver.saveTable(userEntity.getTUserAddress())

        _request.response(addressIndex)
开发者ID:bropony,项目名称:gamit,代码行数:27,代码来源:iuserinfoimpl.py


示例3: login

    def login(self, loginInfo, _request):
        """
        :type loginInfo: message.gate.gatemsg.SLogin
        :type _request: message.gate.ilogin.ILogin_Login_Request
        """

        Logger.log("ILoginImpl.login: ", loginInfo.account)

        userEntity = UserEntityManager.findUserEntityByAccount(loginInfo.account)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorLogin_InvalidLoginInfo")

        if not userEntity.isPasswordValid(loginInfo.password):
            ErrorCodeManager.raiseError("ErrorLogin_InvalidLoginInfo")

        if not userEntity.isDataLoaded():
            userDataView = UserDbHelper.loadUserDataView(userEntity.getUserId())
            userEntity.updateUserData(userDataView)

        sessionKey = MyUuid.getUuid()
        userEntity.updateDeviceCodeAndSessionKey(loginInfo.deviceCode, sessionKey)
        UserEntityManager.onUserLogin(userEntity, _request.connId, loginInfo.deviceCode)

        loginReturn = userEntity.getLoginReturn()
        _request.response(loginReturn)

        DbSaver.saveTable(userEntity.getTUserSettings())
        DbSaver.saveTable(userEntity.getTUserBasic())
开发者ID:bropony,项目名称:gamit,代码行数:28,代码来源:iloginimpl.py


示例4: getFansByPageIndex

    def getFansByPageIndex(self, sessionKey, pageIndex, _request):
        """
        :type sessionKey: str
        :type pageIndex: int
        :type _request: message.gate.ipostoper.IPostOper_Getfansbypageindex_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        numPerPage = 100
        tb = MongoDatabase.findTableByMessageType(TUserFan)
        if not tb:
            Logger.log("Table {} not found".format(TUserFan.__name__))
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        skips = numPerPage * pageIndex
        tFanList = tb.findManyWithQuey({TUserFan.fn_myUserId: userEntity.getUserId()},
                                  limit=numPerPage, skip=skips, sort=MongoDatabase.SortByIdDesc)

        sFanList = SeqMyFan()
        for tFan in tFanList:
            userEntity = UserEntityManager.findUserEntityByUserId(tFan.fanUserId)
            if not userEntity:
                Logger.log("getFansByPageIndex",
                           "UserNotFound:", tFan.fanUserId)
                continue

            sFan = SMyFan()
            sFan.fanInfo = userEntity.getUserBriefInfo()
            sFan.operDt = tFan.createDt

            sFanList.append(sFan)

        _request.response(sFanList)
开发者ID:bropony,项目名称:gamit,代码行数:35,代码来源:ipostoperimpl.py


示例5: getPostCommentsHints

    def getPostCommentsHints(self, sessionKey, _request):
        """
        :type sessionKey: str
        :type _request: message.gate.ipostoper.IPostOper_Getpostcommentshints_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        hints = userEntity.getAllCommentHints()
        _request.response(hints)
开发者ID:bropony,项目名称:gamit,代码行数:11,代码来源:ipostoperimpl.py


示例6: getAddressList

    def getAddressList(self, sessionKey, _request):
        """
        :type sessionKey: str
        :type _request: message.gate.iuserinfo.IUserInfo_Getaddresslist_Request
        """

        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        _request.response(userEntity.getTUserAddress().addressList)
开发者ID:bropony,项目名称:gamit,代码行数:11,代码来源:iuserinfoimpl.py


示例7: getUserPostByPostId

    def getUserPostByPostId(self, deviceCode, postId, imgFormat, _request):
        """
        :type deviceCode: str
        :type postId: str
        :type _request: message.gate.ipostoper.IPostOper_Getuserpostbypostid_Request
        """
        wPost = PostManager.findPostByPostId(postId)
        if not wPost:
            ErrorCodeManager.raiseError("ErrorGate_noSuchPost")

        _request.response(wPost.getClientInfo(imgFormat))
开发者ID:bropony,项目名称:gamit,代码行数:11,代码来源:ipostoperimpl.py


示例8: getNewFanList

    def getNewFanList(self, sessionKey, _request):
        """
        :type sessionKey: str
        :type _request: message.gate.ipostoper.IPostOper_Getnewfanlist_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        res = userEntity.getNewFans()
        _request.response(res)
开发者ID:bropony,项目名称:gamit,代码行数:11,代码来源:ipostoperimpl.py


示例9: getMyDetails

    def getMyDetails(self, sessionKey, _request):
        """
        :type sessionKey: str
        :type _request: message.gate.iuserinfo.IUserInfo_Getmydetails_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        details = userEntity.getDetails()
        _request.response(details)
开发者ID:bropony,项目名称:gamit,代码行数:11,代码来源:iuserinfoimpl.py


示例10: getSysTopicByTopicId

    def getSysTopicByTopicId(self, deviceCode, topicId, imgFormat, _request):
        """
        :type deviceCode: str
        :type topicId: str
        :type imgFormat: str
        :type _request: message.gate.ipostoper.IPostOper_Getsystopicbytopicid_Request
        """
        sysTopic = SysTopicManager.getSysTopicByTopicId(topicId)
        if not sysTopic:
            ErrorCodeManager.raiseError("ErrorGate_noSuchSysTopic")

        _request.response(sysTopic.getClientInfo(imgFormat))
开发者ID:bropony,项目名称:gamit,代码行数:12,代码来源:ipostoperimpl.py


示例11: saveUserImages

    def saveUserImages(self, userImages, _request):
        """
        :type userImages: list[message.db.mongodb.usertables.TUserImage]
        :type _request: message.db.itablesaver.ITableSaver_Saveuserimages_Request
        """
        tb = MongoDatabase.findTableByMessageType(TUserImage)
        if not tb:
            Logger.log("Table {} not found".format(TUserImage.__name__))
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        tb.save(userImages)
        _request.response()
开发者ID:bropony,项目名称:gamit,代码行数:12,代码来源:itablesaverimpl.py


示例12: loadAllUserBasics

    def loadAllUserBasics(cls):
        """
        :rtype: list[TUserBasic]
        """

        res = []
        tb = MongoDatabase.findTableByMessageType(TUserBasic)
        if not tb:
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        res = tb.findManyWithQuey()

        return res
开发者ID:bropony,项目名称:gamit,代码行数:13,代码来源:userdb.py


示例13: removeFamilyMembers

    def removeFamilyMembers(cls, userId, indexes):
        """
        :type userId: str
        :type indexes: list[int]
        """

        tb = MongoDatabase.findTableByMessageType(TFamilyMember)

        if not tb:
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        for index in indexes:
            query = {TFamilyMember.fn_userId: userId, TFamilyMember.fn_index: index}
            tb.delete(query, True)
开发者ID:bropony,项目名称:gamit,代码行数:14,代码来源:userdb.py


示例14: unfollowAUser

    def unfollowAUser(self, sessionKey, userId, _request):
        """
        :type sessionKey: str
        :type userId: str
        :type _request: message.gate.ipostoper.IPostOper_Unfollowauser_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        hisEntity = UserEntityManager.findUserEntityByUserId(userId)
        if not hisEntity:
            ErrorCodeManager.raiseError("ErrorGate_noSuchUser")

        tb = MongoDatabase.findTableByMessageType(TUserFan)
        if not tb:
            Logger.log("Table {} not found".format(TUserFan.__name__))
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        fanFound = tb.findOneWithQuery({TUserFan.fn_fanUserId: userEntity.getUserId(), TUserFan.fn_myUserId: userId})
        if not fanFound:
            ErrorCodeManager.raiseError("ErrorGate_didNotFollowThisUser")

        tb.delete({TUserFan.fn_recordId: fanFound.recordId}, delete_one=True)

        _request.response()

        userEntity.getTUserProperty().focusNum -= 1
        hisEntity.getTUserProperty().fanNum -= 1

        DbSaver.saveTable(userEntity.getTUserProperty())
        DbSaver.saveTable(hisEntity.getTUserProperty())
开发者ID:bropony,项目名称:gamit,代码行数:32,代码来源:ipostoperimpl.py


示例15: userImagesDidUpload

    def userImagesDidUpload(self, imageKeys, _request):
        """
        :type imageKeys: list[str]
        :type _request: message.db.itablesaver.ITableSaver_Userimagesdidupload_Request
        """
        tb = MongoDatabase.findTableByMessageType(TUserImage)
        if not tb:
            Logger.log("Table {} not found".format(TUserImage.__name__))
            ErrorCodeManager.raiseError("ErrorDb_TableNotFound")

        for imgKey in imageKeys:
            tb.updateWithQuery({tb.key: imgKey}, {"$set":{"isUploaded": True}}, upsert=False, update_one=True)

        _request.response()
开发者ID:bropony,项目名称:gamit,代码行数:14,代码来源:itablesaverimpl.py


示例16: replySysTopicComment

    def replySysTopicComment(self, sessionKey, topicId, dstCommentId, mentionedUserId, comments, _request):
        """
        :type sessionKey: str
        :type topicId: str
        :type dstCommentId: str
        :type mentionedUserId: str
        :type comments: str
        :type _request: message.gate.ipostoper.IPostOper_Replysystopiccomment_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        wSysTopic = SysTopicManager.getSysTopicByTopicId(topicId)
        if not wSysTopic:
            ErrorCodeManager.raiseError("ErrorGate_noSuchSysTopic")

        mentionedEntity = UserEntityManager.findUserEntityByUserId(mentionedUserId)
        if not mentionedEntity:
            ErrorCodeManager.raiseError("ErrorGate_mentionedUserNotExisted")

        if not wSysTopic.hasComment(dstCommentId):
            ErrorCodeManager.raiseError("ErrorGate_dstCommentNotExisted")

        commentId = SysTopicHelper.addNewCommentToSysTopic(
            userEntity, wSysTopic, EInteractiveType.Comment, comments, [mentionedUserId])

        _request.response(commentId)
开发者ID:bropony,项目名称:gamit,代码行数:28,代码来源:ipostoperimpl.py


示例17: replyUserPostComment

    def replyUserPostComment(self, sessionKey, postId, commentId, mentionedUserId, comments, _request):
        """
        :type sessionKey: str
        :type postId: str
        :type commentId: str
        :type mentionedUserId: str
        :type comments: str
        :type _request: message.gate.ipostoper.IPostOper_Replyuserpostcomment_Request
        """
        userEntity = UserEntityManager.findUserEntityBySessionKey(sessionKey)
        if not userEntity:
            ErrorCodeManager.raiseError("ErrorGate_notLoggedInYet")

        wuPost = PostManager.findPostByPostId(postId)
        if not wuPost:
            ErrorCodeManager.raiseError("ErrorGate_noSuchPost")

        mentionedEntity = UserEntityManager.findUserEntityByUserId(mentionedUserId)
        if not mentionedEntity:
            ErrorCodeManager.raiseError("ErrorGate_mentionedUserNotExisted")

        if not wuPost.hasComment(commentId):
            ErrorCodeManager.raiseError("ErrorGate_dstCommentNotExisted")

        commentId = PostHelper.addNewCommentToUserPost(userEntity,
                        wuPost, EInteractiveType.Comment, comments, [mentionedUserId], True)

        _request.response(commentId)
开发者ID:bropony,项目名称:gamit,代码行数:28,代码来源:ipostoperimpl.py


示例18: getUserPostComments

    def getUserPostComments(self, deviceCode, postId, latestCommentDt, targetNum, _request):
        """
        :type deviceCode: str
        :type topicId: str
        :type latestCommentDt: datetime.datetime
        :type targetNum: int
        :type _request: message.gate.ipostoper.IPostOper_Getuserpostcomments_Request
        """
        wPost = PostManager.findPostByPostId(postId)

        if not wPost:
            ErrorCodeManager.raiseError("ErrorGate_noSuchPost")

        commentList = wPost.getComments(latestCommentDt, targetNum)
        _request.response(commentList)
开发者ID:bropony,项目名称:gamit,代码行数:15,代码来源:ipostoperimpl.py


示例19: loadUserBasic

    def loadUserBasic(self, createdDtLimit, targetNum, _request):
        Logger.log("Loading userbasic request...")

        userBasicTable = MongoDatabase.findTableByMessageType(TUserBasic)

        if not userBasicTable:
            ErrorCodeManager.raiseError("")

        query = {"createDt": {"$gt": createdDtLimit}}
        res = userBasicTable.findManyWithQuey(query, targetNum)

        allLoaded = len(res) < targetNum
        tables = SeqTUserBasic(res)

        _request.response(allLoaded, tables)
开发者ID:bropony,项目名称:gamit,代码行数:15,代码来源:iuserdbimpl.py


示例20: getSysTopicComments

    def getSysTopicComments(self, deviceCode, topicId, interactiveType, latestCommentDt, targetNum, _request):
        """
        :type deviceCode: str
        :type topicId: str
        :type interactiveType: int
        :type latestCommentDt: datetime.datetime
        :type targetNum: int
        :type _request: message.gate.ipostoper.IPostOper_Getsystopiccomments_Request
        """

        sysTopic = SysTopicManager.getSysTopicByTopicId(topicId)
        if not sysTopic:
            ErrorCodeManager.raiseError("ErrorGate_noSuchSysTopic")

        comments = sysTopic.getComments(latestCommentDt, targetNum, interactiveType)
        _request.response(comments)
开发者ID:bropony,项目名称:gamit,代码行数:16,代码来源:ipostoperimpl.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python staticfiles_storage.url函数代码示例发布时间:2022-05-27
下一篇:
Python loader.yaml_loader函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap