Esempio n. 1
0
    def resultErrorDataWrapperToJsonString(code="0", message="", data={}):

        retDic = {}
        if type(code) != type(""):
            code = str(code)
        if code in G7ResultDic.keys():
            retDic = {"ResultCode": str(code), "ResultMessage": G7ResultDic.get(code), "Data": data}
        else:
            retDic = {"ResultCode": str(code), "ResultMessage": message, "Data": data}
        return json.dumps(retDic)
    def resultErrorDataWrapperToJson(code, data={}):

        retDic = {}
        if type(code) == type(""):
            try:
                code = int(code)
            except:
                return retDic
        if code in list(G7ResultDic.keys()):
            retDic = {
                "code":code,
                "message":G7ResultDic[code],
                "data":data
            }

        return retDic
    def resultErrorDataWrapperToJsonString(code, data={}):

        retDic = {}
        if type(code) == type(""):
            try:
                code = int(code)
            except:
                return json.dumps(retDic)

        if code in G7ResultDic.keys():
            retDic = {
                "code":code,
                "message":G7ResultDic[code],
                "data":data
            }

        return json.dumps(retDic)