Created
February 22, 2021 16:18
-
-
Save vkeenan/9a2e1a82fcae6beb77cd52bd4ad8edc4 to your computer and use it in GitHub Desktop.
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
package geo | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/go-openapi/runtime/middleware" | |
"taxnexus.io/geo/models" | |
"taxnexus.io/geo/restapi/operations/coordinate" | |
) | |
// GetCoordinateBasic is a handler function | |
func GetCoordinateBasic(params coordinate.GetCoordinateBasicParams, principal *app.User) middleware.Responder { | |
sugar.Debugf("geo.GetCoordinateBasic: 📥") | |
var obj *Coordinate | |
var err error | |
if params.Address != nil { | |
obj, err = determineCoordinate(*params.Address, params.Ref) | |
sugar.Infof("geo.GetCoordinateBasic: 👍 %s", *params.Address) | |
return coordinate.NewGetCoordinateBasicOK().WithPayload( | |
&models.CoordinateBasicResponse{ | |
Data: []*models.CoordinateBasic{obj.marshalToBasic()}, | |
Meta: newResponseMeta(), | |
}). | |
WithAccessControlAllowOrigin(corsOrigin). | |
WithCacheControl(cacheTime) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment