cmsintegrationv3

package
v0.0.0-...-e9a8072 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFMEID = errors.New("invalid fme id")

Functions

func Handler

func Handler(conf Config, g *echo.Group) error

func SetupCityItems

func SetupCityItems(ctx context.Context, s *Services, inp SetupCityItemsInput, onprogress func(i, l int, c SetupCSVItem)) error

func WebhookHandler

func WebhookHandler(conf Config) (cmswebhook.Handler, error)

Types

type CityItem

type CityItem struct {
	ID                   string                    `json:"id,omitempty" cms:"id"`
	Prefecture           string                    `json:"prefecture,omitempty" cms:"prefecture,select"`
	CityName             string                    `json:"city_name,omitempty" cms:"city_name,text"`
	CityNameEn           string                    `json:"city_name_en,omitempty" cms:"city_name_en,text"`
	CityCode             string                    `json:"city_code,omitempty" cms:"city_code,text"`
	SpecificationVersion string                    `json:"spec,omitempty" cms:"spec,select"`
	OpenDataUrl          string                    `json:"open_data_url,omitempty" cms:"open_data_url,url"`
	PRCS                 cmsintegrationcommon.PRCS `json:"prcs,omitempty" cms:"prcs,select"`
	CodeLists            string                    `json:"codelists,omitempty" cms:"codelists,asset"`
	Schemas              string                    `json:"schemas,omitempty" cms:"schemas,asset"`
	Metadata             string                    `json:"metadata,omitempty" cms:"metadata,asset"`
	Specification        string                    `json:"specification,omitempty" cms:"specification,asset"`
	References           map[string]string         `json:"references,omitempty" cms:"-"`
	RelatedDataset       string                    `json:"related_dataset,omitempty" cms:"related_dataset,reference"`
	GeospatialjpIndex    string                    `json:"geospatialjp-index,omitempty" cms:"geospatialjp-index,reference"`
	GeospatialjpData     string                    `json:"geospatialjp-data,omitempty" cms:"geospatialjp-data,reference"`
	// meatadata
	PlateauDataStatus string          `json:"plateau_data_status,omitempty" cms:"plateau_data_status,select,metadata"`
	CityPublic        bool            `json:"city_public,omitempty" cms:"city_public,bool,metadata"`
	SDKPublic         bool            `json:"sdk_public,omitempty" cms:"sdk_public,bool,metadata"`
	Public            map[string]bool `json:"public,omitempty" cms:"-"`
}

func CityItemFrom

func CityItemFrom(item *cms.Item) (i *CityItem)

func (*CityItem) CMSItem

func (i *CityItem) CMSItem() *cms.Item

type Config

type ConvertionStatus

type ConvertionStatus string
const (
	ConvertionStatusNotStarted ConvertionStatus = "未実行"
	ConvertionStatusRunning    ConvertionStatus = "実行中"
	ConvertionStatusError      ConvertionStatus = "エラー"
	ConvertionStatusSuccess    ConvertionStatus = "成功"
)

func (ConvertionStatus) String

func (s ConvertionStatus) String() string

type FeatureItem

type FeatureItem struct {
	ID          string             `json:"id,omitempty" cms:"id"`
	City        string             `json:"city,omitempty" cms:"city,reference"`
	CityGML     string             `json:"citygml,omitempty" cms:"citygml,asset"`
	Data        []string           `json:"data,omitempty" cms:"data,asset"`
	Desc        string             `json:"desc,omitempty" cms:"desc,textarea"`
	Items       []FeatureItemDatum `json:"items,omitempty" cms:"items,group"`
	QCResult    string             `json:"qcresult,omitempty" cms:"qc_result,asset"`
	SearchIndex string             `json:"search_index,omitempty" cms:"search_index,asset"`
	Dic         string             `json:"dic,omitempty" cms:"dic,textarea"`
	MaxLOD      string             `json:"maxlod,omitempty" cms:"maxlod,asset"`
	// metadata
	SkipQCConv       *cms.Tag `json:"skip_qc_conv,omitempty" cms:"skip_qc_conv,tag,metadata"`
	Status           *cms.Tag `json:"status,omitempty" cms:"status,select,metadata"`
	ConvertionStatus *cms.Tag `json:"conv_status,omitempty" cms:"conv_status,tag,metadata"`
	QCStatus         *cms.Tag `json:"qc_status,omitempty" cms:"qc_status,tag,metadata"`
	// compat
	SkipQC      bool `json:"skip_qc,omitempty" cms:"skip_qc,bool,metadata"`
	SkipConvert bool `json:"skip_conv,omitempty" cms:"skip_conv,bool,metadata"`
}

