Skip to content

Commit

Permalink
fix: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MowlCoder committed Feb 15, 2024
1 parent 3cdad10 commit 524b162
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Accumulative Loyalty System
# 🎁 Accumulative Loyalty System

## Overview
## 💡 Overview

It is a project for Yandex Practicum course **Advanced Go developer**.

Expand All @@ -9,15 +9,15 @@ The project is divided into two parts: an accrual system and a core system.
The accrual system provides an opportunity to register information about the reward for the order and to register the order for the calculation of bonus points.

The core system allows the user to register and start registering their completed orders, then the core system accesses the accrual system to obtain the number of points to be credited to the user, as well as the user can write off the accumulated points for future orders.
## Technologies
## 💻 Technologies

- **Language:** Go

- **Database:** Postgres

- **Documentation:** Swagger 2.0

## Getting Started
## ▶️ Getting Started

To get started with the Accumulative Loyalty System, follow these steps:

Expand All @@ -41,10 +41,10 @@ go run ./cmd/gophermart/main.go
go run ./cmd/accrual/main.go
```

## Documentation
## 📝 Documentation

Documentation is available in the [docs](/docs) directory or at `/swagger/index.html` endpoint.

## Contact
## 📧 Contact

If you have any questions or need assistance, please don't hesitate to reach out at **maikezseller@gmail.com**.
5 changes: 4 additions & 1 deletion cmd/accrual/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ func makeRouter(
})

router.Route("/api/orders", func(r chi.Router) {
r.Get("/{orderID}", middlewares.NewRateLimit(2000, time.Minute*1)(http.HandlerFunc(accrualOrdersHandler.GetRegisteredOrderInfo)))
r.Get("/{orderID}", middlewares.NewRateLimit(
2000,
time.Minute*1,
)(http.HandlerFunc(accrualOrdersHandler.GetRegisteredOrderInfo)))
r.Post("/", accrualOrdersHandler.RegisterOrderForAccrual)
})

Expand Down
1 change: 0 additions & 1 deletion internal/config/accrual.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package config
import (
"flag"
"fmt"

"github.com/caarlos0/env/v9"
)

Expand Down
3 changes: 0 additions & 3 deletions internal/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ type loginResponse struct {
// @Router /login [post]
func (h *AuthHandler) Login(w http.ResponseWriter, r *http.Request) {
var body loginBody

if status, err := jsonutil.Unmarshal(w, r, &body); err != nil {
httputils.SendJSONErrorResponse(w, status, err.Error())
return
Expand All @@ -139,7 +138,6 @@ func (h *AuthHandler) Login(w http.ResponseWriter, r *http.Request) {
}

user, err := h.userService.Auth(r.Context(), body.Login, body.Password)

if err != nil {
if errors.Is(err, domain.ErrInvalidLoginOrPassword) {
httputils.SendJSONErrorResponse(w, http.StatusUnauthorized, err.Error())
Expand All @@ -151,7 +149,6 @@ func (h *AuthHandler) Login(w http.ResponseWriter, r *http.Request) {
}

accessToken, err := jwt.GenerateToken(user.ID)

if err != nil {
httputils.SendJSONErrorResponse(w, http.StatusInternalServerError, "can not generate token")
return
Expand Down

0 comments on commit 524b162

Please sign in to comment.