Django API 自定义状态码

class BaseResponse(object):

    def __init__(self):
        self.code = 1000
        self.data = None
        self.error = None

    @property
    def dict(self):
        return self.__dict__


class TokenResponse(BaseResponse):
    def __init__(self):
        super(BaseResponse).__init__()
        self.code = 1000
        self.token = None

 

class PricePolicyIncalid(Exception):
    def __init__(self, msg):
        self.msg = msg

Django API 自定义状态码

上一篇:dll的两种加载方式(pend)+ delayload


下一篇:Spring加载properties文件的两种方式