Support location-scoped notification subscriptions (location.feed_added)

未关闭
#1,779 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
openapi, python, yaml
领域
api, database

调研方向

Start with the API schema in docs/UserServiceAPI.yaml and the existing subscription creation and response code for POST /v1/user/subscriptions; the issue does not name the implementation files or tests. Trace how subscriptions currently reference targets, then determine how the new location join table fits the database layer. Done means the endpoint creates a subscription for the supplied location IDs and returns those IDs, with the required validation enforced in code.

由索引模型根据 Issue 内容生成。

描述

Description

location.feed_added alerts a user when a feed is added for a location they follow, so a subscription must carry the list of locations. We'll add a dedicated notification_subscription_location join table and expose the location list through the API.

Notification type in scope

Notification type Target
location.feed_added list of location IDs

Schema changes (docs/UserServiceAPI.yaml)

Add location_ids to the create request and to the subscription response:

CreateNotificationSubscriptionRequest:
  properties:
    # ...notification_id...
    location_ids:
      type: array
      items:
        type: string
      description: Location IDs to subscribe to. Required for location.feed_added.

NotificationSubscription:
  properties:
    # ...existing fields...
    location_ids:
      type: array
      items:
        type: string
      nullable: true
      description: Locations this subscription targets (location.feed_added).

Code changes

  • POST /v1/user/subscriptions creates one subscription referencing all supplied locations and returns it with location_ids populated. _Validation is enforced in code, not the schema. Per-type schema validation would need oneOf/discriminator or JSON Schema if/then/else (3.1 only; this spec is 3.0.0), and union typing was already abandoned here due to openapi-generator limitations (see docs/DatabaseCatalogAPI.yaml SearchFeedItemResult).

DB changes

Add new relation table between user subscriptions and locations

主要语言
Python
星标
34
派生
7
平均合并
3 天 34 分钟
30 天内合并 PR
8

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MobilityData/mobility-feed-api 的其他 Issue

查看 MobilityData/mobility-feed-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。