From 31495533af29ea545ce21c74447a7f42810c676e Mon Sep 17 00:00:00 2001 From: clint156 <57494808+clint156@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:58:14 -0500 Subject: [PATCH 1/5] [#100] Wayfinding Spaces and Places Floor plan end points (#101) * added building number to wayfinding, floor plan structs * set up adapter to pull floor plan data * Add Floors and Features to buildings * building features is collection of objects * caching full building list * add search endpoing and supporting data structs * updated documentation and fixed lint errors * Update changelog * update .secrets.baseline --- .secrets.baseline | 4 +- CHANGELOG.md | 6 + core/apis_client.go | 48 +++++++ core/application.go | 9 ++ core/interfaces.go | 3 + core/model/buildings.go | 28 ++++ core/model/cachedbuildings.go | 32 +++++ core/model/floorplans.go | 54 ++++++++ core/model/uiuc/buildingdata.go | 122 +++++++++++++++--- driven/uiucadapters/wayfindingadapter.go | 53 ++++++++ driver/web/adapter.go | 2 + driver/web/apis_client.go | 101 +++++++++++++++ .../docs/schemas/application/Building.yaml | 72 +++++++++++ .../schemas/application/BuildingFeature.yaml | 46 +++++++ .../schemas/application/CompactBuilding.yaml | 31 +++++ .../docs/schemas/application/Entrance.yaml | 30 +++++ .../docs/schemas/application/FloorPlan.yaml | 30 +++++ .../application/FloorPlanHighlite.yaml | 18 +++ .../schemas/application/FloorPlanMarker.yaml | 22 ++++ 19 files changed, 694 insertions(+), 17 deletions(-) create mode 100644 core/model/cachedbuildings.go create mode 100644 core/model/floorplans.go create mode 100644 driver/web/docs/schemas/application/Building.yaml create mode 100644 driver/web/docs/schemas/application/BuildingFeature.yaml create mode 100644 driver/web/docs/schemas/application/CompactBuilding.yaml create mode 100644 driver/web/docs/schemas/application/Entrance.yaml create mode 100644 driver/web/docs/schemas/application/FloorPlan.yaml create mode 100644 driver/web/docs/schemas/application/FloorPlanHighlite.yaml create mode 100644 driver/web/docs/schemas/application/FloorPlanMarker.yaml diff --git a/.secrets.baseline b/.secrets.baseline index e39317c7..eb5d6c37 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -145,7 +145,7 @@ "filename": "driver/web/adapter.go", "hashed_secret": "a7d09aaaf55864f7ce39a7715aabed433c3fe661", "is_verified": false, - "line_number": 232 + "line_number": 234 } ], "driver/web/auth.go": [ @@ -172,5 +172,5 @@ } ] }, - "generated_at": "2024-03-28T07:54:12Z" + "generated_at": "2024-06-26T14:32:05Z" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 39a2283c..bf1bf47f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Populate building number in wayfinding building end points [#100](https://github.com/rokwire/gateway-building-block/issues/100) + +### Added +- wayfinding/floorplans end point + [2.10.1] - 2024-05-22 ### Fixed - Incorrect event end times [#97](https://github.com/rokwire/gateway-building-block/issues/97) diff --git a/core/apis_client.go b/core/apis_client.go index 4295dd15..a86d64b0 100644 --- a/core/apis_client.go +++ b/core/apis_client.go @@ -17,6 +17,8 @@ package core import ( "application/core/model" "application/driven/uiucadapters" + "strings" + "time" "encoding/json" "os" @@ -99,13 +101,49 @@ func (a appClient) GetEntrance(bldgID string, adaOnly bool, latitude float64, lo } func (a appClient) GetBuildings() (*[]model.Building, error) { + retData, err := a.getCachedBuildings() + if err != nil { + return nil, err + } + return retData, nil +} + +func (a appClient) getCachedBuildings() (*[]model.Building, error) { conf, _ := a.app.GetEnvConfigs() + crntDate := time.Now() + diff := crntDate.Sub(a.app.CampusBuildings.LoadDate) + if diff.Hours() < 24 { + retData := a.app.CampusBuildings.Buildings + return &retData, nil + } + retData, err := a.LocationAdapter.GetBuildings(conf) if err != nil { return nil, err } + //any time we call out to get the list of buildings, we need to cache the results + a.app.CampusBuildings.Buildings = *retData + a.app.CampusBuildings.LoadDate = time.Now() return retData, nil +} +func (a appClient) SearchBuildings(bldgName string, returnCompact bool) (*map[string]any, error) { + allbuildings, err := a.getCachedBuildings() + if err != nil { + return nil, err + } + var retData = make(map[string]any) + for _, v := range *allbuildings { + if strings.Contains(strings.ToLower(v.Name), strings.ToLower(bldgName)) { + if returnCompact { + crntBldg := model.CompactBuilding{Name: v.Name, FullAddress: v.FullAddress, Latitude: v.Latitude, Longitude: v.Longitude, ImageURL: v.ImageURL, Number: v.Number} + retData[v.Name] = crntBldg + } else { + retData[v.Name] = v + } + } + } + return &retData, nil } func (a appClient) GetContactInfo(uin string, accessToken string, mode string) (*model.Person, int, error) { @@ -161,6 +199,16 @@ func (a appClient) GetSuccessTeam(uin string, unitid string, accesstoken string) } +func (a appClient) GetFloorPlan(buildingnumber string, floornumber string) (*model.FloorPlan, int, error) { + conf, _ := a.app.GetEnvConfigs() + + retData, err := a.LocationAdapter.GetFloorPlan(buildingnumber, floornumber, conf) + if err != nil { + return nil, 500, err + } + return retData, 200, nil +} + func (a appClient) GetPrimaryCareProvider(uin string, accesstoken string) (*[]model.SuccessTeamMember, int, error) { conf, _ := a.app.GetEnvConfigs() retData, status, err := a.SuccessTeamAdapter.GetPrimaryCareProvider(uin, accesstoken, conf) diff --git a/core/application.go b/core/application.go index a873f30f..4e121588 100644 --- a/core/application.go +++ b/core/application.go @@ -16,6 +16,7 @@ package core import ( "application/core/model" + "time" "github.com/rokwire/core-auth-library-go/v3/authutils" "github.com/rokwire/logging-library-go/v2/errors" @@ -48,6 +49,8 @@ type Application struct { System System // expose to the drivers adapters shared Shared + CampusBuildings model.CachedBuildings //caches a list of all campus building data + AppointmentAdapters map[string]Appointments //expose to the different vendor specific appointment adapters logger *logs.Logger @@ -110,5 +113,11 @@ func NewApplication(version string, build string, application.shared = newAppShared(&application) application.eventsLogic = newAppEventsLogic(&application, eventsBBAdapter, geoBBAdapter, *logger) + _, err := application.Client.GetBuildings() + if err != nil { + //set to one day ago to force a retry and refresh + application.CampusBuildings.LoadDate = time.Now().AddDate(0, 0, -1) + } + return &application } diff --git a/core/interfaces.go b/core/interfaces.go index 7b940172..e938d8ab 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -45,6 +45,8 @@ type Client interface { GetSuccessTeam(uin string, unitid string, accessToken string) (*model.SuccessTeam, int, error) GetPrimaryCareProvider(uin string, accessToken string) (*[]model.SuccessTeamMember, int, error) GetAcademicAdvisors(uin string, unitid string, accessToken string) (*[]model.SuccessTeamMember, int, error) + GetFloorPlan(buildingnumber string, floornumber string) (*model.FloorPlan, int, error) + SearchBuildings(bldgName string, returnCompact bool) (*map[string]any, error) } // Admin exposes administrative APIs for the driver adapters @@ -184,6 +186,7 @@ type WayFinding interface { GetEntrance(bldgID string, adaAccessibleOnly bool, latitude float64, longitude float64, conf *model.EnvConfigData) (*model.Entrance, error) GetBuildings(conf *model.EnvConfigData) (*[]model.Building, error) GetBuilding(bldgID string, adaAccessibleOnly bool, latitude float64, longitude float64, conf *model.EnvConfigData) (*model.Building, error) + GetFloorPlan(bldgNum string, floornumber string, conf *model.EnvConfigData) (*model.FloorPlan, error) } // Appointments represents the adapter needed to interace with various appoinment data providers diff --git a/core/model/buildings.go b/core/model/buildings.go index d6f84e3f..1a56968c 100644 --- a/core/model/buildings.go +++ b/core/model/buildings.go @@ -50,4 +50,32 @@ type Building struct { Entrances []Entrance Latitude float64 Longitude float64 + Floors []string + Features []BuildingFeature +} + +// CompactBuilding represents minimal building informaiton needed to display a builgins details on the details panel +type CompactBuilding struct { + ID string + Name string + Number string + FullAddress string + ImageURL string + Latitude float64 + Longitude float64 +} + +// BuildingFeature represents a feature found in buildings +type BuildingFeature struct { + ID string `json:"_id" bson:"_id"` + BuildingID string `json:"building_id" bson:"building_id"` + EQIndicator string `json:"eq_indicator" bson:"eq_indicator"` + Name string `json:"name" bson:"name"` + FoundOnFloor string `json:"found_on_floor" bson:"found_on_floor"` + FoundInRoom string `json:"found_in_room" bson:"found_in_room"` + IsADA bool `json:"is_ada" bson:"is_ada"` + IsExternal bool `json:"is_external" bson:"is_external"` + Comments string `json:"comments" bson:"comments"` + Latitude float64 `json:"latitude" bson:"latitude"` + Longitude float64 `json:"longitude" bson:"longitude"` } diff --git a/core/model/cachedbuildings.go b/core/model/cachedbuildings.go new file mode 100644 index 00000000..eca18601 --- /dev/null +++ b/core/model/cachedbuildings.go @@ -0,0 +1,32 @@ +// Copyright 2022 Board of Trustees of the University of Illinois. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package model + +import ( + "time" + + "github.com/rokwire/logging-library-go/v2/logutils" +) + +const ( + //TypeCachedBuildings type + TypeCachedBuildings logutils.MessageDataType = "cached buildings" +) + +// CachedBuildings holds the building information from the building adapter +type CachedBuildings struct { + Buildings []Building `json:"buildings" bson:"buildings"` + LoadDate time.Time `json:"load_date" bson:"load_date"` +} diff --git a/core/model/floorplans.go b/core/model/floorplans.go new file mode 100644 index 00000000..e77e50a2 --- /dev/null +++ b/core/model/floorplans.go @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2020 Board of Trustees of the University of Illinois. +* All rights reserved. + +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at + +* http://www.apache.org/licenses/LICENSE-2.0 + +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. + */ + +package model + +import ( + "github.com/rokwire/logging-library-go/v2/logutils" +) + +const ( + //TypeFloorPlan type + TypeFloorPlan logutils.MessageDataType = "bldg floor plan" +) + +// FloorPlanMarker respresents a floor plan marker +type FloorPlanMarker struct { + RenderID string `json:"_id" bson:"_id"` + Label string `json:"label" bson:"label"` + Description string `json:"description" bson:"description"` + Display string `json:"display" bson:"display"` + Icon string `json:"icon" bson:"icon"` +} + +// FloorPlanHighlite represents a floor plan highlight +type FloorPlanHighlite struct { + RenderID string `json:"_id" bson:"_id"` + Label string `json:"label" bson:"label"` + Color string `json:"color" bson:"color"` + Display string `json:"display" bson:"display"` +} + +// FloorPlan represents a floor plan object +type FloorPlan struct { + BuildingNumber string `json:"building_number" bson:"building_number"` + BuildingFloor string `json:"building_floor" bson:"building_floor"` + SVGEncoding string `json:"svg_encoding" bson:"svg_encoding"` + SVG string `json:"svg" bson:"svg"` + Markers []FloorPlanMarker `json:"markers" bson:"markers"` + Highlites []FloorPlanHighlite `json:"highlites" bson:"highlites"` +} diff --git a/core/model/uiuc/buildingdata.go b/core/model/uiuc/buildingdata.go index 11c9f396..7565b9bb 100644 --- a/core/model/uiuc/buildingdata.go +++ b/core/model/uiuc/buildingdata.go @@ -16,6 +16,7 @@ package uiuc import ( model "application/core/model" + "strconv" ) // CampusEntrance representes a campus specific building entrance @@ -31,20 +32,37 @@ type CampusEntrance struct { // CampusBuilding represents a campus specific building type CampusBuilding struct { - UUID string `json:"uuid"` - Name string `json:"name"` - Number string `json:"number"` - FullAddress string `json:"location"` - Address1 string `json:"address_1"` - Address2 string `json:"address_2"` - City string `json:"city"` - State string `json:"state"` - ZipCode string `json:"zipcode"` - ImageURL string `json:"image"` - MailCode string `json:"mailcode"` - Entrances []CampusEntrance `json:"entrances"` - Latitude float64 `json:"building_centroid_latitude"` - Longitude float64 `json:"building_centroid_longitude"` + UUID string `json:"uuid"` + Name string `json:"name"` + Number string `json:"number"` + FullAddress string `json:"location"` + Address1 string `json:"address_1"` + Address2 string `json:"address_2"` + City string `json:"city"` + State string `json:"state"` + ZipCode string `json:"zipcode"` + ImageURL string `json:"image"` + MailCode string `json:"mailcode"` + Entrances []CampusEntrance `json:"entrances"` + Latitude float64 `json:"building_centroid_latitude"` + Longitude float64 `json:"building_centroid_longitude"` + Floors []string `json:"floor_ids"` + Features []CampusBuildingFeature `'json:"features"` +} + +// CampusBuildingFeature represents a UIUC specific representation of features found in buildings +type CampusBuildingFeature struct { + ID string `json:"uuid"` + BuildingID int `json:"fk_building_id"` + EQIndicator string `json:"eq_indicator"` + Name string `json:"name"` + FoundOnFloor string `json:"found_on_floor"` + FoundInRoom string `json:"found_in_room"` + IsADA bool `json:"is_ada"` + IsExternal bool `json:"is_external"` + Comments string `json:"comments"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` } // ServerResponse represents a UIUC specific server response @@ -57,22 +75,89 @@ type ServerResponse struct { ErrorMessage string `json:"error_text"` } +// CampusFloorPlanServerResponse represents a UIUC, floorplan specific server response +type CampusFloorPlanServerResponse struct { + Status string `json:"status"` + HTTPReturn int `json:"http_return"` + Collection string `json:"collection"` + CountMarkers int `json:"count_markers"` + CountHighlights int `json:"count_highights"` + CountResults int `json:"count_results"` + Errors string `json:"errors"` + ErrorText string `json:"error_text"` +} + +// CampusFloorPlanMarker respresents a UIUC floor plan marker +type CampusFloorPlanMarker struct { + RenderID string `json:"render_id"` + Label string `json:"label"` + Description string `json:"description"` + Display string `json:"display"` + Icon string `json:"icon"` +} + +// CampusFloorPlanHighlite represents a UIUC specific floor plan highlight +type CampusFloorPlanHighlite struct { + RenderID string `json:"render_id"` + Label string `json:"label"` + Color string `json:"color"` + Display string `json:"display"` +} + +// CampusFloorPlan represents a UIUC floor plan object +type CampusFloorPlan struct { + BuildingNumber string `json:"building_number"` + BuildingFloor string `json:"building_floor"` + SVGEncoding string `json:"svg_encoding"` + SVG string `json:"svg"` + Markers []CampusFloorPlanMarker `json:"markers"` + Highlites []CampusFloorPlanHighlite `json:"highlites"` +} + +// CampusFloorPlanResult represents the full data returned from UIUC when querying a floorplan +type CampusFloorPlanResult struct { + Response CampusFloorPlanServerResponse `json:"response"` + Result CampusFloorPlan `json:"results"` +} + // ServerLocationData respresnts a UIUC specific data structure for building location data type ServerLocationData struct { Response ServerResponse `json:"response"` Buildings []CampusBuilding `json:"results"` } +// NewFloorPlan creates a wayfinding floorplan instance from a UIUCFloorPlan instance +func NewFloorPlan(fp CampusFloorPlan) *model.FloorPlan { + newfp := model.FloorPlan{BuildingNumber: fp.BuildingNumber, BuildingFloor: fp.BuildingFloor, SVGEncoding: fp.SVGEncoding, SVG: fp.SVG} + for i := 0; i < len(fp.Markers); i++ { + newfp.Markers = append(newfp.Markers, model.FloorPlanMarker{RenderID: fp.Markers[i].RenderID, Label: fp.Markers[i].Label, Description: fp.Markers[i].Description, + Display: fp.Markers[i].Display, Icon: fp.Markers[i].Icon}) + } + for j := 0; j < len(fp.Highlites); j++ { + newfp.Highlites = append(newfp.Highlites, model.FloorPlanHighlite{RenderID: fp.Highlites[j].RenderID, Label: fp.Highlites[j].Label, Color: fp.Highlites[j].Color, + Display: fp.Markers[j].Display}) + } + return &newfp +} + // NewBuilding creates a wayfinding.Building instance from a campusBuilding, // including all active entrances for the building func NewBuilding(bldg CampusBuilding) *model.Building { - newBldg := model.Building{ID: bldg.UUID, Name: bldg.Name, ImageURL: bldg.ImageURL, Address1: bldg.Address1, Address2: bldg.Address2, FullAddress: bldg.FullAddress, City: bldg.City, ZipCode: bldg.ZipCode, State: bldg.State, Latitude: bldg.Latitude, Longitude: bldg.Longitude} + newBldg := model.Building{ID: bldg.UUID, Name: bldg.Name, ImageURL: bldg.ImageURL, Address1: bldg.Address1, Address2: bldg.Address2, + FullAddress: bldg.FullAddress, City: bldg.City, ZipCode: bldg.ZipCode, State: bldg.State, Latitude: bldg.Latitude, Longitude: bldg.Longitude, Number: bldg.Number} newBldg.Entrances = make([]model.Entrance, 0) for _, n := range bldg.Entrances { if n.Available { newBldg.Entrances = append(newBldg.Entrances, *NewEntrance(n)) } } + + newBldg.Floors = append(newBldg.Floors, bldg.Floors...) + for _, n := range bldg.Features { + + newBldg.Features = append(newBldg.Features, *NewFeature(n)) + } + return &newBldg } @@ -92,3 +177,10 @@ func NewEntrance(ent CampusEntrance) *model.Entrance { newEnt := model.Entrance{ID: ent.UUID, Name: ent.Name, ADACompliant: ent.ADACompliant, Available: ent.Available, ImageURL: ent.ImageURL, Latitude: ent.Latitude, Longitude: ent.Longitude} return &newEnt } + +// NewFeature creates a wayfinding.Feature instance from the campus data +func NewFeature(f CampusBuildingFeature) *model.BuildingFeature { + newFeature := model.BuildingFeature{ID: f.ID, BuildingID: strconv.Itoa(f.BuildingID), EQIndicator: f.EQIndicator, Name: f.Name, FoundOnFloor: f.FoundOnFloor, FoundInRoom: f.FoundInRoom, + IsADA: f.IsADA, IsExternal: f.IsExternal, Latitude: f.Latitude, Longitude: f.Longitude, Comments: f.Comments} + return &newFeature +} diff --git a/driven/uiucadapters/wayfindingadapter.go b/driven/uiucadapters/wayfindingadapter.go index 130ff4d9..8256ae8a 100644 --- a/driven/uiucadapters/wayfindingadapter.go +++ b/driven/uiucadapters/wayfindingadapter.go @@ -110,6 +110,20 @@ func (uwf *UIUCWayFinding) GetBuilding(bldgID string, adaAccessibleOnly bool, la return uiuc.NewBuilding((*cmpBldg)[0]), nil } +// GetFloorPlan returns the requested floor plan +func (uwf *UIUCWayFinding) GetFloorPlan(bldgNum string, floornumber string, conf *model.EnvConfigData) (*model.FloorPlan, error) { + apiURL := conf.WayFindingURL + apikey := conf.WayFindingKey + + url := apiURL + "/floorplans/number/" + bldgNum + "/floor/" + floornumber + + uiucfp, err := uwf.getFloorPlanData(url, apikey) + if err != nil { + return nil, err + } + return uiuc.NewFloorPlan(*uiucfp), nil +} + // the entrance list coming back from a ranged query to the API is sorted closest to farthest from // the user's coordinates. The first entrance in the list that is active and matches the ADA filter // will be the one to return @@ -176,3 +190,42 @@ func (uwf *UIUCWayFinding) getBuildingData(targetURL string, apikey string, quer campusBldgs := data.Buildings return &campusBldgs, nil } + +func (uwf *UIUCWayFinding) getFloorPlanData(targetURL string, apikey string) (*uiuc.CampusFloorPlan, error) { + method := "GET" + + client := &http.Client{} + req, err := http.NewRequest(method, targetURL, nil) + + if err != nil { + return nil, err + } + + req.Header.Add("Authorization", "Bearer "+apikey) + res, err := client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + + body, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + if res.StatusCode == 400 { + return nil, errors.New("bad request to api end point") + } + + data := uiuc.CampusFloorPlanResult{} + err = json.Unmarshal(body, &data) + + if err != nil { + return nil, err + } + if data.Response.Status == "failed" { + return nil, errors.New("building not found") + } + floorplan := data.Result + return &floorplan, nil +} diff --git a/driver/web/adapter.go b/driver/web/adapter.go index ff50d9de..f6aa0cc0 100644 --- a/driver/web/adapter.go +++ b/driver/web/adapter.go @@ -83,6 +83,8 @@ func (a Adapter) Start() { mainRouter.HandleFunc("/wayfinding/building", a.wrapFunc(a.clientAPIsHandler.getBuilding, a.auth.client.Standard)).Methods("GET") mainRouter.HandleFunc("/wayfinding/entrance", a.wrapFunc(a.clientAPIsHandler.getEntrance, a.auth.client.Standard)).Methods("GET") mainRouter.HandleFunc("/wayfinding/buildings", a.wrapFunc(a.clientAPIsHandler.getBuildings, a.auth.client.Standard)).Methods("GET") + mainRouter.HandleFunc("/wayfinding/floorplan", a.wrapFunc(a.clientAPIsHandler.getFloorPlan, a.auth.client.Standard)).Methods("GET") + mainRouter.HandleFunc("/wayfinding/searchbuildings", a.wrapFunc(a.clientAPIsHandler.searchBuildings, a.auth.client.Standard)).Methods("GET") mainRouter.HandleFunc("/person/contactinfo", a.wrapFunc(a.clientAPIsHandler.getContactInfo, a.auth.client.User)).Methods("GET") mainRouter.HandleFunc("/courses/giescourses", a.wrapFunc(a.clientAPIsHandler.getGiesCourses, a.auth.client.User)).Methods("GET") diff --git a/driver/web/apis_client.go b/driver/web/apis_client.go index ba945b99..6945214d 100644 --- a/driver/web/apis_client.go +++ b/driver/web/apis_client.go @@ -236,6 +236,107 @@ func (h ClientAPIsHandler) getBuildings(l *logs.Log, r *http.Request, claims *to return l.HTTPResponseSuccessJSON(resAsJSON) } +// SearchBuildings returns a list of all buildings where the name contains the search string +// @Summary Get a list of all buildings (compact or full) that matches the search string +// @Tags Client +// @ID SearchBuildings +// @Accept json +// @Produce json +// @success 200 {object} []model.Building +// @Security RokwireAuth +// @Router /wayfinding/searchbuildings [get] +// @Param name query string true "building name" +// @Param v query string true "Verbosity" +func (h ClientAPIsHandler) searchBuildings(l *logs.Log, r *http.Request, claims *tokenauth.Claims) logs.HTTPResponse { + name := "" + verbosity := "" + returncompact := true + reqParams := utils.ConstructFilter(r) + + for _, v := range reqParams.Items { + if v.Field == "name" { + name = v.Value[0] + } + if v.Field == "v" { + verbosity = v.Value[0] + } + } + if name == "" || name == "nil" { + return l.HTTPResponseErrorData(logutils.StatusInvalid, logutils.TypeQueryParam, logutils.StringArgs("name"), nil, http.StatusBadRequest, false) + } + + if verbosity == "2" { + returncompact = false + } + + bldgs, err := h.app.Client.SearchBuildings(name, returncompact) + + if err != nil { + return l.HTTPResponseErrorAction(logutils.ActionGet, model.TypeBuilding, nil, err, http.StatusInternalServerError, true) + } + + if bldgs == nil { + return l.HTTPResponseErrorAction(logutils.ActionGet, model.TypeBuilding, nil, err, http.StatusNotFound, true) + + } + resAsJSON, err := json.Marshal(bldgs) + if err != nil { + return l.HTTPResponseErrorAction(logutils.ActionMarshal, logutils.TypeResult, nil, err, http.StatusInternalServerError, false) + } + + return l.HTTPResponseSuccessJSON(resAsJSON) +} + +// GetFloorPlan returns the requested floor plan +// @Summary Return the floor plan for the floor and building specified +// @Tags Client +// @ID FloorPlan +// @Accept json +// @Produce json +// @Success 200 {object} model.FloorPlan +// @Security RokwireAuth +// @Router /wayfinding/floorplans [get] +// @Param bldgid query string true "Building Number" +// @Param floor query string true "Floor" +func (h ClientAPIsHandler) getFloorPlan(l *logs.Log, r *http.Request, claims *tokenauth.Claims) logs.HTTPResponse { + bldgid := "" + floor := "" + reqParams := utils.ConstructFilter(r) + + for _, v := range reqParams.Items { + if v.Field == "bldgid" { + bldgid = v.Value[0] + } + if v.Field == "floor" { + floor = v.Value[0] + } + } + if bldgid == "" || bldgid == "nil" { + return l.HTTPResponseErrorData(logutils.StatusInvalid, logutils.TypeQueryParam, logutils.StringArgs("bldgid"), nil, http.StatusBadRequest, false) + } + + if floor == "" || floor == "nil" { + return l.HTTPResponseErrorData(logutils.StatusInvalid, logutils.TypeQueryParam, logutils.StringArgs("floor"), nil, http.StatusBadRequest, false) + } + fp, _, err := h.app.Client.GetFloorPlan(bldgid, floor) + + if err != nil { + return l.HTTPResponseErrorAction(logutils.ActionGet, model.TypeFloorPlan, nil, err, http.StatusInternalServerError, true) + } + + if fp == nil { + return l.HTTPResponseErrorAction(logutils.ActionFind, model.TypeFloorPlan, nil, err, http.StatusNotFound, true) + + } + resAsJSON, err := json.Marshal(fp) + if err != nil { + return l.HTTPResponseErrorAction(logutils.ActionMarshal, logutils.TypeResult, nil, err, http.StatusInternalServerError, false) + } + + return l.HTTPResponseSuccessJSON(resAsJSON) + +} + // GetTermSessions returns a list of recent, current and upcoming term sessions // @Summary Get a list of term sessions centered on the calculated current session // @Tags Client diff --git a/driver/web/docs/schemas/application/Building.yaml b/driver/web/docs/schemas/application/Building.yaml new file mode 100644 index 00000000..e7046020 --- /dev/null +++ b/driver/web/docs/schemas/application/Building.yaml @@ -0,0 +1,72 @@ +type: object +required: +- ID +- Number +- Name +- FullAddress +- Address1 +- Address2 +- City +- State +- ZipCode +- ImageURL +- MailCode +- Entrances +- Latitude +- Longitude +- Floors +- Features +properties: + ID: + type: string + readOnly: true + Name: + type: string + readOnly: true + Number: + type: string + readOnly: true + FullAddress: + type: string + readOnly: true + Address1: + type: string + Address2: + type: string + readOnly: true + City: + type: string + readOnly: true + State: + type: string + readOnly: true + ZipCode: + type: string + readOnly: true + ImageURL: + type: string + readOnly: true + MailCode: + type: string + readOnly: true + Latitude: + type: number + readOnly: true + Longitude: + type: number + readOnly: true + Entrances: + type: array + items: + $ref: "./Entrance.yaml" + readOnly: true + Floors: + type: array + items: + type: string + readOnly: true + Features: + type: array + items: + $ref: "./BuildingFeature.yaml" + readOnly: true \ No newline at end of file diff --git a/driver/web/docs/schemas/application/BuildingFeature.yaml b/driver/web/docs/schemas/application/BuildingFeature.yaml new file mode 100644 index 00000000..ed580d84 --- /dev/null +++ b/driver/web/docs/schemas/application/BuildingFeature.yaml @@ -0,0 +1,46 @@ +type: object +required: +- ID +- BuildingID +- EQIndicator +- Name +- FoundOnFloor +- FoundInRoom +- IsADA +- IsExternal +- Comments +- Latitude +- Longitude +properties: + ID: + type: string + readOnly: true + BuildingID: + type: string + readOnly: true + EQIndicator: + type: string + readOnly: true + Name: + type: string + readOnly: true + FoundOnFloor: + type: string + readOnly: true + FoundInRoom: + type: string + readOnly: true + IsADA: + type: boolean + readOnly: true + IsExternal: + type: boolean + Comments: + type: string + readOnly: true + Latitude: + type: number + readOnly: true + Longitude: + type: number + readOnly: true \ No newline at end of file diff --git a/driver/web/docs/schemas/application/CompactBuilding.yaml b/driver/web/docs/schemas/application/CompactBuilding.yaml new file mode 100644 index 00000000..ed46de75 --- /dev/null +++ b/driver/web/docs/schemas/application/CompactBuilding.yaml @@ -0,0 +1,31 @@ +type: object +required: +- ID +- Number +- Name +- FullAddress +- ImageURL +- Latitude +- Longitude +properties: + ID: + type: string + readOnly: true + Name: + type: string + readOnly: true + Number: + type: string + readOnly: true + FullAddress: + type: string + readOnly: true + ImageURL: + type: string + readOnly: true + Latitude: + type: number + readOnly: true + Longitude: + type: number + readOnly: true \ No newline at end of file diff --git a/driver/web/docs/schemas/application/Entrance.yaml b/driver/web/docs/schemas/application/Entrance.yaml new file mode 100644 index 00000000..60ecfa37 --- /dev/null +++ b/driver/web/docs/schemas/application/Entrance.yaml @@ -0,0 +1,30 @@ +type: object +required: +- ID +- Name +- ADACompliant +- Available +- ImageURL +- Latitude +- Longitude +properties: + ID: + type: string + readOnly: true + Name: + type: string + readOnly: true + ADACopmliant: + type: boolean + readOnly: true + Available: + type: boolean + ImageUrl: + type: string + readOnly: true + Latitude: + type: number + readOnly: true + Longitude: + type: number + readOnly: true \ No newline at end of file diff --git a/driver/web/docs/schemas/application/FloorPlan.yaml b/driver/web/docs/schemas/application/FloorPlan.yaml new file mode 100644 index 00000000..56c301e7 --- /dev/null +++ b/driver/web/docs/schemas/application/FloorPlan.yaml @@ -0,0 +1,30 @@ +type: object +required: +- BuildingNumber +- BuildingFloor +- SVGEncoding +- SVG +- Markers +- Highlites +properties: + BuildingNumber: + type: string + readOnly: true + BuildingFloor: + type: string + readOnly: true + SVGEncoding: + type: string + readOnly: true + SVG: + type: string + Markers: + type: array + items: + $ref: "./FloorPlanMarker.yaml" + readOnly: true + Features: + type: array + items: + $ref: "./FloorPlanHighlite.yaml" + readOnly: true \ No newline at end of file diff --git a/driver/web/docs/schemas/application/FloorPlanHighlite.yaml b/driver/web/docs/schemas/application/FloorPlanHighlite.yaml new file mode 100644 index 00000000..09ded698 --- /dev/null +++ b/driver/web/docs/schemas/application/FloorPlanHighlite.yaml @@ -0,0 +1,18 @@ +type: object +required: +- RenderID +- Label +- Color +- Display +properties: + RenderID: + type: string + readOnly: true + Label: + type: string + readOnly: true + Color: + type: string + readOnly: true + Display: + type: string \ No newline at end of file diff --git a/driver/web/docs/schemas/application/FloorPlanMarker.yaml b/driver/web/docs/schemas/application/FloorPlanMarker.yaml new file mode 100644 index 00000000..fb2ece2d --- /dev/null +++ b/driver/web/docs/schemas/application/FloorPlanMarker.yaml @@ -0,0 +1,22 @@ +type: object +required: +- RenderID +- Label +- Description +- Display +- Icon +properties: + RenderID: + type: string + readOnly: true + Label: + type: string + readOnly: true + Description: + type: string + readOnly: true + Display: + type: string + Icon: + type: string + readOnly: true \ No newline at end of file From 91074ba237c6a277f0063a9224585096ffa7fe76 Mon Sep 17 00:00:00 2001 From: clint156 Date: Thu, 27 Jun 2024 15:25:40 -0500 Subject: [PATCH 2/5] Release v2.10.2 --- CHANGELOG.md | 2 +- SECURITY.md | 4 ++-- driver/web/docs/gen/def.yaml | 2 +- driver/web/docs/index.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1bf47f..ad50750d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.10.2] - 2024-06-27 ### Fixed - Populate building number in wayfinding building end points [#100](https://github.com/rokwire/gateway-building-block/issues/100) diff --git a/SECURITY.md b/SECURITY.md index 378f6303..2402c7de 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ Patches for **Gateway Building Block** in this repository will only be applied to the following versions: | Version | Supported | | ------- | ------------------ | -| 2.10.1 | :white_check_mark: | -| < 2.10.1 | :x: | +| 2.10.2 | :white_check_mark: | +| < 2.10.2 | :x: | ## Reporting a Bug or Vulnerability diff --git a/driver/web/docs/gen/def.yaml b/driver/web/docs/gen/def.yaml index a5ec2d68..bcfc1c60 100644 --- a/driver/web/docs/gen/def.yaml +++ b/driver/web/docs/gen/def.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Rokwire Gateway Building Block API description: Gateway Building Block API Documentation - version: 2.10.1 + version: 2.10.2 servers: - url: 'https://api.rokwire.illinois.edu/gateway' description: Production server diff --git a/driver/web/docs/index.yaml b/driver/web/docs/index.yaml index dc3305ea..59cd1435 100644 --- a/driver/web/docs/index.yaml +++ b/driver/web/docs/index.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Rokwire Gateway Building Block API description: Gateway Building Block API Documentation - version: 2.10.1 + version: 2.10.2 servers: - url: 'https://api.rokwire.illinois.edu/gateway' description: Production server From 24951a68daefc5b1f1539b68bc2866429d98c886 Mon Sep 17 00:00:00 2001 From: clint156 <57494808+clint156@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:37:02 -0500 Subject: [PATCH 3/5] [#103] add markers and highlites parameters to floorplans api (#104) add markers and highlites parameters to floorplans api --- CHANGELOG.md | 4 ++++ SECURITY.md | 4 ++-- core/apis_client.go | 4 ++-- core/interfaces.go | 4 ++-- core/model/uiuc/buildingdata.go | 2 +- driven/uiucadapters/wayfindingadapter.go | 17 +++++++++++++++-- driver/web/apis_client.go | 12 +++++++++++- driver/web/docs/gen/def.yaml | 2 +- driver/web/docs/index.yaml | 2 +- 9 files changed, 39 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad50750d..78e134cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.10.3] - 2024-06-28 +### Changed +- Added markers and highlites parameters to floor plans endpoint to allow client to set default state. [#103](https://github.com/rokwire/gateway-building-block/issues/103) + ## [2.10.2] - 2024-06-27 ### Fixed - Populate building number in wayfinding building end points [#100](https://github.com/rokwire/gateway-building-block/issues/100) diff --git a/SECURITY.md b/SECURITY.md index 2402c7de..c0098e4d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ Patches for **Gateway Building Block** in this repository will only be applied to the following versions: | Version | Supported | | ------- | ------------------ | -| 2.10.2 | :white_check_mark: | -| < 2.10.2 | :x: | +| 2.10.3 | :white_check_mark: | +| < 2.10.3 | :x: | ## Reporting a Bug or Vulnerability diff --git a/core/apis_client.go b/core/apis_client.go index a86d64b0..e44568d9 100644 --- a/core/apis_client.go +++ b/core/apis_client.go @@ -199,10 +199,10 @@ func (a appClient) GetSuccessTeam(uin string, unitid string, accesstoken string) } -func (a appClient) GetFloorPlan(buildingnumber string, floornumber string) (*model.FloorPlan, int, error) { +func (a appClient) GetFloorPlan(buildingnumber string, floornumber string, markers string, highlites string) (*model.FloorPlan, int, error) { conf, _ := a.app.GetEnvConfigs() - retData, err := a.LocationAdapter.GetFloorPlan(buildingnumber, floornumber, conf) + retData, err := a.LocationAdapter.GetFloorPlan(buildingnumber, floornumber, markers, highlites, conf) if err != nil { return nil, 500, err } diff --git a/core/interfaces.go b/core/interfaces.go index e938d8ab..de670d21 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -45,7 +45,7 @@ type Client interface { GetSuccessTeam(uin string, unitid string, accessToken string) (*model.SuccessTeam, int, error) GetPrimaryCareProvider(uin string, accessToken string) (*[]model.SuccessTeamMember, int, error) GetAcademicAdvisors(uin string, unitid string, accessToken string) (*[]model.SuccessTeamMember, int, error) - GetFloorPlan(buildingnumber string, floornumber string) (*model.FloorPlan, int, error) + GetFloorPlan(buildingnumber string, floornumber string, markers string, highlites string) (*model.FloorPlan, int, error) SearchBuildings(bldgName string, returnCompact bool) (*map[string]any, error) } @@ -186,7 +186,7 @@ type WayFinding interface { GetEntrance(bldgID string, adaAccessibleOnly bool, latitude float64, longitude float64, conf *model.EnvConfigData) (*model.Entrance, error) GetBuildings(conf *model.EnvConfigData) (*[]model.Building, error) GetBuilding(bldgID string, adaAccessibleOnly bool, latitude float64, longitude float64, conf *model.EnvConfigData) (*model.Building, error) - GetFloorPlan(bldgNum string, floornumber string, conf *model.EnvConfigData) (*model.FloorPlan, error) + GetFloorPlan(bldgNum string, floornumber string, markers string, highlites string, conf *model.EnvConfigData) (*model.FloorPlan, error) } // Appointments represents the adapter needed to interace with various appoinment data providers diff --git a/core/model/uiuc/buildingdata.go b/core/model/uiuc/buildingdata.go index 7565b9bb..480db710 100644 --- a/core/model/uiuc/buildingdata.go +++ b/core/model/uiuc/buildingdata.go @@ -135,7 +135,7 @@ func NewFloorPlan(fp CampusFloorPlan) *model.FloorPlan { } for j := 0; j < len(fp.Highlites); j++ { newfp.Highlites = append(newfp.Highlites, model.FloorPlanHighlite{RenderID: fp.Highlites[j].RenderID, Label: fp.Highlites[j].Label, Color: fp.Highlites[j].Color, - Display: fp.Markers[j].Display}) + Display: fp.Highlites[j].Display}) } return &newfp } diff --git a/driven/uiucadapters/wayfindingadapter.go b/driven/uiucadapters/wayfindingadapter.go index 8256ae8a..66ff4008 100644 --- a/driven/uiucadapters/wayfindingadapter.go +++ b/driven/uiucadapters/wayfindingadapter.go @@ -111,11 +111,24 @@ func (uwf *UIUCWayFinding) GetBuilding(bldgID string, adaAccessibleOnly bool, la } // GetFloorPlan returns the requested floor plan -func (uwf *UIUCWayFinding) GetFloorPlan(bldgNum string, floornumber string, conf *model.EnvConfigData) (*model.FloorPlan, error) { +func (uwf *UIUCWayFinding) GetFloorPlan(bldgNum string, floornumber string, markers string, highlites string, conf *model.EnvConfigData) (*model.FloorPlan, error) { apiURL := conf.WayFindingURL apikey := conf.WayFindingKey - + reqParams := "?" url := apiURL + "/floorplans/number/" + bldgNum + "/floor/" + floornumber + if markers != "" { + reqParams += "render_markers=" + markers + if highlites != "" { + reqParams += "&" + } + } + + if highlites != "" { + reqParams += "render_highlites=" + highlites + } + if reqParams != "?" { + url += reqParams + } uiucfp, err := uwf.getFloorPlanData(url, apikey) if err != nil { diff --git a/driver/web/apis_client.go b/driver/web/apis_client.go index 6945214d..38d20dd2 100644 --- a/driver/web/apis_client.go +++ b/driver/web/apis_client.go @@ -301,6 +301,9 @@ func (h ClientAPIsHandler) searchBuildings(l *logs.Log, r *http.Request, claims func (h ClientAPIsHandler) getFloorPlan(l *logs.Log, r *http.Request, claims *tokenauth.Claims) logs.HTTPResponse { bldgid := "" floor := "" + markers := "on" + highlites := "on" + reqParams := utils.ConstructFilter(r) for _, v := range reqParams.Items { @@ -310,6 +313,13 @@ func (h ClientAPIsHandler) getFloorPlan(l *logs.Log, r *http.Request, claims *to if v.Field == "floor" { floor = v.Value[0] } + if v.Field == "markers" { + markers = v.Value[0] + } + + if v.Field == "highlites" { + highlites = v.Value[0] + } } if bldgid == "" || bldgid == "nil" { return l.HTTPResponseErrorData(logutils.StatusInvalid, logutils.TypeQueryParam, logutils.StringArgs("bldgid"), nil, http.StatusBadRequest, false) @@ -318,7 +328,7 @@ func (h ClientAPIsHandler) getFloorPlan(l *logs.Log, r *http.Request, claims *to if floor == "" || floor == "nil" { return l.HTTPResponseErrorData(logutils.StatusInvalid, logutils.TypeQueryParam, logutils.StringArgs("floor"), nil, http.StatusBadRequest, false) } - fp, _, err := h.app.Client.GetFloorPlan(bldgid, floor) + fp, _, err := h.app.Client.GetFloorPlan(bldgid, floor, markers, highlites) if err != nil { return l.HTTPResponseErrorAction(logutils.ActionGet, model.TypeFloorPlan, nil, err, http.StatusInternalServerError, true) diff --git a/driver/web/docs/gen/def.yaml b/driver/web/docs/gen/def.yaml index bcfc1c60..2b0025c1 100644 --- a/driver/web/docs/gen/def.yaml +++ b/driver/web/docs/gen/def.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Rokwire Gateway Building Block API description: Gateway Building Block API Documentation - version: 2.10.2 + version: 2.10.3 servers: - url: 'https://api.rokwire.illinois.edu/gateway' description: Production server diff --git a/driver/web/docs/index.yaml b/driver/web/docs/index.yaml index 59cd1435..dd5c2c06 100644 --- a/driver/web/docs/index.yaml +++ b/driver/web/docs/index.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Rokwire Gateway Building Block API description: Gateway Building Block API Documentation - version: 2.10.2 + version: 2.10.3 servers: - url: 'https://api.rokwire.illinois.edu/gateway' description: Production server From dffd53f23b19e0adec5dd96d4e9576e4c09371e2 Mon Sep 17 00:00:00 2001 From: clint156 <57494808+clint156@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:06:31 -0500 Subject: [PATCH 4/5] 107 bug laundry appliance status is reported incorrectly (#108) * add unknown status from laundryview * update change log for laundryview change --- CHANGELOG.md | 4 ++++ core/model/uiuc/laundryview.go | 12 +++++++++--- driven/uiucadapters/laundryadapter.go | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78e134cd..1d6838d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unpublished] - 2024-08-26 +### Changed +- Based on data coming back from LaundryView, uiuc laundry adapter now reutrns unknown as a status when the machine is offline and the out for service flag is 0. [#107]https://github.com/rokwire/gateway-building-block/issues/107 + ## [2.10.3] - 2024-06-28 ### Changed - Added markers and highlites parameters to floor plans endpoint to allow client to set default state. [#103](https://github.com/rokwire/gateway-building-block/issues/103) diff --git a/core/model/uiuc/laundryview.go b/core/model/uiuc/laundryview.go index 4b4d2f89..9cd9b264 100644 --- a/core/model/uiuc/laundryview.go +++ b/core/model/uiuc/laundryview.go @@ -93,7 +93,7 @@ func NewLaundryRoom(id int, name string, status string, location *model.LaundryD } // NewAppliance returns an app formatted appliance ojbect from campus data -func NewAppliance(id string, appliancetype string, cycletime int, status string, timeremaining string, label string) *model.Appliance { +func NewAppliance(id string, appliancetype string, cycletime int, status string, timeremaining string, label string, outofserviceflag string) *model.Appliance { var finalStatus string switch status { @@ -101,11 +101,17 @@ func NewAppliance(id string, appliancetype string, cycletime int, status string, finalStatus = "available" case "In Use": finalStatus = "in_use" + case "Offline": + if outofserviceflag == "1" { + finalStatus = "out_of_service" + } else { + finalStatus = "unknown" + } default: - finalStatus = "out_of_service" + finalStatus = "unknown" } - if finalStatus == "available" || finalStatus == "out_of_service" { + if finalStatus == "available" || finalStatus == "out_of_service" || finalStatus == "unknown" { appl := model.Appliance{ID: id, ApplianceType: appliancetype, AverageCycleTime: cycletime, Status: finalStatus, Label: label} return &appl } diff --git a/driven/uiucadapters/laundryadapter.go b/driven/uiucadapters/laundryadapter.go index 418dd125..b17867a5 100644 --- a/driven/uiucadapters/laundryadapter.go +++ b/driven/uiucadapters/laundryadapter.go @@ -111,7 +111,7 @@ func (lv *CSCLaundryView) GetLaundryRoom(roomid string, conf *model.EnvConfigDat for i, appl := range lr.Appliances { avgCycle, _ := strconv.Atoi(appl.AvgCycleTime) - rd.Appliances[i] = uiuc.NewAppliance(appl.ApplianceKey, appl.ApplianceType, avgCycle, appl.Status, appl.TimeRemaining, appl.Label) + rd.Appliances[i] = uiuc.NewAppliance(appl.ApplianceKey, appl.ApplianceType, avgCycle, appl.Status, appl.TimeRemaining, appl.Label, appl.OutOfService) } if len(lv.laundryAssets) > 0 { From d910b331da52657c33ccf4718d40f806276260ad Mon Sep 17 00:00:00 2001 From: clint156 Date: Tue, 27 Aug 2024 09:48:55 -0500 Subject: [PATCH 5/5] Release v2.10.4 --- CHANGELOG.md | 2 +- SECURITY.md | 4 ++-- driver/web/docs/gen/def.yaml | 2 +- driver/web/docs/index.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d6838d5..fe53615b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unpublished] - 2024-08-26 +## [2.10.4] - 2024-08-26 ### Changed - Based on data coming back from LaundryView, uiuc laundry adapter now reutrns unknown as a status when the machine is offline and the out for service flag is 0. [#107]https://github.com/rokwire/gateway-building-block/issues/107 diff --git a/SECURITY.md b/SECURITY.md index c0098e4d..f45e0e79 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ Patches for **Gateway Building Block** in this repository will only be applied to the following versions: | Version | Supported | | ------- | ------------------ | -| 2.10.3 | :white_check_mark: | -| < 2.10.3 | :x: | +| 2.10.4 | :white_check_mark: | +| < 2.10.4 | :x: | ## Reporting a Bug or Vulnerability diff --git a/driver/web/docs/gen/def.yaml b/driver/web/docs/gen/def.yaml index 2b0025c1..c7807606 100644 --- a/driver/web/docs/gen/def.yaml +++ b/driver/web/docs/gen/def.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Rokwire Gateway Building Block API description: Gateway Building Block API Documentation - version: 2.10.3 + version: 2.10.4 servers: - url: 'https://api.rokwire.illinois.edu/gateway' description: Production server diff --git a/driver/web/docs/index.yaml b/driver/web/docs/index.yaml index dd5c2c06..7569f20d 100644 --- a/driver/web/docs/index.yaml +++ b/driver/web/docs/index.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Rokwire Gateway Building Block API description: Gateway Building Block API Documentation - version: 2.10.3 + version: 2.10.4 servers: - url: 'https://api.rokwire.illinois.edu/gateway' description: Production server