modified: serv_nginx/Makefile
modified: serv_nginx/api_bb/internal/handlers/news_handler.go
This commit is contained in:
+2
-4
@@ -1,6 +1,4 @@
|
|||||||
BB=bb_api
|
all: bb api_bb_logs
|
||||||
|
|
||||||
all: bb
|
|
||||||
|
|
||||||
git:
|
git:
|
||||||
git pull
|
git pull
|
||||||
@@ -11,7 +9,7 @@ stop_bb:
|
|||||||
build_bb:
|
build_bb:
|
||||||
docker compose build api_bb --no-cache
|
docker compose build api_bb --no-cache
|
||||||
|
|
||||||
bb: git stop_bb build_bb bbb api_bb_logs
|
bb: git stop_bb build_bb bbb
|
||||||
docker compose up api_bb -d
|
docker compose up api_bb -d
|
||||||
|
|
||||||
bb_db:
|
bb_db:
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ func (h *NewsHandler) GetNewsByID(w http.ResponseWriter, r *http.Request) {
|
|||||||
func (h *NewsHandler) CreateNews(w http.ResponseWriter, r *http.Request) {
|
func (h *NewsHandler) CreateNews(w http.ResponseWriter, r *http.Request) {
|
||||||
logger.Get().Debug("Start CreateNews Method")
|
logger.Get().Debug("Start CreateNews Method")
|
||||||
userID, ok := r.Context().Value(middleware.UserIDKey).(uint)
|
userID, ok := r.Context().Value(middleware.UserIDKey).(uint)
|
||||||
|
logger.Get().Info("userID", zap.Uint("userID", userID))
|
||||||
if !ok {
|
if !ok {
|
||||||
fmt.Printf("userid %d", userID)
|
fmt.Printf("userid %d", userID)
|
||||||
utils.RespondWithError(w, http.StatusUnauthorized, "Unauthorized")
|
utils.RespondWithError(w, http.StatusUnauthorized, "Unauthorized")
|
||||||
|
|||||||
Reference in New Issue
Block a user