Commit Graph
112 Commits
Author SHA1 Message Date
z8jd98 3172928306 Merge remote-tracking branch 'origin/main' into devin/1793408086-goods-46-graceful-shutdown
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	api/cmd/admin/main.go
#	api/cmd/server/main.go
2026-10-31 01:39:49 +00:00
lixu 9ee2d39833 Merge pull request 'fix(api): 回流接口按 API key 限速,500 不再返回内部错误 (#43)' (#53) from devin/1793407831-goods-43-backflow-rate-safe-errors into main
Merge pull request 'fix(api): 回流接口按 API key 限速,500 不再返回内部错误 (#43)' (#53)
2026-10-31 09:30:54 +08:00
fu500fandDevin AI b6c463beab 合并最新 main
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 01:29:55 +00:00
lixu 1c78422ddd Merge pull request 'feat(admin): 登录防暴力破解、登录审计和服务端退出 (#42)' (#52) from devin/1793407649-goods-42-admin-login-hardening into main
Merge pull request 'feat(admin): 登录防暴力破解、登录审计和服务端退出 (#42)' (#52)
2026-10-31 09:28:50 +08:00
fu500fandDevin AI b4c3e22707 合并最新 main
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 01:27:10 +00:00
lixu 7693a80513 Merge pull request 'build(api): 升级 Go 1.27 与依赖,修复 5 个已知漏洞 (#41)' (#51) from devin/1793407570-goods-41-go-dependency-upgrade into main
Merge pull request 'build(api): 升级 Go 1.27 与依赖,修复 5 个已知漏洞 (#41)' (#51)
2026-10-31 09:26:27 +08:00
fu500f 8de947c4f2 合并最新 main 2026-10-31 01:24:55 +00:00
lixu f92d810605 Merge pull request 'fix(api): 后台写操作成功后刷新公开 API 缓存 (#40)' (#50) from devin/1793407455-goods-40-cache-invalidation into main
Merge pull request 'fix(api): 后台写操作成功后刷新公开 API 缓存 (#40)' (#50)
2026-10-31 09:24:34 +08:00
fu500fandDevin AI 9091dfd4c5 合并最新 main
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 01:23:44 +00:00
lixu 94549c8e2a Merge pull request 'fix(api): 客户端 IP 只信任可信代理设置的头 (#39)' (#49) from devin/1793407315-goods-39-trusted-proxy into main
Merge pull request 'fix(api): 客户端 IP 只信任可信代理设置的头 (#39)' (#49)
2026-10-31 09:22:44 +08:00
fu500f d33f74fe74 合并最新 main 2026-10-31 01:21:48 +00:00
lixu b043b9e91f Merge pull request 'fix(api): 限制公开搜索和品牌列表翻页深度 (#45)' (#55) from devin/1793407986-goods-45-search-result-window into main
Merge pull request 'fix(api): 限制公开搜索和品牌列表翻页深度 (#45)' (#55)
2026-10-31 09:20:15 +08:00
fu500fandDevin AI 3aaa7b1d0c feat(api): 增加服务优雅关闭与超时配置 (#46)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:56:16 +00:00
fu500fandDevin AI 124f14b509 fix(api): 限制公开接口分页结果窗口 (#45)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:54:37 +00:00
fu500fandDevin AI 8a29423451 fix(api): 限制回流频率并隐藏后台错误详情 (#43)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:52:20 +00:00
fu500fandDevin AI 065198f227 feat(admin): 增加登录限流、审计与令牌退出 (#42)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:50:23 +00:00
fu500fandDevin AI 45213805df build(api): 升级 Go 与依赖修复安全漏洞 (#41)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:47:21 +00:00
fu500fandDevin AI d0ad1b85f3 fix(api): 管理后台成功写入后递增缓存代次 (#40)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:45:55 +00:00
fu500fandDevin AI 667e6d0f00 fix(api): 仅信任配置的反向代理转发客户端 IP (#39)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 00:44:04 +00:00
lixu 36f9c95fa7 Merge pull request 'feat(public): 首页改为极简谷歌风格' (#38) from devin/1782372352-home-mobile-center into main
CI / Go (api) (push) Successful in 1m10s
CI / Python (ingestion) (push) Successful in 19s
CI / Migrations (postgres) (push) Successful in 26s
2026-06-25 18:11:18 +08:00
lixu 9ee83e3535 feat(public): 首页改为极简谷歌风格
CI / Go (api) (pull_request) Successful in 54s
CI / Python (ingestion) (pull_request) Successful in 16s
CI / Migrations (postgres) (pull_request) Successful in 27s
2026-06-25 10:08:56 +00:00
lixu 53ade9eeea Merge pull request 'feat(public): 首页搜索居中、移动端自适应,移除下方三卡片' (#37) from devin/1782372352-home-mobile-center into main
CI / Go (api) (push) Successful in 56s
CI / Python (ingestion) (push) Successful in 23s
CI / Migrations (postgres) (push) Successful in 27s
2026-06-25 15:28:54 +08:00
lixu 313bc84cb0 feat(public): 首页搜索居中、移动端自适应,移除下方三卡片
CI / Go (api) (pull_request) Successful in 52s
CI / Python (ingestion) (pull_request) Successful in 25s
CI / Migrations (postgres) (pull_request) Successful in 29s
2026-06-25 07:25:52 +00:00
lixu 8c8df2b8a2 Merge pull request 'fix(admin): 回流接口校验/规范化 GTIN' (#36) from devin/1782352663-backflow-gtin-validate into main
CI / Go (api) (push) Successful in 1m7s
CI / Python (ingestion) (push) Successful in 24s
CI / Migrations (postgres) (push) Successful in 25s
2026-06-25 10:00:29 +08:00
busenalbantoglu51424 f04891d0b9 fix(admin): 回流接口校验/规范化 GTIN,非法条码标记 invalid 而非中断批次
CI / Go (api) (pull_request) Successful in 56s
CI / Python (ingestion) (pull_request) Successful in 28s
CI / Migrations (postgres) (pull_request) Successful in 29s
2026-06-25 01:57:43 +00:00
lixu 3a5575f51b Merge pull request 'feat(admin): 新增档案回流接口 POST /api/public/backflow' (#35) from devin/1782350840-backflow-api into main
CI / Go (api) (push) Successful in 53s
CI / Python (ingestion) (push) Successful in 28s
CI / Migrations (postgres) (push) Successful in 47s
2026-06-25 09:52:43 +08:00
busenalbantoglu51424andDevin AI a61d1c558c docs: 补充档案回流接口调用说明(docs/api.md + 前台 API 文档页)
CI / Go (api) (pull_request) Successful in 1m2s
CI / Python (ingestion) (pull_request) Successful in 27s
CI / Migrations (postgres) (pull_request) Successful in 24s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-25 01:41:39 +00:00
busenalbantoglu51424andDevin AI e7e5ce22ab feat(admin): 新增档案回流接口 POST /api/public/backflow
CI / Go (api) (pull_request) Successful in 55s
CI / Python (ingestion) (pull_request) Successful in 16s
CI / Migrations (postgres) (pull_request) Successful in 25s
进销存软件可用公开 API Key(og_live_) 批量回流未收录商品,进入现有审核
队列,审核通过后收录。按 GTIN 去重(已收录跳过 exists,已有待审跳过
duplicate),来源标记 source=backflow,在后台队列与公众投稿区分。

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-25 01:27:31 +00:00
lixu 856b81125c Merge PR #34: public MSRP display
CI / Go (api) (push) Successful in 54s
CI / Python (ingestion) (push) Successful in 16s
CI / Migrations (postgres) (push) Successful in 26s
feat: embed MSRP in public product detail (hide zero amounts)
2026-06-25 08:59:21 +08:00
busenalbantoglu51424andDevin AI 5fe5774251 feat(public): 商品详情页展示厂商建议零售价(MSRP)
CI / Go (api) (pull_request) Successful in 1m59s
CI / Python (ingestion) (pull_request) Successful in 1m13s
CI / Migrations (postgres) (pull_request) Successful in 27s
后端 ProductByID/ProductByGTIN 在商品详情 JSON 中内嵌 msrp 字段(按 effective_date 倒序,过滤 amount=0 的无效快照);公开前台详情页新增「建议零售价」展示。

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-25 00:42:18 +00:00
lixu 0da57a2fb3 Merge pull request 'feat(admin): 新增 /api/import/bypos 导入接口(修复采集器导入失败)' (#33) from devin/1782307670-bypos-import-endpoint into main
CI / Go (api) (push) Successful in 53s
CI / Python (ingestion) (push) Successful in 16s
CI / Migrations (postgres) (push) Successful in 28s
2026-06-24 21:33:02 +08:00
rosemariejebbjtxbfpandDevin AI 85c58fbd52 feat(admin): add /api/import/bypos endpoint for bypos-collector import
CI / Go (api) (pull_request) Successful in 58s
CI / Python (ingestion) (pull_request) Successful in 16s
CI / Migrations (postgres) (pull_request) Successful in 27s
Brings the bypos JSONL import backend (handler + store) into main so the
bypos-collector tool's import feature works end-to-end. Records are upserted
on GTIN with manufacturer/MSRP/barcode/source provenance, quality recomputed
per product. Only status=hit records with a name are imported.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 13:30:27 +00:00
lixu 3aec0b84fe Merge pull request 'feat(web+api): 贡献表单按 archive_kind 动态生成字段' (#32) from devin/1782295354-contribution-form-dynamic into main
CI / Go (api) (push) Successful in 55s
CI / Python (ingestion) (push) Successful in 32s
CI / Migrations (postgres) (push) Successful in 26s
2026-06-24 18:07:05 +08:00
rosemariejebbjtxbfpandDevin AI bd1d3bde7c feat(web+api): 贡献表单按 archive_kind 动态生成字段
CI / Go (api) (pull_request) Successful in 1m3s
CI / Python (ingestion) (pull_request) Successful in 23s
CI / Migrations (postgres) (pull_request) Successful in 26s
- categories 接口返回 archive_kind
- 新增公开只读接口 /api/v1/kind-fields?kind=X 返回字段模板
- 投稿 payload 支持通用 attributes,审核通过写入 product.attributes (JSONB 合并)
- food_detail 仅在含食品数据时才 upsert (药品/3C/通用不再产生空行)
- 前端 Contribute 按所选品类 archive_kind 动态渲染字段
  (食品营养 / 药品 18 字段 / 3C / 通用),除商品名外均选填

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 10:02:46 +00:00
lixu 998471f6df Merge pull request 'feat: 新增药品(drug)商品档案格式' (#31) from devin/1782286467-drug-archive-kind into main
CI / Go (api) (push) Successful in 47s
CI / Python (ingestion) (push) Successful in 18s
CI / Migrations (postgres) (push) Successful in 27s
2026-06-24 15:39:07 +08:00
rosemariejebbjtxbfpandDevin AI 1f9b1ecd30 feat(migrations): add drug (药品) archive kind template + category subtree
CI / Go (api) (pull_request) Successful in 55s
CI / Python (ingestion) (pull_request) Successful in 23s
CI / Migrations (postgres) (pull_request) Successful in 27s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 07:36:43 +00:00
lixu 1d71617f71 Merge pull request 'chore(web): 添加微信域名校验文件' (#30) from devin/1782285002-wechat-domain-verify into main
CI / Go (api) (push) Successful in 51s
CI / Python (ingestion) (push) Successful in 30s
CI / Migrations (postgres) (push) Successful in 26s
2026-06-24 15:11:58 +08:00
rosemariejebbjtxbfpandDevin AI d18fc2470b chore(web): add WeChat domain verification file
CI / Go (api) (pull_request) Successful in 54s
CI / Python (ingestion) (pull_request) Successful in 26s
CI / Migrations (postgres) (pull_request) Successful in 27s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 07:10:07 +00:00
lixu f29696607a Merge pull request 'feat(api): Redis read cache for product details and search (stage 0)' (#29) from devin/1782283345-redis-read-cache into main
CI / Go (api) (push) Successful in 50s
CI / Python (ingestion) (push) Successful in 37s
CI / Migrations (postgres) (push) Successful in 27s
2026-06-24 14:54:59 +08:00
rosemariejebbjtxbfpandDevin AI a75318b811 feat(api): Redis read cache for product details and search
CI / Go (api) (pull_request) Successful in 54s
CI / Python (ingestion) (pull_request) Successful in 19s
CI / Migrations (postgres) (pull_request) Successful in 27s
Stage-0 caching from docs/scalability.md. The Go API now caches hot
product-detail and search-result reads in Redis with a fail-open,
epoch-versioned scheme; Python ingestion bumps the epoch after a write
run to invalidate the cache globally in O(1).

- api/internal/cache: fail-open Cache (GetJSON/SetJSON) namespaced by an
  epoch counter (og:cache:epoch); disabled when Redis is unconfigured.
- store: ProductByID/ProductByGTIN (24h TTL) and SearchProducts (1h TTL)
  read-through the cache via WithCache.
- ingestion: bump_cache_epoch() called after update_off/seed_off/
  import_bypos/dedup commits when rows changed; best-effort, never fails
  a run. Adds redis dependency.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 06:52:56 +00:00
lixu 20b9eb0fc9 Merge pull request 'ci: 修复 main 上 Python CI 历史失败(在 python3.12+node 容器内运行)' (#28) from devin/1782280936-fix-python-ci into main
CI / Go (api) (push) Successful in 54s
CI / Python (ingestion) (push) Successful in 23s
CI / Migrations (postgres) (push) Successful in 27s
2026-06-24 14:32:51 +08:00
rosemariejebbjtxbfpandDevin AI 17bc0ed680 ci: remove GitHub-hosted actions, manual checkout + Go from CN mirror
CI / Go (api) (pull_request) Successful in 51s
CI / Python (ingestion) (pull_request) Successful in 21s
CI / Migrations (postgres) (pull_request) Successful in 26s
Self-hosted Gitea runner has flaky/blocked access to github.com, causing
actions/checkout and actions/setup-go to time out intermittently across all
jobs. Replace them with:
- manual git checkout against $GITHUB_SERVER_URL (the Gitea host, reachable
  from job containers)
- Go installed from mirrors.aliyun.com

Python job stays on the python3.12-nodejs20 container (fixes the original
PEP 660 editable-install failure). No more github.com network dependency.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 06:30:03 +00:00
rosemariejebbjtxbfpandDevin AI 5020fdcc19 ci: re-trigger with public gitea actions url
CI / Go (api) (pull_request) Failing after 11s
CI / Python (ingestion) (pull_request) Failing after 31s
CI / Migrations (postgres) (pull_request) Failing after 11s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 06:24:52 +00:00
rosemariejebbjtxbfpandDevin AI 885f6c2b01 ci: re-trigger with self-hosted actions
CI / Go (api) (pull_request) Failing after 12s
CI / Python (ingestion) (pull_request) Failing after 1m31s
CI / Migrations (postgres) (pull_request) Failing after 32s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 06:21:01 +00:00
rosemariejebbjtxbfpandDevin AI 2aff6287d2 ci: re-trigger after configuring action proxy
CI / Go (api) (pull_request) Failing after 13s
CI / Python (ingestion) (pull_request) Failing after 31s
CI / Migrations (postgres) (pull_request) Failing after 1m32s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 06:10:22 +00:00
rosemariejebbjtxbfpandDevin AI 3364a50c68 ci: run Python job in python3.12+node container
CI / Go (api) (pull_request) Failing after 1m32s
CI / Python (ingestion) (pull_request) Failing after 31s
CI / Migrations (postgres) (pull_request) Failing after 19m16s
setup-python@v5 can't fetch CPython 3.12 on the self-hosted Gitea runner
(it queries the Gitea API for actions/python-versions, which 404s), so the
job silently fell back to the image's system Python 3.10 + pip 22.0.2. That
old pip lacks PEP 660 editable support, so 'pip install -e' failed with
'build backend is missing the build_editable hook', and 3.10 is below the
project's requires-python>=3.11 (code uses datetime.UTC).

Run the job inside nikolaik/python-nodejs:python3.12-nodejs20 which bundles
Python 3.12, Node 20 (for actions/checkout) and modern pip, removing the
GitHub download dependency entirely.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 06:02:28 +00:00
lixu 936828abae Merge pull request 'perf(search): 浏览路径部分复合索引 (0012)' (#27) from devin/1782279211-search-indexes into main
CI / Go (api) (push) Successful in 49s
CI / Python (ingestion) (push) Failing after 15s
CI / Migrations (postgres) (push) Successful in 31s
2026-06-24 13:35:50 +08:00
rosemariejebbjtxbfpandDevin AI ab7a964934 perf(search): 为浏览路径补部分复合索引 (0012)
CI / Go (api) (pull_request) Successful in 58s
CI / Python (ingestion) (pull_request) Failing after 21s
CI / Migrations (postgres) (pull_request) Successful in 32s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 05:33:31 +00:00
lixu 649fcc711c Merge pull request 'docs: 可扩展性设计与路线图 (scalability roadmap)' (#26) from devin/1782278890-scalability-doc into main
CI / Go (api) (push) Successful in 52s
CI / Python (ingestion) (push) Failing after 16s
CI / Migrations (postgres) (push) Successful in 26s
2026-06-24 13:31:21 +08:00
rosemariejebbjtxbfpandDevin AI 3b62f61288 docs: 新增可扩展性设计与路线图 (scalability roadmap)
CI / Go (api) (pull_request) Successful in 59s
CI / Python (ingestion) (pull_request) Failing after 20s
CI / Migrations (postgres) (pull_request) Successful in 34s
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-24 05:29:08 +00:00