Пример #1
0
def upload(request):
    '''上传图片
    '''
    try:
        res = BannerService().upload(request)
    except Exception, e:
        log.error('method upload error, error is %s' % e, exc_info=True)
        res = {'statusCode': -1, 'msg': str(e)}
Пример #2
0
def publish(request):
    '''发布banner
    '''
    try:
        res = BannerService().publish_banner()
    except Exception, e:
        log.error('method publish error, error is %s' % e, exc_info=True)
        res = {'statusCode': -1, 'msg': str(e)}
Пример #3
0
def save(request):
    '''添加或者更新banner
    '''
    try:
        res = BannerService().save_or_update(request)
    except Exception, e:
        log.error('method save error, error is %s' % e, exc_info=True)
        res = {'statusCode': -1}
Пример #4
0
def edit(request):
    '''进入编辑界面
    '''
    try:
        res = BannerService().get_banner(request)
    except Exception, e:
        log.error('method edit error, error is %s' % e, exc_info=True)
        res = {'statusCode': -1}
Пример #5
0
def preview_list(request):
    '''获取预览的数据
    '''
    try:
        res = BannerService().get_preview_list()
    except Exception, e:
        log.error('method preview_list error, error is %s' % e, exc_info=True)
        res = {'statusCode': -1, 'msg': str(e)}
Пример #6
0
def list(request):
    '''显示banner图列表
    '''
    try:
        res = BannerService().pack_banner(request)
    except Exception, e:
        log.error('method list error, error is %s' % e, exc_info=True)
        res = DICT_MAP['COMMON_LIST_JSON']
        res['statusCode'] = -1
Пример #7
0
def init_banner_data(request):
    '''初始化数据,该功能上线后执行一次
    '''
    try:
        res = BannerService().init_banner_data()
    except Exception, e:
        log.error('method init_banner_data error, error is %s' % e,
                  exc_info=True)
        res = {'statusCode': -1, 'msg': str(e)}