func FeatureItemFrom

func FeatureItemFrom(item *cms.Item) (i *FeatureItem)

func (*FeatureItem) CMSItem

func (i *FeatureItem) CMSItem() *cms.Item

type FeatureItemDatum

type FeatureItemDatum struct {
	ID   string   `json:"id,omitempty" cms:"id"`
	Data []string `json:"data,omitempty" cms:"data,asset"`
	Name string   `json:"name,omitempty" cms:"name,text"`
	Desc string   `json:"desc,omitempty" cms:"desc,textarea"`
	Key  string   `json:"key,omitempty" cms:"key,text"`
}

type GenericItem

type GenericItem struct {
	ID          string               `json:"id,omitempty" cms:"id"`
	City        string               `json:"city,omitempty" cms:"city,reference"`
	Name        string               `json:"name,omitempty" cms:"name,text"`
	Type        string               `json:"type,omitempty" cms:"type,text"`
	TypeEn      string               `json:"type_en,omitempty" cms:"type_en,text"`
	Datasets    []GenericItemDataset `json:"datasets,omitempty" cms:"datasets,group"`
	OpenDataUrl string               `json:"open-data-url,omitempty" cms:"open_data_url,url"`
	Year        string               `json:"year,omitempty" cms:"year,select"`
	// metadata
	Public bool `json:"public,omitempty" cms:"public,bool,metadata"`
	UseAR  bool `json:"use-ar,omitempty" cms:"use-ar,bool,metadata"`
}

func GenericItemFrom

func GenericItemFrom(item *cms.Item) (i *GenericItem)

func (*GenericItem) CMSItem

func (i *GenericItem) CMSItem() *cms.Item

type GenericItemDataset

type GenericItemDataset struct {
	ID         string `json:"id,omitempty" cms:"id"`
	Data       string `json:"data,omitempty" cms:"data,asset"`
	Desc       string `json:"desc,omitempty" cms:"desc,textarea"`
	DataURL    string `json:"url,omitempty" cms:"data_url,url"`
	DataFormat string `json:"data-format,omitempty" cms:"data_format,select"`
	LayerName  string `json:"layer-name,omitempty" cms:"layer_name,text"`
}

type GeospatialjpDataItem

type GeospatialjpDataItem struct {
	ID          string `json:"id,omitempty" cms:"id"`
	City        string `json:"city,omitempty" cms:"city,reference"`
	CityGML     string `json:"citygml,omitempty" cms:"citygml,asset"`
	PlateauData string `json:"converted-data,omitempty" cms:"plateau_data,asset"`
	RelatedData string `json:"related-data,omitempty" cms:"related_data,asset"`
	GenericData string `json:"generic-data,omitempty" cms:"generic_data,asset"`
	// metadata
	CityGMLMergeStatus        ConvertionStatus `json:"citygml_merge_status,omitempty" cms:"citygml_merge_status,select,metadata"`
	ConvertedDataMergeSatatus ConvertionStatus `json:"plateau_merge_status,omitempty" cms:"plateau_merge_status,select,metadata"`
	RelatedDataMergeStatus    ConvertionStatus `json:"related_merge_status,omitempty" cms:"related_merge_status,select,metadata"`
}

func GeospatialjpDataItemFrom

func GeospatialjpDataItemFrom(item *cms.Item) (i *GeospatialjpDataItem)

func (*GeospatialjpDataItem) CMSItem

func (i *GeospatialjpDataItem) CMSItem() *cms.Item

type GeospatialjpIndexItem

