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)}
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)}
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}
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}
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)}
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
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)}