fix connection
This commit is contained in:
@@ -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)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user