Coder Social home page Coder Social logo

favorites's Introduction

favorites service

Сервис для хранения избранных аптек и товаро пользователей.

From docs grpc-gateway install:

Run go mod tidy to resolve the versions.
Install by running

$ go install \
    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
    google.golang.org/protobuf/cmd/protoc-gen-go \
    google.golang.org/grpc/cmd/protoc-gen-go-grpc

This will place four binaries in your $GOBIN;

  • protoc-gen-grpc-gateway
  • protoc-gen-openapiv2
  • protoc-gen-go
  • protoc-gen-go-grpc

Make sure that your $GOBIN is in your $PATH.

tools добавлен.

Параметры берутся из файла configs/config.local.yml по умолчанию. Папку конфига и сам конфиг можно изменить с помощью флагов "config_file" и "config_dir". Пример можно посмотреть в makefile, run.

В папке docker лежит docker-compose, с помощью которого можно поднять postgres. С помощью goose можно залить миграцию.

Для работы с сервисом есть makefile.

Для тестирования добавлен postman_collection, который эмулирует запрос фронта.

Description

Сервис имеет два эндпоинта:

  • /api/favorite/v1/pharmacy - для аптек
  • /api/favorite/v1/product - для товар

Они обрабатывают только метод POST. Действия задаются с помощью query-параметров:

  • ACTION = "ADD" / "DELETE" (на данный момент сделано добавление и удаление)
  • ID = id аптеки или товара

Id пользователя передается в JWT-токене в заголовке. Есть 2 возможности передать его:

  • Bearer Token
  • Cookie "APP.token"
  • Metadata "grpcgateway-cookie: APP.token=[token]" для grpc клиента

favorites's People

Contributors

bearatol avatar

Stargazers

Antares avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.