type GeospatialjpIndexItem struct {
	ID        string `json:"id,omitempty" cms:"id"`
	City      string `json:"city,omitempty" cms:"city,reference"`
	Title     string `json:"title,omitempty" cms:"title,text"`
	Desc      string `json:"desc,omitempty" cms:"desc,markdown"`
	Region    string `json:"region,omitempty" cms:"region,text"`
	Thumbnail string `json:"thumbnail,omitempty" cms:"thumbnail,asset"`
	// metadata
	Status ManagementStatus `json:"status,omitempty" cms:"status,select,metadata"`
}

func GeospatialjpIndexItemFrom

func GeospatialjpIndexItemFrom(item *cms.Item) (i *GeospatialjpIndexItem)

func (*GeospatialjpIndexItem) CMSItem

func (i *GeospatialjpIndexItem) CMSItem() *cms.Item

type ManagementStatus

type ManagementStatus string
const (
	ManagementStatusNotStarted ManagementStatus = "登録未着手"
	ManagementStatusRunning    ManagementStatus = "新規登録中"
	ManagementStatusSkip       ManagementStatus = "対象外"
	ManagementStatusDone       ManagementStatus = "登録済み"
	ManagementStatusReady      ManagementStatus = "確認可能"
)

func (ManagementStatus) String

func (s ManagementStatus) String() string

type RelatedItem

type RelatedItem struct {
	ID     string                      `json:"id,omitempty" cms:"id"`
	City   string                      `json:"city,omitempty" cms:"city,reference"`
	Items  map[string]RelatedItemDatum `json:"items,omitempty" cms:"-"`
	Merged string                      `json:"merged,omitempty" cms:"merged,asset"`
	// metadata
	ConvertStatus map[string]*cms.Tag `json:"conv_status,omitempty" cms:"-"`
	MergeStatus   *cms.Tag            `json:"merge_status,omitempty" cms:"merge_status,tag,metadata"`
	Merge         bool                `json:"merge,omitempty" cms:"merge,bool,metadata"`
}

func RelatedItemFrom

func RelatedItemFrom(item *cms.Item) (i *RelatedItem)

func (*RelatedItem) CMSItem

func (i *RelatedItem) CMSItem() *cms.Item

type RelatedItemDatum

type RelatedItemDatum struct {
	ID          string   `json:"id,omitempty" cms:"id"`
	Asset       []string `json:"asset,omitempty" cms:"asset,asset"`
	Converted   []string `json:"converted,omitempty" cms:"converted,asset"`
	Description string   `json:"description,omitempty" cms:"description,textarea"`
}

type Services

type Services struct {
	FME  fmeInterface
	CMS  cms.Interface
	HTTP *http.Client
}

func NewServices

func NewServices(c Config) (s *Services, _ error)

func (*Services) DownloadAsset

func (s *Services) DownloadAsset(ctx context.Context, assetID string) (io.ReadCloser, error)

func (*Services) DownloadAssetAsBytes

func (s *Services) DownloadAssetAsBytes(ctx context.Context, assetID string) ([]byte, error)

func (*Services) GET

func (s *Services) GET(ctx context.Context, url string) (io.ReadCloser, error)

func (*Services) GETAsBytes

func (s *Services) GETAsBytes(ctx context.Context, url string) ([]byte, error)

func (*Services) GetMainItemWithMetadata

func (s *Services) GetMainItemWithMetadata(ctx context.Context, i *cms.Item) (_ *cms.Item, err error)

func (*Services) UpdateFeatureItemStatus

func (s *Services) UpdateFeatureItemStatus(ctx context.Context, itemID string, convType fmeRequestType, status ConvertionStatus) error

func (*Services) UploadAsset

func (s *Services) UploadAsset(ctx context.Context, pid, url string) (_ string, err error)

type SetupCSVItem

type SetupCSVItem struct {
	Prefecture string   `json:"pref"`
	Name       string   `json:"city"`
	NameEn     string   `json:"city_en"`
	Code       string   `json:"city_code"`
	Features   []string `json:"features"`
}

type SetupCityItemsInput

type SetupCityItemsInput struct {
	ProjectID string    `json:"projectId"`
	DataURL   string    `json:"dataUrl"`
	DataBody  io.Reader `json:"-"`
	Force     bool      `json:"force"`
	Offset    int       `json:"offset"`
	Limit     int       `json:"limit"`
	DryRun    bool      `json:"dryrun"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL