fix connection

This commit is contained in:
2024-08-07 15:01:01 +02:00
parent fa6faa51c3
commit 0e3da8c8f6
6 changed files with 95 additions and 39 deletions

View File

@@ -1,44 +1,44 @@
package application
import (
"context"
"fmt"
"net/http"
"time"
// import (
// "context"
// "fmt"
// "net/http"
// "time"
silvermobi "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
"google.golang.org/protobuf/types/known/timestamppb"
)
// solidarity_service "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
// "google.golang.org/protobuf/types/known/timestamppb"
// )
func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Request) {
// func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
// if r.Method == "POST" {
departureTime := time.Now()
// departureTime := time.Now()
timestamp := timestamppb.New(departureTime)
// timestamp := timestamppb.New(departureTime)
request := &silvermobi.DriverJourneysRequest{
DepartureDate: timestamp,
Departure: &silvermobi.Feature{
Lat: 0,
Long: 0,
Address: "7 rue D",
},
}
_, err := h.services.GRPC.Silvermobi.DriverJourneys(context.TODO(), request)
// request := &solidarity_service.DriverJourneysRequest{
// DepartureDate: timestamp,
// Departure: &solidarity_service.Feature{
// Lat: 0,
// Long: 0,
// Address: "7 rue D",
// },
// }
// _, err := h.services.GRPC.SolidarityService.DriverJourneys(context.TODO(), request)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
}
// if err != nil {
// fmt.Println(err)
// w.WriteHeader(http.StatusInternalServerError)
// return
// }
// }
h.Renderer.SolidarityServiceBookingList(w, r)
}
// h.Renderer.SolidarityServiceBookingList(w, r)
// }