-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better organization;more testing on database layer
- Loading branch information
1 parent
4796691
commit b996794
Showing
19 changed files
with
147 additions
and
86 deletions.
There are no files selected for viewing
This file contains 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
4 changes: 2 additions & 2 deletions
4
...le/core/game/adapter/http/game_request.go → ...ronicle/adapter/http/game/game_request.go
This file contains 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
10 changes: 5 additions & 5 deletions
10
.../chronicle/core/game/adapter/http/http.go → ...hronicle/adapter/http/game/game_server.go
This file contains 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
This file contains 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
2 changes: 2 additions & 0 deletions
2
...nal/chronicle/adapter/persistence/postgres/sqlc/migrations/20240801202257_add_commits.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- Modify "game" table | ||
ALTER TABLE "public"."game" ADD COLUMN "game_id" uuid NOT NULL; |
3 changes: 2 additions & 1 deletion
3
internal/chronicle/adapter/persistence/postgres/sqlc/migrations/atlas.sum
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
h1:CEf8zGVDRoCvO8j5wNVaiUdVZPS797qdvMjjBfH0mx8= | ||
h1:T/g5EnXrva1cg191drI+udZPZFrrJvyKHVTqzi2C+lQ= | ||
20240731025606_initial.sql h1:/w26l6f+1wdv92vWPNgQL7T0nF+ldS2hLbYKhwij0rQ= | ||
20240801202257_add_commits.sql h1:kubjKMXhbD0PHZx7BQ7BbdmhUHzSD4yxIcVRAR5hXW8= |
This file contains 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
25 changes: 22 additions & 3 deletions
25
internal/chronicle/adapter/persistence/postgres/sqlc/repository/models.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
40 changes: 29 additions & 11 deletions
40
internal/chronicle/adapter/persistence/postgres/sqlc/repository/query.sql.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 22 additions & 1 deletion
23
internal/chronicle/adapter/persistence/postgres/sqlc/schema.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
-- Represents an overall game | ||
CREATE TABLE game ( | ||
id BIGSERIAL PRIMARY KEY, | ||
game_id uuid NOT NULL, | ||
name text NOT NULL, | ||
type text NOT NULL | ||
); | ||
); | ||
|
||
-- Represents the game world in general | ||
-- This may or may not be necessary | ||
CREATE TABLE world ( | ||
id BIGSERIAL PRIMARY KEY, | ||
world_id uuid NOT NULL, | ||
game_id BIGSERIAL NOT NULL REFERENCES game(id) | ||
); | ||
|
||
CREATE TABLE location ( | ||
ud BIGSERIAL PRIMARY KEY, | ||
location_id uuid NOT NULL, | ||
world_ID BIGSERIAL NOT NULL REFERENCES world(id), | ||
type text NOT NULL, | ||
name text NOT NULL, | ||
path ltree | ||
); | ||
|
||
create index location_path_idx on location using gist (path); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package application | ||
|
||
import ( | ||
"github.com/SomethingSexy/chronicle/internal/chronicle/core/application/command" | ||
"github.com/SomethingSexy/chronicle/internal/chronicle/port" | ||
) | ||
|
||
func NewApplication() port.ChronicleApplication { | ||
commands := port.ChronicleCommands{ | ||
CreateGame: command.NewCreateGameCommand(), | ||
} | ||
|
||
return port.ChronicleApplication{ | ||
Commands: commands, | ||
} | ||
} |
This file contains 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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
package port | ||
|
||
import "github.com/go-chi/chi/v5" | ||
import ( | ||
"github.com/SomethingSexy/chronicle/internal/chronicle/core/application/command" | ||
) | ||
|
||
// This should represent an overall service application | ||
type Service interface { | ||
Routes() []chi.Router | ||
type ChronicleApplication struct { | ||
Commands ChronicleCommands | ||
Queries GameQueries | ||
} | ||
|
||
type ChronicleCommands struct { | ||
CreateGame command.CreateGameHander | ||
} | ||
|
||
type GameQueries struct { | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package common | ||
|
||
import "github.com/go-chi/chi/v5" | ||
|
||
// This should represent an overall service application | ||
type Service interface { | ||
Routes() []chi.Router | ||
} |