[关闭]
@fuyb1986 2017-05-11T03:52:42.000000Z 字数 2123 阅读 558

店铺的优秀作品

金色童年


获取优秀作品的封面

Method and URL Structure

Method Resource URL
GET /photograph/photograph_post/cover/

Request Parameters

Name Description Required
tag 标签 YES
shop 店铺用户名 YES

cURL Example

  1. curl -X GET -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/photograph_post/cover/?tag=百天&shop=100001

Response data

url 后面加上数字,用七牛接口处理图片
Name Decription
file_url 每个 file_url 是一个封面
url 原图 url
url_1000 宽为 1000px 的缩略图
url_500 宽为 500px 的缩略图
url_150x150 宽、高都为 150px 的缩略图
tag 标签

Reponse

  1. [{
  2. "file_url":{
  3. "url":"http://www.example.com/2.jpg",
  4. "url_1000":"http://www.example.com/2.jpg-w1000",
  5. "url_500":"http://www.example.com/2.jpg-w500",
  6. "url_150x150":"http://www.example.com/2.jpg-150x150",
  7. },
  8. "tag":"外景"
  9. }...]

获取最近的一次发布

Method and URL Structure

Method Resource URL
GET /photograph/photograph_post/first/

Request Parameters

Name Description Required
tag 标签 YES
shop 店铺用户名 YES

cURL Example

  1. curl -X GET -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/photograph_post/first/?tag=百天&shop=1000100

Response data

Name Decription
pk 主键 ID
author 作者
description 描述
location 上传地点
published 发布时间
created 数据创建时间
post_id post model 主键
tag 标签
photograph_set 照片集合

Photograph

Name Description
title 照片标题
desc 照片描述
file_url 文件路径
taken_date 拍摄日期
taken_location 拍摄地点
albums 加入的相册
has_collect 是否收藏
private_url 文件的大图、小图

Album

Name Description
album 相册 id
name 相册名字
created 创建时间

Reponse

  1. {
  2. "pk":12345,
  3. "author":"test author",
  4. "description":"test description",
  5. "location":"南柯郡汶汶乡大槐树",
  6. "published":"2017-02-16",
  7. "created":"2017-02-16T14:41:24.816098"
  8. "post_id": 12345,
  9. "tag": "person",
  10. "photograph_set":[{
  11. "pk":7,
  12. "title":"xiaoming's photo",
  13. "desc":"南柯郡汶汶乡大槐树",
  14. "file_url":"http://www.example.com/2.jpg",
  15. "taken_date":"2016-07-01",
  16. "taken_location":"",
  17. "author":"布可朔夫",
  18. "created":"2017-02-16T14:41:24.808831",
  19. "albums":[{
  20. "album":"7",
  21. "name":"相册第一",
  22. "created":"2017-02-16T14:41:24.337682"
  23. },{
  24. "album":"6",
  25. "name":"全部",
  26. "created":"2017-02-16T14:41:24.320271"
  27. }],
  28. "has_collect":false,
  29. "private_url":{
  30. "url":"http://www.example.com/2.jpg?",
  31. "url_1000":"http://www.example.com/2.jpg-w1000",
  32. "url_500":"http://www.example.com/2.jpg-w500?",
  33. "url_150x150":"http://www.example.com/2.jpg-150x150",
  34. }
  35. },],
  36. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注