Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rk3 #25

Open
wants to merge 87 commits into
base: main
Choose a base branch
from
Open

Rk3 #25

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
bfae199
Добавление сессии
Mar 8, 2024
592184c
Добавлено кодирование ключа, сессии вынесены в отдельную директорию, …
Mar 9, 2024
be9edd0
Поправил session.go
Mar 11, 2024
45287ad
Format api methods responses (#12)
sp20ks Mar 13, 2024
1820ef7
Merge branch 'sessions' of https://github.com/go-park-mail-ru/2024_1_…
MrDzhofik Mar 21, 2024
e726901
Added connection to database and modified sights handler
MrDzhofik Mar 29, 2024
ba37f7b
Add sql scripts
MrDzhofik Apr 1, 2024
f3a8474
Fixed requested changes but not pure architecture
MrDzhofik Apr 1, 2024
f61f51a
Get Sight and Comments by ID is finished!
MrDzhofik Apr 2, 2024
d9eae5f
Added docker-compose
MrDzhofik Apr 4, 2024
8d08128
Add some tests for sights handler
MrDzhofik Apr 4, 2024
c9d215e
Add basic CRUD on comments
MrDzhofik Apr 5, 2024
d092ddd
HW for DBMS. Part Normalized
MrDzhofik Apr 7, 2024
618bac2
Added creation, reading and deleting of journeys
MrDzhofik Apr 8, 2024
13ebc15
Finished journey edit
MrDzhofik Apr 8, 2024
1c8e1f7
Finished journey edit and add comment username
MrDzhofik Apr 8, 2024
516b6b2
Added tests for comments and journeys
MrDzhofik Apr 8, 2024
91dc400
Add simple registration with DB
MrDzhofik Apr 9, 2024
67334c9
Add auth with db
MrDzhofik Apr 9, 2024
a781844
Add user profile GET
MrDzhofik Apr 10, 2024
acd674f
Add profile delete and fixed get journeys
MrDzhofik Apr 10, 2024
2eb3029
Return id from creating journey
MrDzhofik Apr 10, 2024
ad1089e
Add edit profile and fixed journeys
MrDzhofik Apr 10, 2024
14756f6
Add path to edit profile
MrDzhofik Apr 10, 2024
ff1881c
try to fix profile update
sp20ks Apr 10, 2024
492d534
Fixed user profile edit
MrDzhofik Apr 10, 2024
1e50b1a
added setting of environment variables for the database config
sp20ks Apr 13, 2024
4786008
fixed editing profile
sp20ks Apr 13, 2024
3e8947a
Change adding journey sight and change get comments query
MrDzhofik Apr 13, 2024
c62fc3f
added uploading files
sp20ks Apr 13, 2024
05aa165
added reset password
sp20ks Apr 14, 2024
a160eca
Add unique fields and fixed journey test
MrDzhofik Apr 14, 2024
f800d32
Change unique field
MrDzhofik Apr 14, 2024
c4f3d93
cors header fix
exg0rd Apr 14, 2024
11b07bf
cors fix
exg0rd Apr 14, 2024
23b7c18
Changed user profile
MrDzhofik Apr 14, 2024
7c8e53b
Merge branch 'improve_journey' of https://github.com/go-park-mail-ru/…
MrDzhofik Apr 14, 2024
7fca42e
fixes sight journey
exg0rd Apr 14, 2024
195c393
sql fix
exg0rd Apr 14, 2024
0992840
sql fix delete journey
exg0rd Apr 14, 2024
f3159c0
Merge branch 'improvements-of-profile-edit' into improve_journey_exg0rd
exg0rd Apr 14, 2024
38c4554
fixes
exg0rd Apr 14, 2024
1b285ad
Change edit journey
MrDzhofik Apr 14, 2024
5616594
Small fixes
MrDzhofik Apr 14, 2024
137df6d
Fixes in migrations
MrDzhofik Apr 14, 2024
4445e3e
Change erd description
MrDzhofik Apr 14, 2024
e4b4e68
journey delete fix
exg0rd Apr 14, 2024
b8a09dc
fix edit journey
exg0rd Apr 14, 2024
3b64fb9
Fixed journey and comments
MrDzhofik Apr 15, 2024
d927ca0
Fix query
MrDzhofik Apr 15, 2024
b44829b
Change city table
MrDzhofik Apr 15, 2024
52eeddf
Fixed migrations and update journey API
MrDzhofik Apr 17, 2024
97d6954
Объединил две ветки
Apr 18, 2024
c2f21c0
fixes for correct work with front
sp20ks Apr 18, 2024
f0433ed
Add sights and images
MrDzhofik Apr 19, 2024
bc6b211
Merge branch 'improve_journey_exg0rd' of https://github.com/go-park-m…
MrDzhofik Apr 19, 2024
ec83278
Add image validator and fixed an empty query for user profile
MrDzhofik Apr 19, 2024
c4c13fe
Merge remote-tracking branch 'refs/remotes/origin/image_validator' in…
Apr 19, 2024
9c4d41b
Добавил различные обновления
Apr 20, 2024
87753e2
Создал локальный redis, добавил поиск достопримечательностей по части…
Apr 27, 2024
a6e13d9
Подтянул xss защиту
Apr 27, 2024
0cda092
Change migrationsA
MrDzhofik Apr 27, 2024
a298703
Добавление отзыва
Apr 27, 2024
f0febb3
Merge remote-tracking branch 'origin/database' into database
Apr 27, 2024
4ca1940
Add queries
MrDzhofik Apr 27, 2024
f466fea
Add struct
MrDzhofik Apr 27, 2024
053b1c6
Set statistic
MrDzhofik Apr 27, 2024
fe8a0c8
Добавил много чего
Apr 27, 2024
aa83e78
Йоу
Apr 27, 2024
1a6c797
Йоу1
Apr 27, 2024
eeaaddd
Lol
MrDzhofik Apr 28, 2024
58cc8fe
Merge branch 'database' of https://github.com/go-park-mail-ru/2024_1_…
MrDzhofik Apr 28, 2024
d292459
Change migration and sightByID handler to work with longitude and lat…
MrDzhofik Apr 29, 2024
31ad62d
Fixed avatar uploads
MrDzhofik Apr 30, 2024
69a8d50
Add creating, deleting and getting albums
MrDzhofik Apr 30, 2024
25ceb1b
Addind photo with Yandex Drive was added
MrDzhofik May 3, 2024
353b453
Album view and album delete photo functions were added
MrDzhofik May 4, 2024
515e14c
Fixed router
MrDzhofik May 4, 2024
e1a8efc
Fixed getting albums
MrDzhofik May 5, 2024
183ce0c
Uploading images now is working!
MrDzhofik May 5, 2024
f21b03f
Fixed photo path
MrDzhofik May 5, 2024
230e2fd
Fixed album delete
MrDzhofik May 5, 2024
edc6630
Fixed removing photo
MrDzhofik May 5, 2024
6aab345
Fixed path for deleting photo
MrDzhofik May 5, 2024
a4179a3
Merged all branches
MrDzhofik May 6, 2024
badd8c6
Fixed photo upload
MrDzhofik May 6, 2024
8874d17
Add prometheus
MrDzhofik May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
go.work

*.env

# Images
images/
32 changes: 29 additions & 3 deletions cmd/2024_1_ResCogitans/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
package main

import (
"fmt"
"net/http"

"github.com/go-park-mail-ru/2024_1_ResCogitans/internal/config"
"github.com/go-park-mail-ru/2024_1_ResCogitans/internal/http-server/server"
"github.com/go-park-mail-ru/2024_1_ResCogitans/internal/delivery/initialization"
"github.com/go-park-mail-ru/2024_1_ResCogitans/internal/delivery/server"
"github.com/go-park-mail-ru/2024_1_ResCogitans/router"
"github.com/go-park-mail-ru/2024_1_ResCogitans/utils/logger"
"github.com/go-park-mail-ru/2024_1_ResCogitans/utils/wrapper"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

func main() {
Expand All @@ -14,13 +21,32 @@ func main() {
logger.Error("Failed to load config", "error", err)
return
}
logger.Info("Start config")

pdb, rdb, err := initialization.DataBaseInitialization()
if err != nil {
logger.Error("DataBase initialization error", "error", err)
}

logger.Info("Start config", "config", cfg)
storages := initialization.StorageInit(pdb, rdb)
usecases := initialization.UseCaseInit(storages)
handlers := initialization.HandlerInit(usecases)

router := router.SetupRouter(cfg)
prometheus.MustRegister(wrapper.RequestsTotal, wrapper.RequestDuration)

http.Handle("/api/metrics", promhttp.Handler())
http.HandleFunc("/", handler)
go http.ListenAndServe(":9090", nil)

router := router.SetupRouter(cfg, handlers)

if err := server.StartServer(router, cfg); err != nil {
logger.Error("Failed to start server", "error", err)
return
}
}

func handler(w http.ResponseWriter, r *http.Request) {
// Ваш код обработки запроса здесь
fmt.Fprintf(w, "Hello, World!")
}
2 changes: 1 addition & 1 deletion config/local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ http_server:
timeout: 4s
idle_timeout: 60s
user: "user"
password: "password"
password: "password"
Loading