Advertisement
androlizer

Untitled

Nov 14th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 16.65 KB | None | 0 0
  1. REQUEST
  2.  
  3. {"comments":[{"type":"first","comment":"@blivawear.com"}],"items":[{"post_id":3130046}]}
  4. https://api.xshopper.com/v1/post/3234884
  5. 1908 : L3rVeDcMglFsRuViKjjTWlDr-mZlxpV0 : application/json : A 1.0 31
  6.  
  7. RESPONSE
  8.  
  9. {"message":null,"data":{"now":1510642135,"next":"3234883","posts":[{"post_id":3234884,"user_id":1908,"sku":null,"created_at":1510641848,"updated_at":1510641848,"counts":{"like":0,"comment":0,"wish":0,"shop":0,"liked":0},"user":{"username":"nitin8334","user_id":1908,"url":null,"profile_picture":"https:\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-001\/1908_profile_1474454263642.png","followed":null},"comments":[{"comment":{"id":1488508,"text":"@blivawear.com","created_at":1510642136,"type":"first","user":{"username":"nitin8334","user_id":1908,"url":null,"profile_picture":"https:\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-001\/1908_profile_1474454263642.png","followed":null}}}],"images":[{"type":"image","image_id":0,"original":{"url":"http:\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/847_profile_531295517.png","size":{"height":120,"width":120},"low_resolution":null,"thumbnail":null,"standard_resolution":null}}],"items":[{"item":{"link_id":3077,"post_id":3130046,"sku":"3HandsTank top","plink":"https:\/\/www.blivawear.com\/product\/3hands-tanktop\/","url":"https:\/\/www.xshopper.com\/collection\/p_1908_3234884","price":{"show_price":75.9,"show_currency":"CAD","subtitle":"","attribs":null,"flags":[]},"comments":[{"comment":{"id":1485888,"text":"","created_at":1510623276,"type":"description","user":{"username":"xshopper","user_id":847,"url":"http:\/\/index.hu","profile_picture":"https:\/\/i.xshopper.com\/847_profile_531295517.png","followed":true}}}],"counts":{"like":2,"comment":0,"wish":0,"shop":0,"liked":0},"images":[{"type":"image","image_id":6203645,"attribs":null,"original":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/orig_313004620171114013435_3handssidewomen.jpg","size":{"width":1000,"height":1653}},"low_resolution":null,"thumbnail":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/thumb_313004620171114013435_3handssidewomen.jpg","size":{"width":540,"height":892}},"standard_resolution":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/orig_313004620171114013435_3handssidewomen.jpg","size":{"width":1000,"height":1653}}},{"type":"image","image_id":6203646,"attribs":null,"original":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/orig_313004620171114013435_3handsbackwomen.jpg","size":{"width":1000,"height":1653}},"low_resolution":null,"thumbnail":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/thumb_313004620171114013435_3handsbackwomen.jpg","size":{"width":540,"height":892}},"standard_resolution":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/orig_313004620171114013435_3handsbackwomen.jpg","size":{"width":1000,"height":1653}}},{"type":"image","image_id":6203647,"attribs":null,"original":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/orig_313004620171114013435_3handsfrontwomen.jpg","size":{"width":1000,"height":1653}},"low_resolution":null,"thumbnail":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/thumb_313004620171114013435_3handsfrontwomen.jpg","size":{"width":540,"height":892}},"standard_resolution":{"url":"https:\/\/i.xshopper.com\/2017\/11\/14\/orig_313004620171114013435_3handsfrontwomen.jpg","size":{"width":1000,"height":1653}}}],"user":{"username":"blivawear.com","profile_picture":"https:\/\/ig-s-b-a.akamaihd.net\/hphotos-ak-xat1\/t51.2885-19\/s150x150\/13167395_980387595402753_1374853331_a.jpg","currency":"USD","url":"http:\/\/blivawear.com"}}}]}]}}
  10.  
  11.  
  12. REQUEST
  13.  
  14. {"publish":[{"post_id":3234884}]}
  15. E: https://api.xshopper.com/v1/post
  16.  
  17. RESPONSE
  18.  
  19.  
  20. {"name":"Database Exception","message":"SQLSTATE[HY093]: Invalid parameter number: parameter was not defined\nThe SQL being executed was: select row_to_json(result) \"data\" from (select \"now\", ''||(json(posts->>json_array_length(posts)-1)->>'post_id')::bigint-1 \"next\" , posts from (select floor(extract(epoch from now())) \"now\", array_to_json (array_agg(post)) posts from (select row_to_json (post) post from (select post.id \"post_id\" , post.user_id, post.sku ,post.created_at \"created_at\" ,post.updated_at \"updated_at\",(select row_to_json(counts) counts from (select post.count_like \"like\" , post.count_comment \"comment\" , post.count_wish \"wish\" , post.count_order \"shop\" ,(select count(case when post_like.user_id = 1908 then 1 end) \"liked\" from post_like where post_like.post_id = post.id) \"liked\" ) counts),(select row_to_json(\"user\") \"user\" from (select u.\"username\", \"u\".id \"user_id\" , url , (select replace(replace(replace(\"thumbnail\",':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') \"profile_picture\" from \"imagec_user\" WHERE \"imagec_user\".\"id\" = \"u\".id) \"profile_picture\", (case when 1908 != \"u\".id then coalesce((select true from \"user_follow\" where \"u\".id = user_follow.user_id_following and user_follow.user_id = 1908)::boolean,false)end) followed from \"user\" u where \"u\".id = post.user_id) \"user\") \"user\" ,(select array_to_json (array_agg(com)) \"comments\" from (select row_to_json(com) \"comment\" from ( select id , comment_out(\"comment\") \"text\" ,created_at \"created_at\" , case post_comment_status when 0 then 'comment' when 10 then 'fabric' when 11 then 'description' when 20 then 'title' when 21 then 'other' when 1 then 'first' when -1 then 'deleted' end \"type\" ,(select row_to_json(\"user\") \"user\" from (select u.\"username\", \"u\".id \"user_id\" , url , (select replace(replace(replace(\"thumbnail\",':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') \"profile_picture\" from \"imagec_user\" WHERE \"imagec_user\".\"id\" = \"u\".id) \"profile_picture\", (case when 1908 != \"u\".id then coalesce((select true from \"user_follow\" where \"u\".id = user_follow.user_id_following and user_follow.user_id = 1908)::boolean,false)end) followed from \"user\" u where \"u\".id = post_comment.user_id) \"user\") \"user\" from post_comment where post_comment.post_id = post.id and post_comment_status between 0 and 19 ORDER BY post_comment.post_comment_status , post_comment.id DESC LIMIT 3 ) com ) com ) \"comments\",coalesce((select array_to_json (array_agg(image)) images from (select row_to_json(image) image from (select \"type\", \"id\" image_id ,case when attribs::char(2) = '[]' then null else attribs end attribs , json('{\"url\":\"' || replace(replace(replace(original,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"original_size\",'null')||'}') \"original\" , json('{\"url\":\"' || replace(replace(replace(low_resolution,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"low_resolution_size\",'null')||'}') \"low_resolution\" , json('{\"url\":\"' || replace(replace(replace(thumbnail,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"thumbnail_size\",'null')||'}') \"thumbnail\" , json('{\"url\":\"' || replace(replace(replace(standard_resolution,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"standard_resolution_size\",'null')||'}') \"standard_resolution\" from imagec where imagec.post_id = post.id and imagec_status = 0 order by position) image ) image ),json('[{\"type\": \"image\", \"image_id\": 0 , \"original\": {\"url\" : \"http:\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/847_profile_531295517.png\", \"size\" : { \"height\" : 120, \"width\" : 120 }, \"low_resolution\": null, \"thumbnail\": null, \"standard_resolution\": null}}]')) images ,(select array_to_json (array_agg(items)) items from (select row_to_json(item) item FROM (select post_link.id \"link_id\" , post_link.post_id_linked \"post_id\", post_item.sku, post_item.plink,'https:\/\/www.xshopper.com\/collection\/'||( coalesce((select collection from post_collection pc where post.user_id=1908 and pc.post_id = post.id order by pc.created_at desc limit 1) , 'c_'||1908||'_'||post_item.id)) url,'https:\/\/www.xshopper.com\/collection\/'||( coalesce((select collection from post_collection pc where post.user_id=1908 and pc.post_id = post.id order by pc.created_at desc limit 1) , 'c_'||1908||'_'||post_item.id)) url, (select row_to_json(price) price from (select round(cast((case when post_link.pricing_type = '%' THEN (1+post_link.pricing_attribute::float\/100) ELSE NULL END * price* currency_xch(post_price.currency,'CAD'::char(3)) )* ((1+case when store.discount<=20 then (20-store.discount)\/100::float else 0 end)) as numeric),2)show_price, 'CAD'::char(3) show_currency , '' subtitle, case when attribs::char(2) = '[]' then null else attribs end attribs, \"flags\" from post_price , \"user\" store where store.id = post_price.user_id_store and post_price.post_id = post_item.id and post_price.type = 0) \"price\" ) \"price\",(select array_to_json (array_agg(com)) \"comments\" from (select row_to_json(com) \"comment\" from ( select id , comment_out(\"comment\") \"text\" ,created_at \"created_at\" , case post_comment_status when 0 then 'comment' when 10 then 'fabric' when 11 then 'description' when 20 then 'title' when 21 then 'other' when 1 then 'first' when -1 then 'deleted' end \"type\" ,(select row_to_json(\"user\") \"user\" from (select u.\"username\", \"u\".id \"user_id\" , url , (select replace(replace(replace(\"thumbnail\",':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') \"profile_picture\" from \"imagec_user\" WHERE \"imagec_user\".\"id\" = \"u\".id) \"profile_picture\", (case when 1908 != \"u\".id then coalesce((select true from \"user_follow\" where \"u\".id = user_follow.user_id_following and user_follow.user_id = 1908)::boolean,false)end) followed from \"user\" u where \"u\".id = post_comment.user_id) \"user\") \"user\" from post_comment where post_comment.post_id = post_item.id and post_comment_status between 0 and 19 ORDER BY post_comment.post_comment_status , post_comment.id DESC LIMIT 3 ) com ) com ) \"comments\",(select row_to_json(counts) counts from (select post_item.count_like \"like\" , post_item.count_comment \"comment\" , post_item.count_wish \"wish\" , post_item.count_order \"shop\" ,(select count(case when post_like.user_id = 1908 then 1 end) \"liked\" from post_like where post_like.post_id = post_item.id) \"liked\" ) counts),coalesce((select array_to_json (array_agg(image)) images from (select row_to_json(image) image from (select \"type\", \"id\" image_id ,case when attribs::char(2) = '[]' then null else attribs end attribs , json('{\"url\":\"' || replace(replace(replace(original,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"original_size\",'null')||'}') \"original\" , json('{\"url\":\"' || replace(replace(replace(low_resolution,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"low_resolution_size\",'null')||'}') \"low_resolution\" , json('{\"url\":\"' || replace(replace(replace(thumbnail,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"thumbnail_size\",'null')||'}') \"thumbnail\" , json('{\"url\":\"' || replace(replace(replace(standard_resolution,':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') || '\",\"size\":'||coalesce(\"standard_resolution_size\",'null')||'}') \"standard_resolution\" from imagec where imagec.post_id = post_item.id and imagec_status = 0 order by position) image ) image ),json('[{\"type\": \"image\", \"image_id\": 0 , \"original\": {\"url\" : \"http:\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/847_profile_531295517.png\", \"size\" : { \"height\" : 120, \"width\" : 120 }, \"low_resolution\": null, \"thumbnail\": null, \"standard_resolution\": null}}]')) images ,(select row_to_json(\"user\") \"user\" from(select u.\"username\" , replace(replace(replace(\"thumbnail\",':\/\/xshopper-002.xshopper.com\/',':\/\/i.xshopper.com\/'),':\/\/s3-ap-southeast-2.amazonaws.com\/xshopper-002\/',':\/\/i.xshopper.com\/'),'http:\/\/','https:\/\/') \"profile_picture\" ,u.currency,'http:\/\/'||url_domain url from \"user\" u LEFT OUTER JOIN \"imagec_user\" ON (\"imagec_user\".\"id\" = \"u\".id) where \"u\".id = user_shop.id) \"user\") \"user\" from post_link , \"user\" user_shop, \"post\" post_item where post_link.post_id = post.id and post_link.post_id_linked = post_item.id and post_item.user_id = user_shop.id and post_link.position != -1 ) item ) items) from post where \"post\".user_id = 1908 and post.id = :post_id and post.status = 0) post ORDER BY post.post_id DESC LIMIT 1 ) posts ) result) result","code":0,"type":"yii\\db\\Exception","file":"\/var\/app\/current\/vendor\/yiisoft\/yii2\/db\/Schema.php","line":636,"stack-trace":["#0 \/var\/app\/current\/vendor\/yiisoft\/yii2\/db\/Command.php(917): yii\\db\\Schema->convertException(Object(PDOException), 'select row_to_j...')","#1 \/var\/app\/current\/vendor\/yiisoft\/yii2\/db\/Command.php(362): yii\\db\\Command->queryInternal('fetchAll', NULL)","#2 \/var\/app\/current\/common\/models\/Lists.php(2106): yii\\db\\Command->queryAll()","#3 \/var\/app\/current\/rest\/versions\/v1\/controllers\/PostController.php(241): common\\models\\Lists->getUserFeed(Object(common\\models\\User), Object(common\\models\\User), NULL, 1, '', true, 0)","#4 [internal function]: rest\\versions\\v1\\controllers\\PostController->actionPost('')","#5 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/InlineAction.php(57): call_user_func_array(Array, Array)","#6 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/Controller.php(156): yii\\base\\InlineAction->runWithParams(Array)","#7 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/Module.php(523): yii\\base\\Controller->runAction('post', Array)","#8 \/var\/app\/current\/vendor\/yiisoft\/yii2\/web\/Application.php(102): yii\\base\\Module->runAction('v1\/post\/post', Array)","#9 \/var\/app\/current\/rest\/web\/index.php(35): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))","#10 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/Application.php(380): MyApplication->handleRequest(Object(yii\\web\\Request))","#11 \/var\/app\/current\/rest\/web\/index.php(41): yii\\base\\Application->run()","#12 {main}"],"error-info":["HY093",0],"previous":{"name":"Exception","message":"SQLSTATE[HY093]: Invalid parameter number: parameter was not defined","code":"HY093","type":"PDOException","file":"\/var\/app\/current\/vendor\/yiisoft\/yii2\/db\/Command.php","line":902,"stack-trace":["#0 \/var\/app\/current\/vendor\/yiisoft\/yii2\/db\/Command.php(902): PDOStatement->execute()","#1 \/var\/app\/current\/vendor\/yiisoft\/yii2\/db\/Command.php(362): yii\\db\\Command->queryInternal('fetchAll', NULL)","#2 \/var\/app\/current\/common\/models\/Lists.php(2106): yii\\db\\Command->queryAll()","#3 \/var\/app\/current\/rest\/versions\/v1\/controllers\/PostController.php(241): common\\models\\Lists->getUserFeed(Object(common\\models\\User), Object(common\\models\\User), NULL, 1, '', true, 0)","#4 [internal function]: rest\\versions\\v1\\controllers\\PostController->actionPost('')","#5 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/InlineAction.php(57): call_user_func_array(Array, Array)","#6 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/Controller.php(156): yii\\base\\InlineAction->runWithParams(Array)","#7 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/Module.php(523): yii\\base\\Controller->runAction('post', Array)","#8 \/var\/app\/current\/vendor\/yiisoft\/yii2\/web\/Application.php(102): yii\\base\\Module->runAction('v1\/post\/post', Array)","#9 \/var\/app\/current\/rest\/web\/index.php(35): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))","#10 \/var\/app\/current\/vendor\/yiisoft\/yii2\/base\/Application.php(380): MyApplication->handleRequest(Object(yii\\web\\Request))","#11 \/var\/app\/current\/rest\/web\/index.php(41): yii\\base\\Application->run()","#12 {main}"]}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement