コード例 #1
0
def customer_info(customer_id):
    """获取客户信息"""
    try:
        ret = get_customer_info(customer_id)
        return Response.success_with_data('data', ret)
    except Exception as e:
        return Response.error(str(e))
コード例 #2
0
def login():
    try:
        token = salesman_login()
        if token:
            return Response.success_with_data('data', token)
    except Exception as e:
        return Response.error(str(e))
コード例 #3
0
def get_customer_list(salesman_id):
    """获取客户列表"""
    try:
        ret = get_customer_basic_list(salesman_id)
        return Response.success_with_data('data', ret)
    except Exception as e:
        return Response.error(str(e))
コード例 #4
0
def customer_add():
    """客户录入"""
    try:
        if customer_data_save():
            return Response.success()
    except Exception as e:
        return Response.error(str(e))
コード例 #5
0
def customer_record_add(customer_id):
    """跟进客户小记"""
    try:
        if customer_record_save(customer_id):
            return Response.success()
    except Exception as e:
        return Response.error(str(e))
コード例 #6
0
def customer_update(customer_id):
    """修改客户信息"""
    try:
        if customer_data_update(customer_id):
            return Response.success()
    except Exception as e:
        return Response.error(str(e))
コード例 #7
0
ファイル: commons.py プロジェクト: BXBaskershu/miniORM_Flask
 def wrapper(*args, **kwargs):
     salesman_id = session.get("salesman_id")
     if salesman_id is None:
         return Response.not_login()
     else:
         g.salesman_id = salesman_id
         return func(*args, **kwargs)
コード例 #8
0
def register():
    try:
        if salesman_register():
            return Response.success()
    except Exception as e:
        return Response.error(str(e))
コード例 #9
0
def before_request():
    try:
        Auth.identify(Auth, request)
    except Exception as e:
        return Response.error(str(e))