POST 修改项目指定栏位信息。

可以用这个功能达成什么任务?

  • 使用外部 OCR 工具分析图像可能出现的文字,将文字以注释、标签的方式补充在图片上,方便搜索
  • 使用外部 Object Detection 工具分析图像可能出现的物品,如动物、家俱等,以标签的方式补充在图片上,方便搜索

目前支持修改的栏位:

参数 说明
id 必填,欲修改项目 ID
tags 选填,标签
annotation 选填,注释
url 选填,来源网址
star 选填,评分

**

范例代码:

  1. var data = {
  2. "id": "KBN1X9NHDZ99F",
  3. "tags": ["Design1", "Design2"],
  4. "annotation": "Awesome",
  5. "url": "https://dribbble/com",
  6. "star": 4
  7. };
  8. var requestOptions = {
  9. method: 'POST',
  10. body: JSON.stringify(data),
  11. redirect: 'follow'
  12. };
  13. fetch("http://localhost:41595/api/item/update", requestOptions)
  14. .then(response => response.json())
  15. .then(result => console.log(result))
  16. .catch(error => console.log('error', error));

返回结果:

  1. {
  2. "status": "success",
  3. "data": {
  4. "id": "KBN1X9NHDZ99F",
  5. "name": "Top Character Design Trends for 2019 Bold Impressive",
  6. "size": 18447,
  7. "ext": "jpg",
  8. "tags": [
  9. "Design1",
  10. "Design2"
  11. ],
  12. "folders": [
  13. "KBJJSMMVF9WYL"
  14. ],
  15. "isDeleted": false,
  16. "url": "https://dribbble/com",
  17. "annotation": "Awesome",
  18. "modificationTime": 1592621841437,
  19. "width": 450,
  20. "height": 545,
  21. "noThumbnail": true,
  22. "lastModified": 1592625558780,
  23. "palettes": [
  24. {
  25. "color": [
  26. 251,
  27. 244,
  28. 221
  29. ],
  30. "ratio": 80,
  31. "$$hashKey": "object:678"
  32. },
  33. {
  34. "color": [
  35. 10,
  36. 185,
  37. 202
  38. ],
  39. "ratio": 7,
  40. "$$hashKey": "object:679"
  41. },
  42. {
  43. "color": [
  44. 26,
  45. 37,
  46. 64
  47. ],
  48. "ratio": 6,
  49. "$$hashKey": "object:680"
  50. },
  51. {
  52. "color": [
  53. 217,
  54. 83,
  55. 11
  56. ],
  57. "ratio": 4.42,
  58. "$$hashKey": "object:681"
  59. },
  60. {
  61. "color": [
  62. 242,
  63. 200,
  64. 172
  65. ],
  66. "ratio": 0.51,
  67. "$$hashKey": "object:682"
  68. },
  69. {
  70. "color": [
  71. 214,
  72. 170,
  73. 135
  74. ],
  75. "ratio": 0.44,
  76. "$$hashKey": "object:683"
  77. },
  78. {
  79. "color": [
  80. 154,
  81. 208,
  82. 220
  83. ],
  84. "ratio": 0.31,
  85. "$$hashKey": "object:684"
  86. }
  87. ],
  88. "star": 4
  89. }
  90. }