connection grpc generique done
This commit is contained in:
@@ -1,25 +1,44 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
solidarity_service "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func (h *ApplicationHandler) SolidarityServiceBookingList(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
|
||||
func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if r.Method == "POST" {
|
||||
|
||||
departureTime := time.Now()
|
||||
|
||||
timestamp := timestamppb.New(departureTime)
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
h.Renderer.SolidarityServiceBookingList(w, r)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) SolidarityServiceBookingCreate(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
h.Renderer.SolidarityServiceBookingCreate(w, r )
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) SilvermobiBookingUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println("SilverBookingU")
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) SilvermobiBookingDelete(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println("SilverBookingD")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user