def get(self, *args, **kwargs): ret = {"status": False, "summary": "", "data": []} try: merchant_id = 6 product_id = self.get_argument("product_id", None) if not product_id: raise Exception("请输入商品ID") service = ProductService(ProductRepository()) series = service.get_upv(merchant_id, product_id) ret["data"] = series ret["status"] = True except Exception as e: ret["summary"] = str(e) self.write(json.dumps(ret))
def get(self, *args, **kwargs): ret = {'status': False, 'summary': '', 'data': []} try: merchant_id = 14 product_id = self.get_argument('product_id', None) if not product_id: raise Exception('请输入产品ID') service = ProductService(ProductRepository()) series = service.get_upv(merchant_id, product_id) ret['data'] = series ret['status'] = True except Exception as e: ret['summary'] = str(e) self.write(json.dumps(ret))