This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├──delivery // Serve content via HTTP? CLI? everything related to that should be here | |
| └── http | |
| ├── app.go // where we have our GIN app | |
| ├── app_test.go // our app tests | |
| ├── context // some gin dependencies | |
| | ├── context.go | |
| │ └── mocks | |
| │ └── Context.go | |
| ├── controllers // our controllers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package awsdynamodb | |
import ( | |
"fmt" | |
"strings" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/service/dynamodb" | |
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" | |
// the object we want to return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package usecase_test | |
import ( | |
"testing" | |
"github.com/stretchr/testify/assert" | |
// tests make you think what we want to accomplish and to design first. we know that we | |
// need some object that will hold account information even before we creating it | |
accountDomain "github.com/uniplaces/uniplaces-ap-api/domain/account" | |
"github.com/uniplaces/uniplaces-ap-api/usecase" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── delivery // Serve content via HTTP? CLI? everything related to that should be here | |
| | |
├── domain // Where we have our domain logic | |
| | |
├── infrastructure // Where we have our implementation details (Database connections, Queues, External services) | |
| | |
└── usecase // The glue between our delivery layer and our domain layer. Different | |
// Delivery mechanisms probably will have the same use cases or very similiar | |
// use cases, this allows you to use the same code for different mechanisms by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package account | |
// Account is our account domain model | |
type Account struct { | |
ID string | |
Username string | |
Type string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package repository | |
import ( | |
accountDomain "github.com/uniplaces/uniplaces-ap-api/domain/account" | |
) | |
// Account allows to interact with user account | |
type Account interface { | |
GetAccountByUsername(username string, accountType accountDomain.Type) (*accountDomain.Account, error) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package usecase | |
import ( | |
"fmt" | |
accountDomain "github.com/uniplaces/uniplaces-ap-api/domain/account" | |
"github.com/uniplaces/uniplaces-ap-api/usecase/repository" | |
) | |
// NewAccountInteractor returns initialised pointer to Account interactor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── delivery // Serve content via HTTP? CLI? everything related to that should be here | |
| | |
├── domain | |
│ └── account | |
│ └── account.go | |
| | |
├── infrastructure // Where we have our implementation details (Database connections, Queues, External services) | |
| | |
├── usecase // The glue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.uniplaces.com/accommodation/lisbon/31162?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/21533?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/25334?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/41259?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/43611?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/1169?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/452?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/43499?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/43511?move-in=2017-02-15&move-out=2018-01-01 | |
https://www.uniplaces.com/accommodation/lisbon/41500?move-in=2017-02-15&move-out=2018-01-01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 26549, | |
"accommodation_provider_id": "c92a8822-a2ad-47f9-92fb-017698291deb", | |
"score": 3, | |
"quality": 42, | |
"available_from_diff": 7, | |
"is_enquire": false | |
}, | |
{ |