refactoring fmt + moving utils

This commit is contained in:
sbouaram 2023-10-20 13:47:51 +02:00
parent 6696cd3152
commit b7bba4cdaa
25 changed files with 71 additions and 91 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/solidarity-service.iml" filepath="$PROJECT_DIR$/.idea/solidarity-service.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -3,7 +3,7 @@ package handler
import ( import (
"github.com/paulmach/orb" "github.com/paulmach/orb"
"github.com/paulmach/orb/geojson" "github.com/paulmach/orb/geojson"
"solidarity-service/servers/utils" "solidarity-service/utils"
) )
func (handler *SolidarityServiceHandler) CalculateDistanceBetweenFeatures(feature1, feature2 *geojson.Feature) int64 { func (handler *SolidarityServiceHandler) CalculateDistanceBetweenFeatures(feature1, feature2 *geojson.Feature) int64 {

View File

@ -15,7 +15,7 @@ import (
// Response return a ImplResponse struct filled // Response return a ImplResponse struct filled
func Response(code int, body interface{}) ImplResponse { func Response(code int, body interface{}) ImplResponse {
return ImplResponse { return ImplResponse{
Code: code, Code: code,
Body: body, Body: body,
} }

View File

@ -9,11 +9,7 @@
package openapi package openapi
type PassengerPost400Response struct { type PassengerPost400Response struct {
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
} }

View File

@ -9,9 +9,6 @@
package openapi package openapi
type BookingRequest struct { type BookingRequest struct {
// Booking id is common between both operators, and must be created as a [UUID](https://datatracker.ietf.org/doc/html/rfc4122) by whoever initiates the booking. Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised. // Booking id is common between both operators, and must be created as a [UUID](https://datatracker.ietf.org/doc/html/rfc4122) by whoever initiates the booking. Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised.

View File

@ -9,8 +9,6 @@
package openapi package openapi
// BookingStatus : Status of the booking. // BookingStatus : Status of the booking.
type BookingStatus string type BookingStatus string

View File

@ -9,9 +9,6 @@
package openapi package openapi
type Car struct { type Car struct {
// Model of the car. // Model of the car.

View File

@ -9,9 +9,6 @@
package openapi package openapi
type DriverPunctualAvailabilitiesRequest struct { type DriverPunctualAvailabilitiesRequest struct {
// The address or location description. // The address or location description.

View File

@ -9,9 +9,6 @@
package openapi package openapi
type DriverRegularAvailabilitiesRequest struct { type DriverRegularAvailabilitiesRequest struct {
// The address or location description. // The address or location description.

View File

@ -9,11 +9,7 @@
package openapi package openapi
type DriverTrip struct { type DriverTrip struct {
User User `json:"user"` User User `json:"user"`
Car Car `json:"car,omitempty"` Car Car `json:"car,omitempty"`

View File

@ -9,9 +9,6 @@
package openapi package openapi
type GetBookings404Response struct { type GetBookings404Response struct {
// Explain why the request couldn't be processed. // Explain why the request couldn't be processed.

View File

@ -9,9 +9,6 @@
package openapi package openapi
type JourneySchedule struct { type JourneySchedule struct {
// Passenger pickup datetime as a UNIX UTC timestamp in seconds. // Passenger pickup datetime as a UNIX UTC timestamp in seconds.

View File

@ -9,11 +9,7 @@
package openapi package openapi
type PassengerTripRequest struct { type PassengerTripRequest struct {
User User `json:"user"` User User `json:"user"`
DestinationAddress string `json:"destination_address"` DestinationAddress string `json:"destination_address"`

View File

@ -9,11 +9,7 @@
package openapi package openapi
type PostConnectionsRequest struct { type PostConnectionsRequest struct {
From User `json:"from"` From User `json:"from"`
To User `json:"to"` To User `json:"to"`

View File

@ -9,13 +9,10 @@
package openapi package openapi
import ( import (
"errors" "errors"
) )
type Preferences struct { type Preferences struct {
// If driver journey, specifies if the driver allows smoking in the car. // If driver journey, specifies if the driver allows smoking in the car.

View File

@ -9,9 +9,6 @@
package openapi package openapi
type Price struct { type Price struct {
// Either « FREE », « PAYING » or « UNKNOWN ». « UNKNOWN » is given when it should be « PAYING » but we cannot set the price yet. // Either « FREE », « PAYING » or « UNKNOWN ». « UNKNOWN » is given when it should be « PAYING » but we cannot set the price yet.

View File

@ -9,9 +9,6 @@
package openapi package openapi
type PunctualAvailabilitySlot struct { type PunctualAvailabilitySlot struct {
// UNIX UTC timestamp in seconds. // UNIX UTC timestamp in seconds.

View File

@ -9,9 +9,6 @@
package openapi package openapi
type RegularAvailabilitySlot struct { type RegularAvailabilitySlot struct {
// Day of the week for regular scheduling. // Day of the week for regular scheduling.

View File

@ -9,13 +9,10 @@
package openapi package openapi
import ( import (
"errors" "errors"
) )
type User struct { type User struct {
// User's identifier. It MUST be unique for a given `operator`. // User's identifier. It MUST be unique for a given `operator`.

View File

@ -12,7 +12,7 @@ import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/viper" "github.com/spf13/viper"
"solidarity-service/internal" "solidarity-service/internal"
"solidarity-service/servers/utils" "solidarity-service/utils"
"strconv" "strconv"
"strings" "strings"
"time" "time"