home-service

module
v0.0.0-...-c4c8597 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: MIT

README

Home-Service

Build

Установка и конфигурация

  • Склонировать репозиторий:
    git clone https://github.com/NRKA/home-service.git
    
  • Запустить docker compose из корневой директории
    docker-compose up -d
    
  • Поднятие миграции
    make migration-up
    

Использование

Сервис поддерживает 8 эндпоинтов:
  • GET /dummyLogin -- (no Auth)
  • POST /login -- (no Auth)
  • POST /register -- (no Auth)
  • GET /house/{id} -- (Auth only)
  • POST /house/{id}/subscribe -- (Auth only)
  • POST /flat/create -- (Auth only)
  • POST /house/create -- (Moderations only)
  • POST /flat/update -- (Moderations only)

CURL Запросы

dummyLogin
curl -X GET localhost:8080/dummyLogin?user_type=client -i
curl -X GET localhost:8080/dummyLogin?user_type=moderator -i
login
curl -X POST localhost:8080/login -d '{"id":id, "password":"password"}' -i
register
curl -X POST localhost:8080/register -d '{"email": "test@gmail.com","password": "Секретная строка","user_type": "moderator"}' -i
houseID
curl -X GET localhost:8080/house/id -H "Authorization: Bearer token" -i
houseID subscribe
curl -X POST localhost:8080/house/id/subscribe -d '{"email":"test@gmail.com"}' -H "Authorization: Bearer token" -i
flatCreate
curl -X POST localhost:8080/flat/create -d '{"number":123,"house_id":123,"price":123213,"rooms":4}' -H "Authorization: Bearer token" -i
houseCreate
curl -X POST localhost:8080/house/create -d '{"address":"Лесная улица, 7, Москва, 125196","year": 2000,"developer":"Мэрия города"}' -H "Authorization: Bearer token" -i
flatUpdate
curl -X POST localhost:8080/flat/update -d '{"id":123456,"status":"approved"}' -H "Authorization: Bearer token" -i

Directories

Path Synopsis
internal
app
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL