# 返回正确信息

def res_success(json_res, type, msg):
    resObj = {}
    resObj["code"] = 200
    resObj["data"] = json_res
    if type:
        resObj["type"] = type
    if msg:
        resObj["msg"] = msg
    return resObj

# 返回错误信息


def res_error(json_res, type, msg):
    resObj = {}
    resObj["code"] = 500
    resObj["data"] = json_res
    if type:
        resObj["type"] = type
    if msg:
        resObj["msg"] = msg
    return resObj

# #返回问答信息
# def jsonResToDict_questions(json_res):
#     resObj = {}
#     resObj["data"] = json_res
#     resObj["code"] = 200
#     resObj["type"] = "answer"
#     return resObj

# # 返回错误信息
# def jsonResToDict_wrong(json_res):
#     resObj = {}
#     resObj["data"] = json_res
#     resObj["code"] = 500
#     resObj["type"] = "selectLand"
#     return resObj
