From ecf4fabd864d676d4273490922bc897032e6e67e Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Tue, 26 Sep 2023 21:00:18 -0700 Subject: [PATCH] update project name --- .env.example | 2 +- DOCUMENTATION.md | 2 +- README.md | 2 +- api/handlers/api.go | 10 +++++----- api/handlers/booking.go | 4 ++-- api/handlers/cow.go | 6 +++--- api/handlers/device.go | 16 ++++++++-------- config/config.go | 2 +- databases/cow.go | 2 +- databases/database.go | 2 +- databases/device.go | 2 +- go.mod | 2 +- main.go | 6 +++--- models/device.go | 2 +- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.env.example b/.env.example index 726c348..135e176 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ export DB_URI=mongodb://localhost:27017 -export DB_NAME=SulliCartShare +export DB_NAME=DeviceBookingAPI export PORT=8000 export BASE_URL=localhost diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index b773fba..52e55f7 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1,2 +1,2 @@ -# SulliCartShare Documentation +# DeviceBookingAPI Documentation diff --git a/README.md b/README.md index 2aa1716..b8e33c6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# SulliCartShare +# DeviceBookingAPI Backend API to manage the data handling, and checkout services for school resources such as Laptops, IPAD carts, etc. diff --git a/api/handlers/api.go b/api/handlers/api.go index 22265db..f3e8eec 100644 --- a/api/handlers/api.go +++ b/api/handlers/api.go @@ -5,14 +5,14 @@ import ( "io" "net/http" - "github.com/SowinskiBraeden/SulliCartShare/api" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/api" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" "github.com/go-playground/validator/v10" "github.com/gorilla/mux" "go.uber.org/zap" - "github.com/SowinskiBraeden/SulliCartShare/config" - "github.com/SowinskiBraeden/SulliCartShare/databases" + "github.com/SowinskiBraeden/DeviceBookingAPI/config" + "github.com/SowinskiBraeden/DeviceBookingAPI/databases" ) var validate = validator.New() @@ -73,7 +73,7 @@ func (a *App) Initialize() error { zap.S().With(err).Error("failed to connect to database") return err } - zap.S().Info("SulliCartShare has connected to the database") + zap.S().Info("DeviceBookingAPI has connected to the database") // initialize api router a.initializeRoutes() diff --git a/api/handlers/booking.go b/api/handlers/booking.go index ca9678f..300c863 100644 --- a/api/handlers/booking.go +++ b/api/handlers/booking.go @@ -10,8 +10,8 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" - "github.com/SowinskiBraeden/SulliCartShare/config" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/config" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" "github.com/gorilla/mux" "github.com/thanhpk/randstr" ) diff --git a/api/handlers/cow.go b/api/handlers/cow.go index f223f46..5eecfa8 100644 --- a/api/handlers/cow.go +++ b/api/handlers/cow.go @@ -11,9 +11,9 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" - "github.com/SowinskiBraeden/SulliCartShare/config" - "github.com/SowinskiBraeden/SulliCartShare/databases" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/config" + "github.com/SowinskiBraeden/DeviceBookingAPI/databases" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" ) type Cow struct { diff --git a/api/handlers/device.go b/api/handlers/device.go index c034692..0c16615 100644 --- a/api/handlers/device.go +++ b/api/handlers/device.go @@ -11,16 +11,16 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" - "github.com/SowinskiBraeden/SulliCartShare/config" - "github.com/SowinskiBraeden/SulliCartShare/databases" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/config" + "github.com/SowinskiBraeden/DeviceBookingAPI/databases" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" ) type Device struct { DB databases.DeviceDatabase } -// CowHandler returns all cows +// DeviceHandler returns all cows func (d Device) DeviceHandler(w http.ResponseWriter, r *http.Request) { dbResp, err := d.DB.Find(context.TODO(), bson.M{}) if err != nil { @@ -42,7 +42,7 @@ func (d Device) DeviceHandler(w http.ResponseWriter, r *http.Request) { w.Write(b) } -// CowHandlerQuery is the same as CowHanlder, but queries a specific list of objects by Name +// DeviceHandlerQuery is the same as DeviceHandler, but queries a specific list of objects by Name func (d Device) DeviceHandlerQuery(w http.ResponseWriter, r *http.Request) { var query models.Query // Json data will represent the query model @@ -78,7 +78,7 @@ func (d Device) DeviceHandlerQuery(w http.ResponseWriter, r *http.Request) { w.Write(b) } -// CowByIDHandler returns a cow by ID +// DeviceByIDHandler returns a cow by ID func (d Device) DeviceByIDHandler(w http.ResponseWriter, r *http.Request) { deviceID := mux.Vars(r)["cow_id"] @@ -97,7 +97,7 @@ func (d Device) DeviceByIDHandler(w http.ResponseWriter, r *http.Request) { w.Write(b) } -// NewCowHandler inserts a new cow into the collection and returns a result and error +// NewDeviceHandler inserts a new cow into the collection and returns a result and error func (d Device) NewDeviceHandler(w http.ResponseWriter, r *http.Request) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) var deviceDetails models.DeviceDetails // Json data will represent the cow details model @@ -135,7 +135,7 @@ func (d Device) NewDeviceHandler(w http.ResponseWriter, r *http.Request) { w.Write(b) } -// UpdateCowHandler gets updates the data for an existing cow and returns a result and error +// UpdateDeviceHandler gets updates the data for an existing cow and returns a result and error func (d Device) UpdateDeviceHandler(w http.ResponseWriter, r *http.Request) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) var newDetails models.DeviceDetails // Json data will represent the cow details model diff --git a/config/config.go b/config/config.go index 30bbba4..4bd7ec8 100644 --- a/config/config.go +++ b/config/config.go @@ -8,7 +8,7 @@ import ( "go.uber.org/zap" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" "github.com/joho/godotenv" ) diff --git a/databases/cow.go b/databases/cow.go index 685819d..24304be 100644 --- a/databases/cow.go +++ b/databases/cow.go @@ -5,7 +5,7 @@ package databases import ( "context" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" ) const cowName = "cows" diff --git a/databases/database.go b/databases/database.go index e8ba5a4..6eebdaa 100644 --- a/databases/database.go +++ b/databases/database.go @@ -6,7 +6,7 @@ import ( "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/SowinskiBraeden/SulliCartShare/config" + "github.com/SowinskiBraeden/DeviceBookingAPI/config" ) // DatabaseHelper contains the collection and client to be used to access the methods diff --git a/databases/device.go b/databases/device.go index 6ae7491..77bb5bd 100644 --- a/databases/device.go +++ b/databases/device.go @@ -5,7 +5,7 @@ package databases import ( "context" - "github.com/SowinskiBraeden/SulliCartShare/models" + "github.com/SowinskiBraeden/DeviceBookingAPI/models" ) const deviceName = "devices" diff --git a/go.mod b/go.mod index eaced57..7e8e09e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/SowinskiBraeden/SulliCartShare +module github.com/SowinskiBraeden/DeviceBookingAPI go 1.19 diff --git a/main.go b/main.go index 7510b9a..0ab99a1 100644 --- a/main.go +++ b/main.go @@ -6,8 +6,8 @@ import ( "go.uber.org/zap" - "github.com/SowinskiBraeden/SulliCartShare/api/handlers" - "github.com/SowinskiBraeden/SulliCartShare/config" + "github.com/SowinskiBraeden/DeviceBookingAPI/api/handlers" + "github.com/SowinskiBraeden/DeviceBookingAPI/config" ) func main() { @@ -20,6 +20,6 @@ func main() { return } - zap.S().Infow("SulliCartShare is up and running", "url", a.Config.BaseURL, "port", a.Config.Port) + zap.S().Infow("DeviceBookingAPI is up and running", "url", a.Config.BaseURL, "port", a.Config.Port) log.Fatal(http.ListenAndServe(":"+a.Config.Port, a.Router)) } diff --git a/models/device.go b/models/device.go index 40b2657..d9a9996 100644 --- a/models/device.go +++ b/models/device.go @@ -8,7 +8,7 @@ type Device struct { // Device holds the structure for the Device collection in mongo type DeviceDetails struct { - Type string `json:"type" bson:"Type"` // eg. Laptop, Ipdad, etc + Type string `json:"type" bson:"Type"` // eg. Laptop, Ipad, etc Name string `json:"name" bson:"Name"` // eg. SULH-LAP-01 Parent string `json:"parent" bson:"Parent"` // Parent cow ID }