sh0o0 / otomo

GNU Affero General Public License v3.0
1 stars 0 forks source link

Improve place details #85

Closed sh0o0 closed 1 year ago

sh0o0 commented 1 year ago

https://www.zenrin-datacom.net/solution/gmapsapi/function https://developers.google.com/maps/documentation/javascript/place-data-fields?hl=ja https://developers.google.com/maps/documentation/places/web-service/usage-and-billing?hl=ja#places-details-id-refresh

sh0o0 commented 1 year ago

Places

Firestore Model

type Message struct {
    // ...
    PlaceAnalysis *PlaceAnalysis
}

type PlaceExtraction struct {
    ProccededAt *time.Time
    Error string
    ExtractedPlaces []*ExtractedPlace
}

type ExtractedPlace struct {
    Text string
    GuessedAddress GuessedAddress
    GeocodedGooglePlaceID *string
}

type GuessedAddress struct {
    // ...
}

type Place struct {
    GooglePlaceID string
    Location Location
    BasicDetails BasicPlaceDetails
    // ContactDetails ContactPlaceDetails
    // AtmosphereDetails AtmospherePlaceDetails
    Atmosphere Atmosphere
    CreatedAt *time.Time
    UpdatedAt *time.Time
}

type Location struct {
    // ...
}

type BasicPlaceDetails struct {
    // ...
}

type ContactPlaceDetails struct {
    // ...
}

type AtmospherePlaceDetails struct {
    // ...
}

gRPC Response

message

{
  // ...
  "place_analysis": {
    "analyzed_at": "2020-01-01T00:00:00Z",
    "error": "",
    "analyzed_places": [
      {
        "text": "text",
        "guessed_address": {
          // ...
        },
        "google_place_id": "google_place_id",
        "location": {
          // ...
        }
      }
    ]
  }
}

place

{
  "google_place_id": "google_place_id",
  "location": {
    // ...
  },
  "basic_details": {
    // ...
  },
  "created_at": "2020-01-01T00:00:00Z",
  "updated_at": "2020-01-01T00:00:00Z"
}

Flows