swagger.yaml 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357
  1. definitions:
  2. dto.AddPlaceRequest:
  3. properties:
  4. parent_id:
  5. type: integer
  6. title:
  7. type: string
  8. required:
  9. - title
  10. type: object
  11. dto.AddTagRequest:
  12. properties:
  13. style:
  14. type: string
  15. title:
  16. type: string
  17. required:
  18. - style
  19. - title
  20. type: object
  21. dto.AddThingNotificationRequest:
  22. properties:
  23. notification_date:
  24. format: date-time
  25. type: string
  26. thing_id:
  27. type: integer
  28. required:
  29. - notification_date
  30. - thing_id
  31. type: object
  32. dto.AddThingRequest:
  33. properties:
  34. description:
  35. type: string
  36. place_id:
  37. type: integer
  38. title:
  39. type: string
  40. required:
  41. - place_id
  42. - title
  43. type: object
  44. dto.AddUserRequest:
  45. properties:
  46. password:
  47. type: string
  48. username:
  49. type: string
  50. required:
  51. - password
  52. - username
  53. type: object
  54. dto.EmptyResponse:
  55. type: object
  56. dto.ErrorResponse:
  57. properties:
  58. error:
  59. type: string
  60. type: object
  61. dto.ImageResponse:
  62. properties:
  63. created_at:
  64. type: string
  65. id:
  66. type: integer
  67. image:
  68. type: string
  69. place_id:
  70. type: integer
  71. thing_id:
  72. type: integer
  73. type: object
  74. dto.ImagesResponse:
  75. properties:
  76. images:
  77. items:
  78. $ref: '#/definitions/dto.ImageResponse'
  79. type: array
  80. type: object
  81. dto.LoginRequest:
  82. properties:
  83. password:
  84. type: string
  85. username:
  86. type: string
  87. required:
  88. - password
  89. - username
  90. type: object
  91. dto.LoginResponse:
  92. properties:
  93. token:
  94. type: string
  95. type: object
  96. dto.PlaceResponse:
  97. properties:
  98. created_at:
  99. type: string
  100. id:
  101. type: integer
  102. parent_id:
  103. type: integer
  104. title:
  105. type: string
  106. updated_at:
  107. type: string
  108. type: object
  109. dto.PlaceTree:
  110. properties:
  111. nested:
  112. items:
  113. $ref: '#/definitions/dto.PlaceTree'
  114. type: array
  115. place:
  116. $ref: '#/definitions/dto.PlaceResponse'
  117. type: object
  118. dto.PlaceTreeResponse:
  119. properties:
  120. places:
  121. items:
  122. $ref: '#/definitions/dto.PlaceTree'
  123. type: array
  124. type: object
  125. dto.PlacesResponse:
  126. properties:
  127. places:
  128. items:
  129. $ref: '#/definitions/dto.PlaceResponse'
  130. type: array
  131. type: object
  132. dto.TagResponse:
  133. properties:
  134. created_at:
  135. type: string
  136. id:
  137. type: integer
  138. style:
  139. type: string
  140. title:
  141. type: string
  142. updated_at:
  143. type: string
  144. type: object
  145. dto.TagsResponse:
  146. properties:
  147. tags:
  148. items:
  149. $ref: '#/definitions/dto.TagResponse'
  150. type: array
  151. type: object
  152. dto.ThingExtResponse:
  153. properties:
  154. created_at:
  155. type: string
  156. description:
  157. type: string
  158. id:
  159. type: integer
  160. place_id:
  161. type: integer
  162. tags:
  163. items:
  164. $ref: '#/definitions/dto.TagResponse'
  165. type: array
  166. title:
  167. type: string
  168. updated_at:
  169. type: string
  170. type: object
  171. dto.ThingNotificationExtResponse:
  172. properties:
  173. created_at:
  174. type: string
  175. notification_date:
  176. type: string
  177. place_id:
  178. type: integer
  179. place_title:
  180. type: string
  181. thing_id:
  182. type: integer
  183. thing_title:
  184. type: string
  185. updated_at:
  186. type: string
  187. type: object
  188. dto.ThingNotificationResponse:
  189. properties:
  190. created_at:
  191. type: string
  192. id:
  193. type: integer
  194. notification_date:
  195. type: string
  196. updated_at:
  197. type: string
  198. type: object
  199. dto.ThingNotificationsExtResponse:
  200. properties:
  201. notifications:
  202. items:
  203. $ref: '#/definitions/dto.ThingNotificationExtResponse'
  204. type: array
  205. type: object
  206. dto.ThingResponse:
  207. properties:
  208. created_at:
  209. type: string
  210. description:
  211. type: string
  212. id:
  213. type: integer
  214. place_id:
  215. type: integer
  216. title:
  217. type: string
  218. updated_at:
  219. type: string
  220. type: object
  221. dto.ThingsExtResponse:
  222. properties:
  223. things:
  224. items:
  225. $ref: '#/definitions/dto.ThingExtResponse'
  226. type: array
  227. type: object
  228. dto.UpdatePlaceRequest:
  229. properties:
  230. parent_id:
  231. type: integer
  232. title:
  233. type: string
  234. required:
  235. - title
  236. type: object
  237. dto.UpdateTagRequest:
  238. properties:
  239. style:
  240. type: string
  241. title:
  242. type: string
  243. required:
  244. - style
  245. - title
  246. type: object
  247. dto.UpdateThingNotificationRequest:
  248. properties:
  249. notification_date:
  250. format: date-time
  251. type: string
  252. required:
  253. - notification_date
  254. type: object
  255. dto.UpdateThingRequest:
  256. properties:
  257. description:
  258. type: string
  259. place_id:
  260. type: integer
  261. title:
  262. type: string
  263. required:
  264. - place_id
  265. - title
  266. type: object
  267. dto.UpdateUserRequest:
  268. properties:
  269. password:
  270. type: string
  271. username:
  272. type: string
  273. type: object
  274. dto.UserResponse:
  275. properties:
  276. username:
  277. type: string
  278. type: object
  279. info:
  280. contact: {}
  281. title: Homethings API
  282. version: "1.0"
  283. paths:
  284. /api/v1/auth/check:
  285. get:
  286. consumes:
  287. - application/json
  288. produces:
  289. - application/json
  290. responses:
  291. "200":
  292. description: OK
  293. schema:
  294. $ref: '#/definitions/dto.UserResponse'
  295. "403":
  296. description: Forbidden
  297. schema:
  298. $ref: '#/definitions/dto.ErrorResponse'
  299. "500":
  300. description: Internal Server Error
  301. schema:
  302. $ref: '#/definitions/dto.ErrorResponse'
  303. summary: Check auth
  304. tags:
  305. - Auth
  306. /api/v1/auth/login:
  307. post:
  308. consumes:
  309. - application/json
  310. parameters:
  311. - description: Request body
  312. in: body
  313. name: data
  314. required: true
  315. schema:
  316. $ref: '#/definitions/dto.LoginRequest'
  317. produces:
  318. - application/json
  319. responses:
  320. "200":
  321. description: OK
  322. schema:
  323. $ref: '#/definitions/dto.LoginResponse'
  324. "400":
  325. description: Bad Request
  326. schema:
  327. $ref: '#/definitions/dto.ErrorResponse'
  328. "403":
  329. description: Forbidden
  330. schema:
  331. $ref: '#/definitions/dto.ErrorResponse'
  332. "500":
  333. description: Internal Server Error
  334. schema:
  335. $ref: '#/definitions/dto.ErrorResponse'
  336. summary: Log in user
  337. tags:
  338. - Auth
  339. /api/v1/images:
  340. post:
  341. consumes:
  342. - multipart/form-data
  343. parameters:
  344. - description: Place ID
  345. in: formData
  346. name: place_id
  347. type: integer
  348. - description: Thing ID
  349. in: formData
  350. name: thing_id
  351. type: integer
  352. - collectionFormat: csv
  353. description: Files
  354. in: formData
  355. items:
  356. type: file
  357. name: files
  358. required: true
  359. type: array
  360. produces:
  361. - application/json
  362. responses:
  363. "200":
  364. description: OK
  365. schema:
  366. $ref: '#/definitions/dto.EmptyResponse'
  367. "400":
  368. description: Bad Request
  369. schema:
  370. $ref: '#/definitions/dto.ErrorResponse'
  371. "500":
  372. description: Internal Server Error
  373. schema:
  374. $ref: '#/definitions/dto.ErrorResponse'
  375. security:
  376. - APIKey: []
  377. summary: Add images
  378. tags:
  379. - Images
  380. /api/v1/images/place/{imageId}:
  381. delete:
  382. consumes:
  383. - application/json
  384. parameters:
  385. - description: Image ID
  386. in: path
  387. name: imageId
  388. required: true
  389. type: integer
  390. produces:
  391. - application/json
  392. responses:
  393. "200":
  394. description: OK
  395. schema:
  396. $ref: '#/definitions/dto.EmptyResponse'
  397. "400":
  398. description: Bad Request
  399. schema:
  400. $ref: '#/definitions/dto.ErrorResponse'
  401. "500":
  402. description: Internal Server Error
  403. schema:
  404. $ref: '#/definitions/dto.ErrorResponse'
  405. security:
  406. - APIKey: []
  407. summary: Delete image
  408. tags:
  409. - Images
  410. /api/v1/images/place/{placeId}:
  411. get:
  412. consumes:
  413. - application/json
  414. parameters:
  415. - description: Place ID
  416. in: path
  417. name: placeId
  418. required: true
  419. type: integer
  420. produces:
  421. - application/json
  422. responses:
  423. "200":
  424. description: OK
  425. schema:
  426. $ref: '#/definitions/dto.ImagesResponse'
  427. "400":
  428. description: Bad Request
  429. schema:
  430. $ref: '#/definitions/dto.ErrorResponse'
  431. "500":
  432. description: Internal Server Error
  433. schema:
  434. $ref: '#/definitions/dto.ErrorResponse'
  435. security:
  436. - APIKey: []
  437. summary: Get images by place ID (with child places)
  438. tags:
  439. - Images
  440. /api/v1/images/thing/{imageId}:
  441. delete:
  442. consumes:
  443. - application/json
  444. parameters:
  445. - description: Image ID
  446. in: path
  447. name: imageId
  448. required: true
  449. type: integer
  450. produces:
  451. - application/json
  452. responses:
  453. "200":
  454. description: OK
  455. schema:
  456. $ref: '#/definitions/dto.EmptyResponse'
  457. "400":
  458. description: Bad Request
  459. schema:
  460. $ref: '#/definitions/dto.ErrorResponse'
  461. "500":
  462. description: Internal Server Error
  463. schema:
  464. $ref: '#/definitions/dto.ErrorResponse'
  465. security:
  466. - APIKey: []
  467. summary: Delete image
  468. tags:
  469. - Images
  470. /api/v1/images/thing/{thingId}:
  471. get:
  472. consumes:
  473. - application/json
  474. parameters:
  475. - description: Thing ID
  476. in: path
  477. name: thingId
  478. required: true
  479. type: integer
  480. produces:
  481. - application/json
  482. responses:
  483. "200":
  484. description: OK
  485. schema:
  486. $ref: '#/definitions/dto.ImagesResponse'
  487. "400":
  488. description: Bad Request
  489. schema:
  490. $ref: '#/definitions/dto.ErrorResponse'
  491. "500":
  492. description: Internal Server Error
  493. schema:
  494. $ref: '#/definitions/dto.ErrorResponse'
  495. security:
  496. - APIKey: []
  497. summary: Get images by thing ID
  498. tags:
  499. - Images
  500. /api/v1/places:
  501. get:
  502. consumes:
  503. - application/json
  504. produces:
  505. - application/json
  506. responses:
  507. "200":
  508. description: OK
  509. schema:
  510. $ref: '#/definitions/dto.PlacesResponse'
  511. "500":
  512. description: Internal Server Error
  513. schema:
  514. $ref: '#/definitions/dto.ErrorResponse'
  515. security:
  516. - APIKey: []
  517. summary: Get places list
  518. tags:
  519. - Places
  520. post:
  521. consumes:
  522. - application/json
  523. parameters:
  524. - description: Request body
  525. in: body
  526. name: data
  527. required: true
  528. schema:
  529. $ref: '#/definitions/dto.AddPlaceRequest'
  530. produces:
  531. - application/json
  532. responses:
  533. "200":
  534. description: OK
  535. schema:
  536. $ref: '#/definitions/dto.PlaceResponse'
  537. "400":
  538. description: Bad Request
  539. schema:
  540. $ref: '#/definitions/dto.ErrorResponse'
  541. "500":
  542. description: Internal Server Error
  543. schema:
  544. $ref: '#/definitions/dto.ErrorResponse'
  545. security:
  546. - APIKey: []
  547. summary: Add place
  548. tags:
  549. - Places
  550. /api/v1/places/{parentPlaceId}/nested:
  551. get:
  552. consumes:
  553. - application/json
  554. parameters:
  555. - description: Place ID
  556. in: path
  557. name: parentPlaceId
  558. required: true
  559. type: integer
  560. produces:
  561. - application/json
  562. responses:
  563. "200":
  564. description: OK
  565. schema:
  566. $ref: '#/definitions/dto.PlacesResponse'
  567. "400":
  568. description: Bad Request
  569. schema:
  570. $ref: '#/definitions/dto.ErrorResponse'
  571. "500":
  572. description: Internal Server Error
  573. schema:
  574. $ref: '#/definitions/dto.ErrorResponse'
  575. security:
  576. - APIKey: []
  577. summary: Get nested places by parent ID
  578. tags:
  579. - Places
  580. /api/v1/places/{placeId}:
  581. delete:
  582. consumes:
  583. - application/json
  584. parameters:
  585. - description: Place ID
  586. in: path
  587. name: placeId
  588. required: true
  589. type: integer
  590. produces:
  591. - application/json
  592. responses:
  593. "200":
  594. description: OK
  595. schema:
  596. $ref: '#/definitions/dto.EmptyResponse'
  597. "400":
  598. description: Bad Request
  599. schema:
  600. $ref: '#/definitions/dto.ErrorResponse'
  601. "500":
  602. description: Internal Server Error
  603. schema:
  604. $ref: '#/definitions/dto.ErrorResponse'
  605. security:
  606. - APIKey: []
  607. summary: Delete place
  608. tags:
  609. - Places
  610. get:
  611. consumes:
  612. - application/json
  613. parameters:
  614. - description: Place ID
  615. in: path
  616. name: placeId
  617. required: true
  618. type: integer
  619. produces:
  620. - application/json
  621. responses:
  622. "200":
  623. description: OK
  624. schema:
  625. $ref: '#/definitions/dto.PlaceResponse'
  626. "400":
  627. description: Bad Request
  628. schema:
  629. $ref: '#/definitions/dto.ErrorResponse'
  630. "404":
  631. description: Not Found
  632. schema:
  633. $ref: '#/definitions/dto.EmptyResponse'
  634. "500":
  635. description: Internal Server Error
  636. schema:
  637. $ref: '#/definitions/dto.ErrorResponse'
  638. security:
  639. - APIKey: []
  640. summary: Get one place
  641. tags:
  642. - Places
  643. put:
  644. consumes:
  645. - application/json
  646. parameters:
  647. - description: Place ID
  648. in: path
  649. name: placeId
  650. required: true
  651. type: integer
  652. - description: Request body
  653. in: body
  654. name: data
  655. required: true
  656. schema:
  657. $ref: '#/definitions/dto.UpdatePlaceRequest'
  658. produces:
  659. - application/json
  660. responses:
  661. "200":
  662. description: OK
  663. schema:
  664. $ref: '#/definitions/dto.PlaceResponse'
  665. "400":
  666. description: Bad Request
  667. schema:
  668. $ref: '#/definitions/dto.ErrorResponse'
  669. "500":
  670. description: Internal Server Error
  671. schema:
  672. $ref: '#/definitions/dto.ErrorResponse'
  673. security:
  674. - APIKey: []
  675. summary: Update place
  676. tags:
  677. - Places
  678. /api/v1/places/tree:
  679. get:
  680. consumes:
  681. - application/json
  682. produces:
  683. - application/json
  684. responses:
  685. "200":
  686. description: OK
  687. schema:
  688. $ref: '#/definitions/dto.PlaceTreeResponse'
  689. "500":
  690. description: Internal Server Error
  691. schema:
  692. $ref: '#/definitions/dto.ErrorResponse'
  693. security:
  694. - APIKey: []
  695. summary: Get places tree
  696. tags:
  697. - Places
  698. /api/v1/tags:
  699. get:
  700. consumes:
  701. - application/json
  702. produces:
  703. - application/json
  704. responses:
  705. "200":
  706. description: OK
  707. schema:
  708. $ref: '#/definitions/dto.TagsResponse'
  709. "400":
  710. description: Bad Request
  711. schema:
  712. $ref: '#/definitions/dto.ErrorResponse'
  713. "500":
  714. description: Internal Server Error
  715. schema:
  716. $ref: '#/definitions/dto.ErrorResponse'
  717. security:
  718. - APIKey: []
  719. summary: Get tags
  720. tags:
  721. - Tags
  722. post:
  723. consumes:
  724. - application/json
  725. parameters:
  726. - description: Request body
  727. in: body
  728. name: data
  729. required: true
  730. schema:
  731. $ref: '#/definitions/dto.AddTagRequest'
  732. produces:
  733. - application/json
  734. responses:
  735. "200":
  736. description: OK
  737. schema:
  738. $ref: '#/definitions/dto.TagResponse'
  739. "400":
  740. description: Bad Request
  741. schema:
  742. $ref: '#/definitions/dto.ErrorResponse'
  743. "500":
  744. description: Internal Server Error
  745. schema:
  746. $ref: '#/definitions/dto.ErrorResponse'
  747. security:
  748. - APIKey: []
  749. summary: Add tag
  750. tags:
  751. - Tags
  752. /api/v1/tags/{tagId}:
  753. delete:
  754. consumes:
  755. - application/json
  756. parameters:
  757. - description: Tag ID
  758. in: path
  759. name: tagId
  760. required: true
  761. type: integer
  762. produces:
  763. - application/json
  764. responses:
  765. "200":
  766. description: OK
  767. schema:
  768. $ref: '#/definitions/dto.EmptyResponse'
  769. "400":
  770. description: Bad Request
  771. schema:
  772. $ref: '#/definitions/dto.ErrorResponse'
  773. "500":
  774. description: Internal Server Error
  775. schema:
  776. $ref: '#/definitions/dto.ErrorResponse'
  777. security:
  778. - APIKey: []
  779. summary: Delete tag
  780. tags:
  781. - Tags
  782. get:
  783. consumes:
  784. - application/json
  785. parameters:
  786. - description: Tag ID
  787. in: path
  788. name: tagId
  789. required: true
  790. type: integer
  791. produces:
  792. - application/json
  793. responses:
  794. "200":
  795. description: OK
  796. schema:
  797. $ref: '#/definitions/dto.TagResponse'
  798. "400":
  799. description: Bad Request
  800. schema:
  801. $ref: '#/definitions/dto.ErrorResponse'
  802. "404":
  803. description: Not Found
  804. schema:
  805. $ref: '#/definitions/dto.EmptyResponse'
  806. "500":
  807. description: Internal Server Error
  808. schema:
  809. $ref: '#/definitions/dto.ErrorResponse'
  810. security:
  811. - APIKey: []
  812. summary: Get one tag
  813. tags:
  814. - Tags
  815. put:
  816. consumes:
  817. - application/json
  818. parameters:
  819. - description: Tag ID
  820. in: path
  821. name: tagId
  822. required: true
  823. type: integer
  824. - description: Request body
  825. in: body
  826. name: data
  827. required: true
  828. schema:
  829. $ref: '#/definitions/dto.UpdateTagRequest'
  830. produces:
  831. - application/json
  832. responses:
  833. "200":
  834. description: OK
  835. schema:
  836. $ref: '#/definitions/dto.TagResponse'
  837. "400":
  838. description: Bad Request
  839. schema:
  840. $ref: '#/definitions/dto.ErrorResponse'
  841. "500":
  842. description: Internal Server Error
  843. schema:
  844. $ref: '#/definitions/dto.ErrorResponse'
  845. security:
  846. - APIKey: []
  847. summary: Update tag
  848. tags:
  849. - Tags
  850. /api/v1/tags/{tagId}/thing/{thingId}:
  851. delete:
  852. consumes:
  853. - application/json
  854. parameters:
  855. - description: Tag ID
  856. in: path
  857. name: tagId
  858. required: true
  859. type: integer
  860. - description: Thing ID
  861. in: path
  862. name: thingId
  863. required: true
  864. type: integer
  865. produces:
  866. - application/json
  867. responses:
  868. "200":
  869. description: OK
  870. schema:
  871. $ref: '#/definitions/dto.EmptyResponse'
  872. "400":
  873. description: Bad Request
  874. schema:
  875. $ref: '#/definitions/dto.ErrorResponse'
  876. "500":
  877. description: Internal Server Error
  878. schema:
  879. $ref: '#/definitions/dto.ErrorResponse'
  880. security:
  881. - APIKey: []
  882. summary: Delete thing tag
  883. tags:
  884. - Tags
  885. post:
  886. consumes:
  887. - application/json
  888. parameters:
  889. - description: Tag ID
  890. in: path
  891. name: tagId
  892. required: true
  893. type: integer
  894. - description: Thing ID
  895. in: path
  896. name: thingId
  897. required: true
  898. type: integer
  899. produces:
  900. - application/json
  901. responses:
  902. "200":
  903. description: OK
  904. schema:
  905. $ref: '#/definitions/dto.TagResponse'
  906. "400":
  907. description: Bad Request
  908. schema:
  909. $ref: '#/definitions/dto.ErrorResponse'
  910. "500":
  911. description: Internal Server Error
  912. schema:
  913. $ref: '#/definitions/dto.ErrorResponse'
  914. security:
  915. - APIKey: []
  916. summary: Add thing tag
  917. tags:
  918. - Tags
  919. /api/v1/tags/thing/{thingId}:
  920. get:
  921. consumes:
  922. - application/json
  923. parameters:
  924. - description: Thing ID
  925. in: path
  926. name: thingId
  927. required: true
  928. type: integer
  929. produces:
  930. - application/json
  931. responses:
  932. "200":
  933. description: OK
  934. schema:
  935. $ref: '#/definitions/dto.TagsResponse'
  936. "400":
  937. description: Bad Request
  938. schema:
  939. $ref: '#/definitions/dto.ErrorResponse'
  940. "500":
  941. description: Internal Server Error
  942. schema:
  943. $ref: '#/definitions/dto.ErrorResponse'
  944. security:
  945. - APIKey: []
  946. summary: Get thing tags
  947. tags:
  948. - Tags
  949. /api/v1/things:
  950. post:
  951. consumes:
  952. - application/json
  953. parameters:
  954. - description: Request body
  955. in: body
  956. name: data
  957. required: true
  958. schema:
  959. $ref: '#/definitions/dto.AddThingRequest'
  960. produces:
  961. - application/json
  962. responses:
  963. "200":
  964. description: OK
  965. schema:
  966. $ref: '#/definitions/dto.ThingResponse'
  967. "400":
  968. description: Bad Request
  969. schema:
  970. $ref: '#/definitions/dto.ErrorResponse'
  971. "500":
  972. description: Internal Server Error
  973. schema:
  974. $ref: '#/definitions/dto.ErrorResponse'
  975. security:
  976. - APIKey: []
  977. summary: Add thing
  978. tags:
  979. - Things
  980. /api/v1/things/{thingId}:
  981. delete:
  982. consumes:
  983. - application/json
  984. parameters:
  985. - description: Thing ID
  986. in: path
  987. name: thingId
  988. required: true
  989. type: integer
  990. produces:
  991. - application/json
  992. responses:
  993. "200":
  994. description: OK
  995. schema:
  996. $ref: '#/definitions/dto.EmptyResponse'
  997. "400":
  998. description: Bad Request
  999. schema:
  1000. $ref: '#/definitions/dto.ErrorResponse'
  1001. "500":
  1002. description: Internal Server Error
  1003. schema:
  1004. $ref: '#/definitions/dto.ErrorResponse'
  1005. security:
  1006. - APIKey: []
  1007. summary: Delete thing
  1008. tags:
  1009. - Things
  1010. get:
  1011. consumes:
  1012. - application/json
  1013. parameters:
  1014. - description: Thing ID
  1015. in: path
  1016. name: thingId
  1017. required: true
  1018. type: integer
  1019. produces:
  1020. - application/json
  1021. responses:
  1022. "200":
  1023. description: OK
  1024. schema:
  1025. $ref: '#/definitions/dto.ThingResponse'
  1026. "400":
  1027. description: Bad Request
  1028. schema:
  1029. $ref: '#/definitions/dto.ErrorResponse'
  1030. "404":
  1031. description: Not Found
  1032. schema:
  1033. $ref: '#/definitions/dto.EmptyResponse'
  1034. "500":
  1035. description: Internal Server Error
  1036. schema:
  1037. $ref: '#/definitions/dto.ErrorResponse'
  1038. security:
  1039. - APIKey: []
  1040. summary: Get one thing
  1041. tags:
  1042. - Things
  1043. put:
  1044. consumes:
  1045. - application/json
  1046. parameters:
  1047. - description: Thing ID
  1048. in: path
  1049. name: thingId
  1050. required: true
  1051. type: integer
  1052. - description: Request body
  1053. in: body
  1054. name: data
  1055. required: true
  1056. schema:
  1057. $ref: '#/definitions/dto.UpdateThingRequest'
  1058. produces:
  1059. - application/json
  1060. responses:
  1061. "200":
  1062. description: OK
  1063. schema:
  1064. $ref: '#/definitions/dto.ThingResponse'
  1065. "400":
  1066. description: Bad Request
  1067. schema:
  1068. $ref: '#/definitions/dto.ErrorResponse'
  1069. "500":
  1070. description: Internal Server Error
  1071. schema:
  1072. $ref: '#/definitions/dto.ErrorResponse'
  1073. security:
  1074. - APIKey: []
  1075. summary: Update thing
  1076. tags:
  1077. - Things
  1078. /api/v1/things/notifications:
  1079. post:
  1080. consumes:
  1081. - application/json
  1082. parameters:
  1083. - description: Request body
  1084. in: body
  1085. name: data
  1086. required: true
  1087. schema:
  1088. $ref: '#/definitions/dto.AddThingNotificationRequest'
  1089. produces:
  1090. - application/json
  1091. responses:
  1092. "200":
  1093. description: OK
  1094. schema:
  1095. $ref: '#/definitions/dto.ThingNotificationResponse'
  1096. "400":
  1097. description: Bad Request
  1098. schema:
  1099. $ref: '#/definitions/dto.ErrorResponse'
  1100. "500":
  1101. description: Internal Server Error
  1102. schema:
  1103. $ref: '#/definitions/dto.ErrorResponse'
  1104. security:
  1105. - APIKey: []
  1106. summary: Add thing notification
  1107. tags:
  1108. - Notifications
  1109. /api/v1/things/notifications/{thingId}:
  1110. delete:
  1111. consumes:
  1112. - application/json
  1113. parameters:
  1114. - description: Thing ID
  1115. in: path
  1116. name: thingId
  1117. required: true
  1118. type: integer
  1119. produces:
  1120. - application/json
  1121. responses:
  1122. "200":
  1123. description: OK
  1124. schema:
  1125. $ref: '#/definitions/dto.EmptyResponse'
  1126. "400":
  1127. description: Bad Request
  1128. schema:
  1129. $ref: '#/definitions/dto.ErrorResponse'
  1130. "500":
  1131. description: Internal Server Error
  1132. schema:
  1133. $ref: '#/definitions/dto.ErrorResponse'
  1134. security:
  1135. - APIKey: []
  1136. summary: Delete thing notification
  1137. tags:
  1138. - Notifications
  1139. get:
  1140. consumes:
  1141. - application/json
  1142. parameters:
  1143. - description: Thing ID
  1144. in: path
  1145. name: thingId
  1146. required: true
  1147. type: integer
  1148. produces:
  1149. - application/json
  1150. responses:
  1151. "200":
  1152. description: OK
  1153. schema:
  1154. $ref: '#/definitions/dto.ThingNotificationResponse'
  1155. "400":
  1156. description: Bad Request
  1157. schema:
  1158. $ref: '#/definitions/dto.ErrorResponse'
  1159. "404":
  1160. description: Not Found
  1161. schema:
  1162. $ref: '#/definitions/dto.EmptyResponse'
  1163. "500":
  1164. description: Internal Server Error
  1165. schema:
  1166. $ref: '#/definitions/dto.ErrorResponse'
  1167. security:
  1168. - APIKey: []
  1169. summary: Get thing notification
  1170. tags:
  1171. - Notifications
  1172. put:
  1173. consumes:
  1174. - application/json
  1175. parameters:
  1176. - description: Thing ID
  1177. in: path
  1178. name: thingId
  1179. required: true
  1180. type: integer
  1181. - description: Request body
  1182. in: body
  1183. name: data
  1184. required: true
  1185. schema:
  1186. $ref: '#/definitions/dto.UpdateThingNotificationRequest'
  1187. produces:
  1188. - application/json
  1189. responses:
  1190. "200":
  1191. description: OK
  1192. schema:
  1193. $ref: '#/definitions/dto.ThingNotificationResponse'
  1194. "400":
  1195. description: Bad Request
  1196. schema:
  1197. $ref: '#/definitions/dto.ErrorResponse'
  1198. "500":
  1199. description: Internal Server Error
  1200. schema:
  1201. $ref: '#/definitions/dto.ErrorResponse'
  1202. security:
  1203. - APIKey: []
  1204. summary: Update thing notification
  1205. tags:
  1206. - Notifications
  1207. /api/v1/things/notifications/expired:
  1208. get:
  1209. consumes:
  1210. - application/json
  1211. produces:
  1212. - application/json
  1213. responses:
  1214. "200":
  1215. description: OK
  1216. schema:
  1217. $ref: '#/definitions/dto.ThingNotificationsExtResponse'
  1218. "400":
  1219. description: Bad Request
  1220. schema:
  1221. $ref: '#/definitions/dto.ErrorResponse'
  1222. "500":
  1223. description: Internal Server Error
  1224. schema:
  1225. $ref: '#/definitions/dto.ErrorResponse'
  1226. security:
  1227. - APIKey: []
  1228. summary: Get expired thing notifications
  1229. tags:
  1230. - Notifications
  1231. /api/v1/things/place/{placeId}:
  1232. get:
  1233. consumes:
  1234. - application/json
  1235. parameters:
  1236. - description: Place ID
  1237. in: path
  1238. name: placeId
  1239. required: true
  1240. type: integer
  1241. produces:
  1242. - application/json
  1243. responses:
  1244. "200":
  1245. description: OK
  1246. schema:
  1247. $ref: '#/definitions/dto.ThingsExtResponse'
  1248. "400":
  1249. description: Bad Request
  1250. schema:
  1251. $ref: '#/definitions/dto.ErrorResponse'
  1252. "500":
  1253. description: Internal Server Error
  1254. schema:
  1255. $ref: '#/definitions/dto.ErrorResponse'
  1256. security:
  1257. - APIKey: []
  1258. summary: Get things by place ID
  1259. tags:
  1260. - Things
  1261. /api/v1/things/search/{search}:
  1262. get:
  1263. consumes:
  1264. - application/json
  1265. parameters:
  1266. - description: Search string
  1267. in: path
  1268. name: search
  1269. required: true
  1270. type: string
  1271. produces:
  1272. - application/json
  1273. responses:
  1274. "200":
  1275. description: OK
  1276. schema:
  1277. $ref: '#/definitions/dto.ThingResponse'
  1278. "400":
  1279. description: Bad Request
  1280. schema:
  1281. $ref: '#/definitions/dto.ErrorResponse'
  1282. "500":
  1283. description: Internal Server Error
  1284. schema:
  1285. $ref: '#/definitions/dto.ErrorResponse'
  1286. security:
  1287. - APIKey: []
  1288. summary: Search things
  1289. tags:
  1290. - Things
  1291. /api/v1/users:
  1292. post:
  1293. consumes:
  1294. - application/json
  1295. parameters:
  1296. - description: Request body
  1297. in: body
  1298. name: data
  1299. required: true
  1300. schema:
  1301. $ref: '#/definitions/dto.AddUserRequest'
  1302. produces:
  1303. - application/json
  1304. responses:
  1305. "200":
  1306. description: OK
  1307. schema:
  1308. $ref: '#/definitions/dto.EmptyResponse'
  1309. "400":
  1310. description: Bad Request
  1311. schema:
  1312. $ref: '#/definitions/dto.ErrorResponse'
  1313. "500":
  1314. description: Internal Server Error
  1315. schema:
  1316. $ref: '#/definitions/dto.ErrorResponse'
  1317. security:
  1318. - APIKey: []
  1319. summary: Add user
  1320. tags:
  1321. - Users
  1322. put:
  1323. consumes:
  1324. - application/json
  1325. parameters:
  1326. - description: Request body
  1327. in: body
  1328. name: data
  1329. required: true
  1330. schema:
  1331. $ref: '#/definitions/dto.UpdateUserRequest'
  1332. produces:
  1333. - application/json
  1334. responses:
  1335. "200":
  1336. description: OK
  1337. schema:
  1338. $ref: '#/definitions/dto.EmptyResponse'
  1339. "400":
  1340. description: Bad Request
  1341. schema:
  1342. $ref: '#/definitions/dto.ErrorResponse'
  1343. "500":
  1344. description: Internal Server Error
  1345. schema:
  1346. $ref: '#/definitions/dto.ErrorResponse'
  1347. security:
  1348. - APIKey: []
  1349. summary: Update user
  1350. tags:
  1351. - Users
  1352. securityDefinitions:
  1353. APIKey:
  1354. in: header
  1355. name: Authorization
  1356. type: apiKey
  1357. swagger: "2.0"