Skip to content
Snippets Groups Projects
Commit 333696b6 authored by Sercan Yesildal's avatar Sercan Yesildal
Browse files

planner models added

parent dbea03e0
No related branches found
No related tags found
No related merge requests found
services:
meal:
build: ./service/meal
ports:
- "9111:9111"
planner:
build: ./service/planner
ports:
- "8000:8000"
\ No newline at end of file
go 1.20
use ./service/meal
use (
./service/meal
./service/planner
)
......@@ -7,4 +7,4 @@ RUN go mod download
RUN go install
CMD ["meal"]
EXPOSE 8000
\ No newline at end of file
EXPOSE 9111
\ No newline at end of file
......@@ -10,7 +10,7 @@ import (
)
func main() {
port := 8000
port := 9111
router := mux.NewRouter()
router.HandleFunc("/random", handler.GetRandomMeal).Methods(http.MethodGet)
router.HandleFunc("/search/{value}", handler.SearchMealByName).Methods(http.MethodGet)
......
module gitlab.reutlingen-university.de/yesildas/mealplanner2go/service/planner
go 1.20
require github.com/gorilla/mux v1.8.0
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
)
func main() {
port := 8000
router := mux.NewRouter()
fmt.Printf("Server is listening on port :%v\n", port)
if err := http.ListenAndServe(fmt.Sprintf(":%v", port), router); err != nil {
log.Fatal(err)
}
}
package model
type Group struct {
Users []*User
}
package model
import "time"
type Meal struct {
MealId int
Date time.Time
}
type MealUser struct {
Meal
User User
}
type MealGroup struct {
Meal
Group Group
}
package model
import "time"
type ShoppingDate struct {
Date time.Time
User User
}
package model
type User struct {
Mail string
FirstName string
LastName string
}
module gitlab.reutlingen-university.de/yesildas/mealplanner2go/service/user
go 1.20
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment