swagger.yaml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356
  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. - description: Files
  353. in: formData
  354. items:
  355. type: file
  356. name: files
  357. required: true
  358. type: array
  359. produces:
  360. - application/json
  361. responses:
  362. "200":
  363. description: OK
  364. schema:
  365. $ref: '#/definitions/dto.EmptyResponse'
  366. "400":
  367. description: Bad Request
  368. schema:
  369. $ref: '#/definitions/dto.ErrorResponse'
  370. "500":
  371. description: Internal Server Error
  372. schema:
  373. $ref: '#/definitions/dto.ErrorResponse'
  374. security:
  375. - APIKey: []
  376. summary: Add images
  377. tags:
  378. - Images
  379. /api/v1/images/place/{imageId}:
  380. delete:
  381. consumes:
  382. - application/json
  383. parameters:
  384. - description: Image ID
  385. in: path
  386. name: imageId
  387. required: true
  388. type: integer
  389. produces:
  390. - application/json
  391. responses:
  392. "200":
  393. description: OK
  394. schema:
  395. $ref: '#/definitions/dto.EmptyResponse'
  396. "400":
  397. description: Bad Request
  398. schema:
  399. $ref: '#/definitions/dto.ErrorResponse'
  400. "500":
  401. description: Internal Server Error
  402. schema:
  403. $ref: '#/definitions/dto.ErrorResponse'
  404. security:
  405. - APIKey: []
  406. summary: Delete image
  407. tags:
  408. - Images
  409. /api/v1/images/place/{placeId}:
  410. get:
  411. consumes:
  412. - application/json
  413. parameters:
  414. - description: Place ID
  415. in: path
  416. name: placeId
  417. required: true
  418. type: integer
  419. produces:
  420. - application/json
  421. responses:
  422. "200":
  423. description: OK
  424. schema:
  425. $ref: '#/definitions/dto.ImagesResponse'
  426. "400":
  427. description: Bad Request
  428. schema:
  429. $ref: '#/definitions/dto.ErrorResponse'
  430. "500":
  431. description: Internal Server Error
  432. schema:
  433. $ref: '#/definitions/dto.ErrorResponse'
  434. security:
  435. - APIKey: []
  436. summary: Get images by place ID (with child places)
  437. tags:
  438. - Images
  439. /api/v1/images/thing/{imageId}:
  440. delete:
  441. consumes:
  442. - application/json
  443. parameters:
  444. - description: Image ID
  445. in: path
  446. name: imageId
  447. required: true
  448. type: integer
  449. produces:
  450. - application/json
  451. responses:
  452. "200":
  453. description: OK
  454. schema:
  455. $ref: '#/definitions/dto.EmptyResponse'
  456. "400":
  457. description: Bad Request
  458. schema:
  459. $ref: '#/definitions/dto.ErrorResponse'
  460. "500":
  461. description: Internal Server Error
  462. schema:
  463. $ref: '#/definitions/dto.ErrorResponse'
  464. security:
  465. - APIKey: []
  466. summary: Delete image
  467. tags:
  468. - Images
  469. /api/v1/images/thing/{thingId}:
  470. get:
  471. consumes:
  472. - application/json
  473. parameters:
  474. - description: Thing ID
  475. in: path
  476. name: thingId
  477. required: true
  478. type: integer
  479. produces:
  480. - application/json
  481. responses:
  482. "200":
  483. description: OK
  484. schema:
  485. $ref: '#/definitions/dto.ImagesResponse'
  486. "400":
  487. description: Bad Request
  488. schema:
  489. $ref: '#/definitions/dto.ErrorResponse'
  490. "500":
  491. description: Internal Server Error
  492. schema:
  493. $ref: '#/definitions/dto.ErrorResponse'
  494. security:
  495. - APIKey: []
  496. summary: Get images by thing ID
  497. tags:
  498. - Images
  499. /api/v1/places:
  500. get:
  501. consumes:
  502. - application/json
  503. produces:
  504. - application/json
  505. responses:
  506. "200":
  507. description: OK
  508. schema:
  509. $ref: '#/definitions/dto.PlacesResponse'
  510. "500":
  511. description: Internal Server Error
  512. schema:
  513. $ref: '#/definitions/dto.ErrorResponse'
  514. security:
  515. - APIKey: []
  516. summary: Get places list
  517. tags:
  518. - Places
  519. post:
  520. consumes:
  521. - application/json
  522. parameters:
  523. - description: Request body
  524. in: body
  525. name: data
  526. required: true
  527. schema:
  528. $ref: '#/definitions/dto.AddPlaceRequest'
  529. produces:
  530. - application/json
  531. responses:
  532. "200":
  533. description: OK
  534. schema:
  535. $ref: '#/definitions/dto.PlaceResponse'
  536. "400":
  537. description: Bad Request
  538. schema:
  539. $ref: '#/definitions/dto.ErrorResponse'
  540. "500":
  541. description: Internal Server Error
  542. schema:
  543. $ref: '#/definitions/dto.ErrorResponse'
  544. security:
  545. - APIKey: []
  546. summary: Add place
  547. tags:
  548. - Places
  549. /api/v1/places/{parentPlaceId}/nested:
  550. get:
  551. consumes:
  552. - application/json
  553. parameters:
  554. - description: Place ID
  555. in: path
  556. name: parentPlaceId
  557. required: true
  558. type: integer
  559. produces:
  560. - application/json
  561. responses:
  562. "200":
  563. description: OK
  564. schema:
  565. $ref: '#/definitions/dto.PlacesResponse'
  566. "400":
  567. description: Bad Request
  568. schema:
  569. $ref: '#/definitions/dto.ErrorResponse'
  570. "500":
  571. description: Internal Server Error
  572. schema:
  573. $ref: '#/definitions/dto.ErrorResponse'
  574. security:
  575. - APIKey: []
  576. summary: Get nested places by parent ID
  577. tags:
  578. - Places
  579. /api/v1/places/{placeId}:
  580. delete:
  581. consumes:
  582. - application/json
  583. parameters:
  584. - description: Place ID
  585. in: path
  586. name: placeId
  587. required: true
  588. type: integer
  589. produces:
  590. - application/json
  591. responses:
  592. "200":
  593. description: OK
  594. schema:
  595. $ref: '#/definitions/dto.EmptyResponse'
  596. "400":
  597. description: Bad Request
  598. schema:
  599. $ref: '#/definitions/dto.ErrorResponse'
  600. "500":
  601. description: Internal Server Error
  602. schema:
  603. $ref: '#/definitions/dto.ErrorResponse'
  604. security:
  605. - APIKey: []
  606. summary: Delete place
  607. tags:
  608. - Places
  609. get:
  610. consumes:
  611. - application/json
  612. parameters:
  613. - description: Place ID
  614. in: path
  615. name: placeId
  616. required: true
  617. type: integer
  618. produces:
  619. - application/json
  620. responses:
  621. "200":
  622. description: OK
  623. schema:
  624. $ref: '#/definitions/dto.PlaceResponse'
  625. "400":
  626. description: Bad Request
  627. schema:
  628. $ref: '#/definitions/dto.ErrorResponse'
  629. "404":
  630. description: Not Found
  631. schema:
  632. $ref: '#/definitions/dto.EmptyResponse'
  633. "500":
  634. description: Internal Server Error
  635. schema:
  636. $ref: '#/definitions/dto.ErrorResponse'
  637. security:
  638. - APIKey: []
  639. summary: Get one place
  640. tags:
  641. - Places
  642. put:
  643. consumes:
  644. - application/json
  645. parameters:
  646. - description: Place ID
  647. in: path
  648. name: placeId
  649. required: true
  650. type: integer
  651. - description: Request body
  652. in: body
  653. name: data
  654. required: true
  655. schema:
  656. $ref: '#/definitions/dto.UpdatePlaceRequest'
  657. produces:
  658. - application/json
  659. responses:
  660. "200":
  661. description: OK
  662. schema:
  663. $ref: '#/definitions/dto.PlaceResponse'
  664. "400":
  665. description: Bad Request
  666. schema:
  667. $ref: '#/definitions/dto.ErrorResponse'
  668. "500":
  669. description: Internal Server Error
  670. schema:
  671. $ref: '#/definitions/dto.ErrorResponse'
  672. security:
  673. - APIKey: []
  674. summary: Update place
  675. tags:
  676. - Places
  677. /api/v1/places/tree:
  678. get:
  679. consumes:
  680. - application/json
  681. produces:
  682. - application/json
  683. responses:
  684. "200":
  685. description: OK
  686. schema:
  687. $ref: '#/definitions/dto.PlaceTreeResponse'
  688. "500":
  689. description: Internal Server Error
  690. schema:
  691. $ref: '#/definitions/dto.ErrorResponse'
  692. security:
  693. - APIKey: []
  694. summary: Get places tree
  695. tags:
  696. - Places
  697. /api/v1/tags:
  698. get:
  699. consumes:
  700. - application/json
  701. produces:
  702. - application/json
  703. responses:
  704. "200":
  705. description: OK
  706. schema:
  707. $ref: '#/definitions/dto.TagsResponse'
  708. "400":
  709. description: Bad Request
  710. schema:
  711. $ref: '#/definitions/dto.ErrorResponse'
  712. "500":
  713. description: Internal Server Error
  714. schema:
  715. $ref: '#/definitions/dto.ErrorResponse'
  716. security:
  717. - APIKey: []
  718. summary: Get tags
  719. tags:
  720. - Tags
  721. post:
  722. consumes:
  723. - application/json
  724. parameters:
  725. - description: Request body
  726. in: body
  727. name: data
  728. required: true
  729. schema:
  730. $ref: '#/definitions/dto.AddTagRequest'
  731. produces:
  732. - application/json
  733. responses:
  734. "200":
  735. description: OK
  736. schema:
  737. $ref: '#/definitions/dto.TagResponse'
  738. "400":
  739. description: Bad Request
  740. schema:
  741. $ref: '#/definitions/dto.ErrorResponse'
  742. "500":
  743. description: Internal Server Error
  744. schema:
  745. $ref: '#/definitions/dto.ErrorResponse'
  746. security:
  747. - APIKey: []
  748. summary: Add tag
  749. tags:
  750. - Tags
  751. /api/v1/tags/{tagId}:
  752. delete:
  753. consumes:
  754. - application/json
  755. parameters:
  756. - description: Tag ID
  757. in: path
  758. name: tagId
  759. required: true
  760. type: integer
  761. produces:
  762. - application/json
  763. responses:
  764. "200":
  765. description: OK
  766. schema:
  767. $ref: '#/definitions/dto.EmptyResponse'
  768. "400":
  769. description: Bad Request
  770. schema:
  771. $ref: '#/definitions/dto.ErrorResponse'
  772. "500":
  773. description: Internal Server Error
  774. schema:
  775. $ref: '#/definitions/dto.ErrorResponse'
  776. security:
  777. - APIKey: []
  778. summary: Delete tag
  779. tags:
  780. - Tags
  781. get:
  782. consumes:
  783. - application/json
  784. parameters:
  785. - description: Tag ID
  786. in: path
  787. name: tagId
  788. required: true
  789. type: integer
  790. produces:
  791. - application/json
  792. responses:
  793. "200":
  794. description: OK
  795. schema:
  796. $ref: '#/definitions/dto.TagResponse'
  797. "400":
  798. description: Bad Request
  799. schema:
  800. $ref: '#/definitions/dto.ErrorResponse'
  801. "404":
  802. description: Not Found
  803. schema:
  804. $ref: '#/definitions/dto.EmptyResponse'
  805. "500":
  806. description: Internal Server Error
  807. schema:
  808. $ref: '#/definitions/dto.ErrorResponse'
  809. security:
  810. - APIKey: []
  811. summary: Get one tag
  812. tags:
  813. - Tags
  814. put:
  815. consumes:
  816. - application/json
  817. parameters:
  818. - description: Tag ID
  819. in: path
  820. name: tagId
  821. required: true
  822. type: integer
  823. - description: Request body
  824. in: body
  825. name: data
  826. required: true
  827. schema:
  828. $ref: '#/definitions/dto.UpdateTagRequest'
  829. produces:
  830. - application/json
  831. responses:
  832. "200":
  833. description: OK
  834. schema:
  835. $ref: '#/definitions/dto.TagResponse'
  836. "400":
  837. description: Bad Request
  838. schema:
  839. $ref: '#/definitions/dto.ErrorResponse'
  840. "500":
  841. description: Internal Server Error
  842. schema:
  843. $ref: '#/definitions/dto.ErrorResponse'
  844. security:
  845. - APIKey: []
  846. summary: Update tag
  847. tags:
  848. - Tags
  849. /api/v1/tags/{tagId}/thing/{thingId}:
  850. delete:
  851. consumes:
  852. - application/json
  853. parameters:
  854. - description: Tag ID
  855. in: path
  856. name: tagId
  857. required: true
  858. type: integer
  859. - description: Thing ID
  860. in: path
  861. name: thingId
  862. required: true
  863. type: integer
  864. produces:
  865. - application/json
  866. responses:
  867. "200":
  868. description: OK
  869. schema:
  870. $ref: '#/definitions/dto.EmptyResponse'
  871. "400":
  872. description: Bad Request
  873. schema:
  874. $ref: '#/definitions/dto.ErrorResponse'
  875. "500":
  876. description: Internal Server Error
  877. schema:
  878. $ref: '#/definitions/dto.ErrorResponse'
  879. security:
  880. - APIKey: []
  881. summary: Delete thing tag
  882. tags:
  883. - Tags
  884. post:
  885. consumes:
  886. - application/json
  887. parameters:
  888. - description: Tag ID
  889. in: path
  890. name: tagId
  891. required: true
  892. type: integer
  893. - description: Thing ID
  894. in: path
  895. name: thingId
  896. required: true
  897. type: integer
  898. produces:
  899. - application/json
  900. responses:
  901. "200":
  902. description: OK
  903. schema:
  904. $ref: '#/definitions/dto.TagResponse'
  905. "400":
  906. description: Bad Request
  907. schema:
  908. $ref: '#/definitions/dto.ErrorResponse'
  909. "500":
  910. description: Internal Server Error
  911. schema:
  912. $ref: '#/definitions/dto.ErrorResponse'
  913. security:
  914. - APIKey: []
  915. summary: Add thing tag
  916. tags:
  917. - Tags
  918. /api/v1/tags/thing/{thingId}:
  919. get:
  920. consumes:
  921. - application/json
  922. parameters:
  923. - description: Thing ID
  924. in: path
  925. name: thingId
  926. required: true
  927. type: integer
  928. produces:
  929. - application/json
  930. responses:
  931. "200":
  932. description: OK
  933. schema:
  934. $ref: '#/definitions/dto.TagsResponse'
  935. "400":
  936. description: Bad Request
  937. schema:
  938. $ref: '#/definitions/dto.ErrorResponse'
  939. "500":
  940. description: Internal Server Error
  941. schema:
  942. $ref: '#/definitions/dto.ErrorResponse'
  943. security:
  944. - APIKey: []
  945. summary: Get thing tags
  946. tags:
  947. - Tags
  948. /api/v1/things:
  949. post:
  950. consumes:
  951. - application/json
  952. parameters:
  953. - description: Request body
  954. in: body
  955. name: data
  956. required: true
  957. schema:
  958. $ref: '#/definitions/dto.AddThingRequest'
  959. produces:
  960. - application/json
  961. responses:
  962. "200":
  963. description: OK
  964. schema:
  965. $ref: '#/definitions/dto.ThingResponse'
  966. "400":
  967. description: Bad Request
  968. schema:
  969. $ref: '#/definitions/dto.ErrorResponse'
  970. "500":
  971. description: Internal Server Error
  972. schema:
  973. $ref: '#/definitions/dto.ErrorResponse'
  974. security:
  975. - APIKey: []
  976. summary: Add thing
  977. tags:
  978. - Things
  979. /api/v1/things/{thingId}:
  980. delete:
  981. consumes:
  982. - application/json
  983. parameters:
  984. - description: Thing ID
  985. in: path
  986. name: thingId
  987. required: true
  988. type: integer
  989. produces:
  990. - application/json
  991. responses:
  992. "200":
  993. description: OK
  994. schema:
  995. $ref: '#/definitions/dto.EmptyResponse'
  996. "400":
  997. description: Bad Request
  998. schema:
  999. $ref: '#/definitions/dto.ErrorResponse'
  1000. "500":
  1001. description: Internal Server Error
  1002. schema:
  1003. $ref: '#/definitions/dto.ErrorResponse'
  1004. security:
  1005. - APIKey: []
  1006. summary: Delete thing
  1007. tags:
  1008. - Things
  1009. get:
  1010. consumes:
  1011. - application/json
  1012. parameters:
  1013. - description: Thing ID
  1014. in: path
  1015. name: thingId
  1016. required: true
  1017. type: integer
  1018. produces:
  1019. - application/json
  1020. responses:
  1021. "200":
  1022. description: OK
  1023. schema:
  1024. $ref: '#/definitions/dto.ThingResponse'
  1025. "400":
  1026. description: Bad Request
  1027. schema:
  1028. $ref: '#/definitions/dto.ErrorResponse'
  1029. "404":
  1030. description: Not Found
  1031. schema:
  1032. $ref: '#/definitions/dto.EmptyResponse'
  1033. "500":
  1034. description: Internal Server Error
  1035. schema:
  1036. $ref: '#/definitions/dto.ErrorResponse'
  1037. security:
  1038. - APIKey: []
  1039. summary: Get one thing
  1040. tags:
  1041. - Things
  1042. put:
  1043. consumes:
  1044. - application/json
  1045. parameters:
  1046. - description: Thing ID
  1047. in: path
  1048. name: thingId
  1049. required: true
  1050. type: integer
  1051. - description: Request body
  1052. in: body
  1053. name: data
  1054. required: true
  1055. schema:
  1056. $ref: '#/definitions/dto.UpdateThingRequest'
  1057. produces:
  1058. - application/json
  1059. responses:
  1060. "200":
  1061. description: OK
  1062. schema:
  1063. $ref: '#/definitions/dto.ThingResponse'
  1064. "400":
  1065. description: Bad Request
  1066. schema:
  1067. $ref: '#/definitions/dto.ErrorResponse'
  1068. "500":
  1069. description: Internal Server Error
  1070. schema:
  1071. $ref: '#/definitions/dto.ErrorResponse'
  1072. security:
  1073. - APIKey: []
  1074. summary: Update thing
  1075. tags:
  1076. - Things
  1077. /api/v1/things/notifications:
  1078. post:
  1079. consumes:
  1080. - application/json
  1081. parameters:
  1082. - description: Request body
  1083. in: body
  1084. name: data
  1085. required: true
  1086. schema:
  1087. $ref: '#/definitions/dto.AddThingNotificationRequest'
  1088. produces:
  1089. - application/json
  1090. responses:
  1091. "200":
  1092. description: OK
  1093. schema:
  1094. $ref: '#/definitions/dto.ThingNotificationResponse'
  1095. "400":
  1096. description: Bad Request
  1097. schema:
  1098. $ref: '#/definitions/dto.ErrorResponse'
  1099. "500":
  1100. description: Internal Server Error
  1101. schema:
  1102. $ref: '#/definitions/dto.ErrorResponse'
  1103. security:
  1104. - APIKey: []
  1105. summary: Add thing notification
  1106. tags:
  1107. - Notifications
  1108. /api/v1/things/notifications/{thingId}:
  1109. delete:
  1110. consumes:
  1111. - application/json
  1112. parameters:
  1113. - description: Thing ID
  1114. in: path
  1115. name: thingId
  1116. required: true
  1117. type: integer
  1118. produces:
  1119. - application/json
  1120. responses:
  1121. "200":
  1122. description: OK
  1123. schema:
  1124. $ref: '#/definitions/dto.EmptyResponse'
  1125. "400":
  1126. description: Bad Request
  1127. schema:
  1128. $ref: '#/definitions/dto.ErrorResponse'
  1129. "500":
  1130. description: Internal Server Error
  1131. schema:
  1132. $ref: '#/definitions/dto.ErrorResponse'
  1133. security:
  1134. - APIKey: []
  1135. summary: Delete thing notification
  1136. tags:
  1137. - Notifications
  1138. get:
  1139. consumes:
  1140. - application/json
  1141. parameters:
  1142. - description: Thing ID
  1143. in: path
  1144. name: thingId
  1145. required: true
  1146. type: integer
  1147. produces:
  1148. - application/json
  1149. responses:
  1150. "200":
  1151. description: OK
  1152. schema:
  1153. $ref: '#/definitions/dto.ThingNotificationResponse'
  1154. "400":
  1155. description: Bad Request
  1156. schema:
  1157. $ref: '#/definitions/dto.ErrorResponse'
  1158. "404":
  1159. description: Not Found
  1160. schema:
  1161. $ref: '#/definitions/dto.EmptyResponse'
  1162. "500":
  1163. description: Internal Server Error
  1164. schema:
  1165. $ref: '#/definitions/dto.ErrorResponse'
  1166. security:
  1167. - APIKey: []
  1168. summary: Get thing notification
  1169. tags:
  1170. - Notifications
  1171. put:
  1172. consumes:
  1173. - application/json
  1174. parameters:
  1175. - description: Thing ID
  1176. in: path
  1177. name: thingId
  1178. required: true
  1179. type: integer
  1180. - description: Request body
  1181. in: body
  1182. name: data
  1183. required: true
  1184. schema:
  1185. $ref: '#/definitions/dto.UpdateThingNotificationRequest'
  1186. produces:
  1187. - application/json
  1188. responses:
  1189. "200":
  1190. description: OK
  1191. schema:
  1192. $ref: '#/definitions/dto.ThingNotificationResponse'
  1193. "400":
  1194. description: Bad Request
  1195. schema:
  1196. $ref: '#/definitions/dto.ErrorResponse'
  1197. "500":
  1198. description: Internal Server Error
  1199. schema:
  1200. $ref: '#/definitions/dto.ErrorResponse'
  1201. security:
  1202. - APIKey: []
  1203. summary: Update thing notification
  1204. tags:
  1205. - Notifications
  1206. /api/v1/things/notifications/expired:
  1207. get:
  1208. consumes:
  1209. - application/json
  1210. produces:
  1211. - application/json
  1212. responses:
  1213. "200":
  1214. description: OK
  1215. schema:
  1216. $ref: '#/definitions/dto.ThingNotificationsExtResponse'
  1217. "400":
  1218. description: Bad Request
  1219. schema:
  1220. $ref: '#/definitions/dto.ErrorResponse'
  1221. "500":
  1222. description: Internal Server Error
  1223. schema:
  1224. $ref: '#/definitions/dto.ErrorResponse'
  1225. security:
  1226. - APIKey: []
  1227. summary: Get expired thing notifications
  1228. tags:
  1229. - Notifications
  1230. /api/v1/things/place/{placeId}:
  1231. get:
  1232. consumes:
  1233. - application/json
  1234. parameters:
  1235. - description: Place ID
  1236. in: path
  1237. name: placeId
  1238. required: true
  1239. type: integer
  1240. produces:
  1241. - application/json
  1242. responses:
  1243. "200":
  1244. description: OK
  1245. schema:
  1246. $ref: '#/definitions/dto.ThingsExtResponse'
  1247. "400":
  1248. description: Bad Request
  1249. schema:
  1250. $ref: '#/definitions/dto.ErrorResponse'
  1251. "500":
  1252. description: Internal Server Error
  1253. schema:
  1254. $ref: '#/definitions/dto.ErrorResponse'
  1255. security:
  1256. - APIKey: []
  1257. summary: Get things by place ID
  1258. tags:
  1259. - Things
  1260. /api/v1/things/search/{search}:
  1261. get:
  1262. consumes:
  1263. - application/json
  1264. parameters:
  1265. - description: Search string
  1266. in: path
  1267. name: search
  1268. required: true
  1269. type: string
  1270. produces:
  1271. - application/json
  1272. responses:
  1273. "200":
  1274. description: OK
  1275. schema:
  1276. $ref: '#/definitions/dto.ThingResponse'
  1277. "400":
  1278. description: Bad Request
  1279. schema:
  1280. $ref: '#/definitions/dto.ErrorResponse'
  1281. "500":
  1282. description: Internal Server Error
  1283. schema:
  1284. $ref: '#/definitions/dto.ErrorResponse'
  1285. security:
  1286. - APIKey: []
  1287. summary: Search things
  1288. tags:
  1289. - Things
  1290. /api/v1/users:
  1291. post:
  1292. consumes:
  1293. - application/json
  1294. parameters:
  1295. - description: Request body
  1296. in: body
  1297. name: data
  1298. required: true
  1299. schema:
  1300. $ref: '#/definitions/dto.AddUserRequest'
  1301. produces:
  1302. - application/json
  1303. responses:
  1304. "200":
  1305. description: OK
  1306. schema:
  1307. $ref: '#/definitions/dto.EmptyResponse'
  1308. "400":
  1309. description: Bad Request
  1310. schema:
  1311. $ref: '#/definitions/dto.ErrorResponse'
  1312. "500":
  1313. description: Internal Server Error
  1314. schema:
  1315. $ref: '#/definitions/dto.ErrorResponse'
  1316. security:
  1317. - APIKey: []
  1318. summary: Add user
  1319. tags:
  1320. - Users
  1321. put:
  1322. consumes:
  1323. - application/json
  1324. parameters:
  1325. - description: Request body
  1326. in: body
  1327. name: data
  1328. required: true
  1329. schema:
  1330. $ref: '#/definitions/dto.UpdateUserRequest'
  1331. produces:
  1332. - application/json
  1333. responses:
  1334. "200":
  1335. description: OK
  1336. schema:
  1337. $ref: '#/definitions/dto.EmptyResponse'
  1338. "400":
  1339. description: Bad Request
  1340. schema:
  1341. $ref: '#/definitions/dto.ErrorResponse'
  1342. "500":
  1343. description: Internal Server Error
  1344. schema:
  1345. $ref: '#/definitions/dto.ErrorResponse'
  1346. security:
  1347. - APIKey: []
  1348. summary: Update user
  1349. tags:
  1350. - Users
  1351. securityDefinitions:
  1352. APIKey:
  1353. in: header
  1354. name: Authorization
  1355. type: apiKey
  1356. swagger: "2.0"