完善活动运营域与联调标准化
This commit is contained in:
@@ -16,21 +16,43 @@ type Tenant struct {
|
||||
}
|
||||
|
||||
type AdminEventRecord struct {
|
||||
ID string
|
||||
PublicID string
|
||||
TenantID *string
|
||||
TenantCode *string
|
||||
TenantName *string
|
||||
Slug string
|
||||
DisplayName string
|
||||
Summary *string
|
||||
Status string
|
||||
CurrentReleaseID *string
|
||||
CurrentReleasePubID *string
|
||||
ConfigLabel *string
|
||||
ManifestURL *string
|
||||
ManifestChecksum *string
|
||||
RouteCode *string
|
||||
ID string
|
||||
PublicID string
|
||||
TenantID *string
|
||||
TenantCode *string
|
||||
TenantName *string
|
||||
Slug string
|
||||
DisplayName string
|
||||
Summary *string
|
||||
Status string
|
||||
CurrentReleaseID *string
|
||||
CurrentReleasePubID *string
|
||||
ConfigLabel *string
|
||||
ManifestURL *string
|
||||
ManifestChecksum *string
|
||||
RouteCode *string
|
||||
PresentationID *string
|
||||
PresentationName *string
|
||||
PresentationType *string
|
||||
ContentBundleID *string
|
||||
ContentBundleName *string
|
||||
ContentEntryURL *string
|
||||
ContentAssetRootURL *string
|
||||
CurrentPresentationID *string
|
||||
CurrentPresentationName *string
|
||||
CurrentPresentationType *string
|
||||
CurrentContentBundleID *string
|
||||
CurrentContentBundleName *string
|
||||
CurrentContentEntryURL *string
|
||||
CurrentContentAssetRootURL *string
|
||||
CurrentRuntimeBindingID *string
|
||||
CurrentPlaceID *string
|
||||
CurrentMapAssetID *string
|
||||
CurrentTileReleaseID *string
|
||||
CurrentCourseSetID *string
|
||||
CurrentCourseVariantID *string
|
||||
CurrentCourseVariantName *string
|
||||
CurrentRuntimeRouteCode *string
|
||||
}
|
||||
|
||||
type CreateAdminEventParams struct {
|
||||
@@ -90,10 +112,42 @@ func (s *Store) ListAdminEvents(ctx context.Context, limit int) ([]AdminEventRec
|
||||
er.config_label,
|
||||
er.manifest_url,
|
||||
er.manifest_checksum_sha256,
|
||||
er.route_code
|
||||
er.route_code,
|
||||
ep.presentation_public_id,
|
||||
ep.name,
|
||||
ep.presentation_type,
|
||||
cb.content_bundle_public_id,
|
||||
cb.name,
|
||||
cb.entry_url,
|
||||
cb.asset_root_url,
|
||||
epc.presentation_public_id,
|
||||
epc.name,
|
||||
epc.presentation_type,
|
||||
cbc.content_bundle_public_id,
|
||||
cbc.name,
|
||||
cbc.entry_url,
|
||||
cbc.asset_root_url,
|
||||
mrb.runtime_binding_public_id,
|
||||
p.place_public_id,
|
||||
ma.map_asset_public_id,
|
||||
tr.tile_release_public_id,
|
||||
cset.course_set_public_id,
|
||||
cv.course_variant_public_id,
|
||||
cv.name,
|
||||
cv.route_code
|
||||
FROM events e
|
||||
LEFT JOIN tenants t ON t.id = e.tenant_id
|
||||
LEFT JOIN event_releases er ON er.id = e.current_release_id
|
||||
LEFT JOIN event_presentations ep ON ep.id = er.presentation_id
|
||||
LEFT JOIN content_bundles cb ON cb.id = er.content_bundle_id
|
||||
LEFT JOIN event_presentations epc ON epc.id = e.current_presentation_id
|
||||
LEFT JOIN content_bundles cbc ON cbc.id = e.current_content_bundle_id
|
||||
LEFT JOIN map_runtime_bindings mrb ON mrb.id = e.current_runtime_binding_id
|
||||
LEFT JOIN places p ON p.id = mrb.place_id
|
||||
LEFT JOIN map_assets ma ON ma.id = mrb.map_asset_id
|
||||
LEFT JOIN tile_releases tr ON tr.id = mrb.tile_release_id
|
||||
LEFT JOIN course_sets cset ON cset.id = mrb.course_set_id
|
||||
LEFT JOIN course_variants cv ON cv.id = mrb.course_variant_id
|
||||
ORDER BY e.created_at DESC
|
||||
LIMIT $1
|
||||
`, limit)
|
||||
@@ -133,10 +187,42 @@ func (s *Store) GetAdminEventByPublicID(ctx context.Context, eventPublicID strin
|
||||
er.config_label,
|
||||
er.manifest_url,
|
||||
er.manifest_checksum_sha256,
|
||||
er.route_code
|
||||
er.route_code,
|
||||
ep.presentation_public_id,
|
||||
ep.name,
|
||||
ep.presentation_type,
|
||||
cb.content_bundle_public_id,
|
||||
cb.name,
|
||||
cb.entry_url,
|
||||
cb.asset_root_url,
|
||||
epc.presentation_public_id,
|
||||
epc.name,
|
||||
epc.presentation_type,
|
||||
cbc.content_bundle_public_id,
|
||||
cbc.name,
|
||||
cbc.entry_url,
|
||||
cbc.asset_root_url,
|
||||
mrb.runtime_binding_public_id,
|
||||
p.place_public_id,
|
||||
ma.map_asset_public_id,
|
||||
tr.tile_release_public_id,
|
||||
cset.course_set_public_id,
|
||||
cv.course_variant_public_id,
|
||||
cv.name,
|
||||
cv.route_code
|
||||
FROM events e
|
||||
LEFT JOIN tenants t ON t.id = e.tenant_id
|
||||
LEFT JOIN event_releases er ON er.id = e.current_release_id
|
||||
LEFT JOIN event_presentations ep ON ep.id = er.presentation_id
|
||||
LEFT JOIN content_bundles cb ON cb.id = er.content_bundle_id
|
||||
LEFT JOIN event_presentations epc ON epc.id = e.current_presentation_id
|
||||
LEFT JOIN content_bundles cbc ON cbc.id = e.current_content_bundle_id
|
||||
LEFT JOIN map_runtime_bindings mrb ON mrb.id = e.current_runtime_binding_id
|
||||
LEFT JOIN places p ON p.id = mrb.place_id
|
||||
LEFT JOIN map_assets ma ON ma.id = mrb.map_asset_id
|
||||
LEFT JOIN tile_releases tr ON tr.id = mrb.tile_release_id
|
||||
LEFT JOIN course_sets cset ON cset.id = mrb.course_set_id
|
||||
LEFT JOIN course_variants cv ON cv.id = mrb.course_variant_id
|
||||
WHERE e.event_public_id = $1
|
||||
LIMIT 1
|
||||
`, eventPublicID)
|
||||
@@ -212,6 +298,28 @@ func scanAdminEvent(row pgx.Row) (*AdminEventRecord, error) {
|
||||
&item.ManifestURL,
|
||||
&item.ManifestChecksum,
|
||||
&item.RouteCode,
|
||||
&item.PresentationID,
|
||||
&item.PresentationName,
|
||||
&item.PresentationType,
|
||||
&item.ContentBundleID,
|
||||
&item.ContentBundleName,
|
||||
&item.ContentEntryURL,
|
||||
&item.ContentAssetRootURL,
|
||||
&item.CurrentPresentationID,
|
||||
&item.CurrentPresentationName,
|
||||
&item.CurrentPresentationType,
|
||||
&item.CurrentContentBundleID,
|
||||
&item.CurrentContentBundleName,
|
||||
&item.CurrentContentEntryURL,
|
||||
&item.CurrentContentAssetRootURL,
|
||||
&item.CurrentRuntimeBindingID,
|
||||
&item.CurrentPlaceID,
|
||||
&item.CurrentMapAssetID,
|
||||
&item.CurrentTileReleaseID,
|
||||
&item.CurrentCourseSetID,
|
||||
&item.CurrentCourseVariantID,
|
||||
&item.CurrentCourseVariantName,
|
||||
&item.CurrentRuntimeRouteCode,
|
||||
)
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return nil, nil
|
||||
@@ -240,6 +348,28 @@ func scanAdminEventFromRows(rows pgx.Rows) (*AdminEventRecord, error) {
|
||||
&item.ManifestURL,
|
||||
&item.ManifestChecksum,
|
||||
&item.RouteCode,
|
||||
&item.PresentationID,
|
||||
&item.PresentationName,
|
||||
&item.PresentationType,
|
||||
&item.ContentBundleID,
|
||||
&item.ContentBundleName,
|
||||
&item.ContentEntryURL,
|
||||
&item.ContentAssetRootURL,
|
||||
&item.CurrentPresentationID,
|
||||
&item.CurrentPresentationName,
|
||||
&item.CurrentPresentationType,
|
||||
&item.CurrentContentBundleID,
|
||||
&item.CurrentContentBundleName,
|
||||
&item.CurrentContentEntryURL,
|
||||
&item.CurrentContentAssetRootURL,
|
||||
&item.CurrentRuntimeBindingID,
|
||||
&item.CurrentPlaceID,
|
||||
&item.CurrentMapAssetID,
|
||||
&item.CurrentTileReleaseID,
|
||||
&item.CurrentCourseSetID,
|
||||
&item.CurrentCourseVariantID,
|
||||
&item.CurrentCourseVariantName,
|
||||
&item.CurrentRuntimeRouteCode,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("scan admin event row: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user