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 (
"github.com/paulmach/orb"
"github.com/paulmach/orb/geojson"
"solidarity-service/servers/utils"
"solidarity-service/utils"
)
func (handler *SolidarityServiceHandler) CalculateDistanceBetweenFeatures(feature1, feature2 *geojson.Feature) int64 {

View File

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

View File

@ -9,9 +9,6 @@
package openapi
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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,9 +9,6 @@
package openapi
type Price struct {
// 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
type PunctualAvailabilitySlot struct {
// UNIX UTC timestamp in seconds.

View File

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

View File

@ -9,13 +9,10 @@
package openapi
import (
"errors"
)
type User struct {
// 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/spf13/viper"
"solidarity-service/internal"
"solidarity-service/servers/utils"
"solidarity-service/utils"
"strconv"
"strings"
"time"