Commit Graph

41 Commits

Author SHA1 Message Date
nepiedg fd097729d7 feat: 戒烟成就、梦想图标预设、打卡统计与依赖注入调整
- 成就系统、连续打卡天数计算、管理后台成就 CRUD
- 梦想目标图标预设 DreamPreset 与用户端 dream-presets 接口
- 管理后台梦想图标 CRUD;戒烟打卡 summary 修正
- 忽略根目录编译产物 /api

Made-with: Cursor
2026-04-04 14:55:50 +08:00
nepiedg 1c0aeb152a feat(marketing): user profile update, ad placement management, logo limits
- Add PUT /auth/profile endpoint for nickname and avatar updates
- Add ad_placements table and CRUD admin API for managing ad units
- Add GET /marketing/ad-config public API for mini-program to fetch ad config
- Reduce logo limit from 10 to 3 per user, add 2MB file size validation

Made-with: Cursor
2026-04-04 04:02:06 +08:00
nepiedg b4170b4863 feat(marketing): add user logo management module
Users can now save uploaded logos to the backend (marketing_user_logos table),
avoiding repeated uploads. Includes CRUD endpoints: list, save, delete with
a per-user limit of 10 logos.

Made-with: Cursor
2026-04-04 03:46:57 +08:00
nepiedg 1eab1b99c1 feat: rename qiniu to oss, add admin upload proxy with thumbnail, add dev-login
- Rename all QINIU_* config/code/docs to OSS_* to match actual Alibaba Cloud OSS
- Refactor upload module from internal/common/qiniu to internal/common/upload
- Add backend proxy upload endpoint (POST /api/admin/marketing/upload) to avoid CORS
- Auto-generate compressed thumbnail (800px, JPEG 80%) on admin image upload
- Add dev-login endpoint (POST /api/v1/auth/dev-login) for H5 debugging
- Add imageutil package for server-side image resizing

Made-with: Cursor
2026-04-04 02:52:16 +08:00
你çšnepiedg 9278260681 feat: add quit-checkin v2 backend APIs 2026-03-17 00:47:33 +08:00
root c42492da5f feat(smoke): 增加 AI 今日总结接口与首页缓存透出 2026-03-13 21:29:57 +08:00
hello-dd-code 93bcc6c787 feat(smoke): 添加个性化戒烟计划生成功能 (Issue #46)
- 新增 Model 层: SmokeQuitPlan, SmokeQuitPlanDay 结构体
- 新增 Service 层: GenerateQuitPlan, GetActivePlan, GetPlanDays, ResetPlan
- 新增 Handler 层: POST /generate, GET /, GET /days, POST /reset
- 集成 AI 生成 30 天个性化戒烟减量方案
- 支持重置计划功能
2026-03-13 14:58:42 +08:00
root 484aa96a6e feat: add smoke share token and read-only share APIs 2026-03-10 18:53:01 +08:00
root a4b466744c feat(admin): add fa_smoke CRUD APIs with Chinese comments (#45) 2026-03-10 17:29:36 +08:00
root 2ddb2403e4 feat(admin): add watermark table list APIs (#44) 2026-03-10 17:02:53 +08:00
root 6f1f75d983 feat(admin): complete settings APIs and password update flow 2026-03-10 16:40:51 +08:00
root 59508efb05 feat: move marketing admin to /api/admin and remove built-in page 2026-03-10 01:14:30 +08:00
root d8623fab8f fix: resolve marketing static page path across working dirs 2026-03-10 00:55:52 +08:00
root 386877da9a feat: 新增admin用户与会员管理接口 2026-03-09 22:44:05 +08:00
root 7591a443d9 feat: 完成后台Issue#9 小程序管理接口模块 2026-03-09 19:26:25 +08:00
root bd1e644ef5 feat: 完成后台Issue#6 数据统计接口模块 2026-03-09 19:26:07 +08:00
root 54cf7ea37f feat: 完成后台Issue#4 管理员认证接口模块 2026-03-09 19:25:44 +08:00
root 9daf5e98ff feat: 完成 #40 营销图后台七牛直传与页面上传能力 2026-03-09 19:17:25 +08:00
root 88d02ed6db test: 完成 #39 营销图路由注册与鉴权接入验证 2026-03-09 19:17:10 +08:00
nepiedg e14255cf64 feat(upload): 支持阿里云 OSS 直传凭证 + 营销图管理后台静态路由
- 新增 internal/common/oss: OSS PostPolicy/UploadHost,CDN 为 aliyuncs 时返回 OSS 凭证
- upload_handler: QINIU_CDN_DOMAIN 为 OSS 域名时返回 oss_access_key_id/policy/signature,upload_url 为 bucket 域名
- routes: 增加 /admin/marketing 静态页面路由

Made-with: Cursor
2026-03-06 11:25:23 +00:00
nepiedg ac49e1458c feat(marketing): 新增营销图管理模块
- 新增 marketing 模块:model/repository/service/handler 四层架构
- 数据模型:marketing_categories、marketing_templates、marketing_user_downloads
- 小程序端接口:分类列表、模板列表/详情、下载记录、广告回调
- 管理后台接口:分类/模板 CRUD、下载统计(X-Admin-Token 鉴权)
- 路由注册:接入现有 AuthMiddleware,新增 AdminTokenMiddleware
- Web 管理后台:单页面 Vue3 + Element Plus(分类管理、模板管理、数据概览)

Closes #37, #38, #39, #40

Made-with: Cursor
2026-03-06 07:36:05 +00:00
root cc16b342d7 feat(expiry): 完成 #25 用户设置接口实现 2026-03-04 17:12:36 +08:00
root 6bee50c170 feat(expiry): 完成 #24 物品 Handler 接口实现 2026-03-04 17:11:15 +08:00
root f092019c61 feat(expiry): 完成 #20 模块目录与健康路由 2026-03-04 17:06:26 +08:00
hello-dd-code d64267accc 新增七牛回调接口并接入验签校验 2026-02-28 16:45:19 +08:00
nepiedg 1b8ff310eb Add media proxy feature for resource downloading
- Introduced a new API endpoint `GET /api/v1/video/proxy` to facilitate media resource downloads, allowing users to bypass domain restrictions imposed by WeChat.
- Updated configuration to include proxy settings such as `SHORT_VIDEO_PROXY_ENABLED`, `SHORT_VIDEO_PROXY_ALLOWED_DOMAINS`, `SHORT_VIDEO_PROXY_MAX_SIZE_MB`, and `SHORT_VIDEO_PROXY_TIMEOUT_SECONDS`.
- Enhanced the `ShortVideoConfig` struct to accommodate new proxy-related fields.
- Improved error handling for proxy requests, including checks for allowed domains and file size limits.
- Updated documentation to reflect the new proxy functionality and its configuration options, ensuring clarity for users and developers.
2026-02-06 11:28:02 +00:00
nepiedg 9200600b1c Enhance smoking tracking API with new features and improvements
- Added a new API endpoint `GET /api/v1/smoke/home` to consolidate core modules for the home dashboard, reducing the need for multiple requests.
- Updated the `smoke` routes to include the new home endpoint and improved user profile management with the addition of a `quit_date` field.
- Enhanced the algorithm for calculating daily targets and next smoke suggestions, ensuring accurate future time handling and user-specific recommendations.
- Improved API documentation to reflect new endpoints, response formats, and detailed field descriptions for better clarity and usability.
- Refactored user authentication handling in various handlers to streamline the process and ensure consistent error responses.
2026-01-29 17:16:35 +00:00
nepiedg 3154365ab2 Add motivation quote feature to smoking tracking API
- Introduced a new database model `SmokeMotivationQuote` for storing motivational quotes.
- Added a new API endpoint `GET /api/v1/smoke/motivation` to retrieve motivation quotes for users.
- Updated the main.go file to include the new model in the auto-migration process.
- Enhanced smoke_routes.go to register the new motivation route with the smoke handler.
2026-01-25 09:53:18 +00:00
nepiedg c9ebfd5873 Update algorithm and API documentation for smoking recovery and motivation features
- Added unified backend calculations for health recovery, savings, and motivation generation in the algorithm documentation.
- Updated API documentation to include new endpoints for retrieving statistics and motivation messages, enhancing clarity on data retrieval processes.
- Revised product documentation to reflect changes in API usage for health recovery and savings calculations, ensuring consistency across all related files.
2026-01-25 09:33:10 +00:00
nepiedg b67dc32369 Enhance smoking tracking API and documentation
- Updated the main.go file to set the local time zone to Asia/Shanghai.
- Changed API endpoints from `PUT` to `POST` for user profile and logs management in multiple documentation files to reflect the correct usage.
- Added new fields in the API response for home summary, including `last_smoke_at`, `today_count`, `resisted_count`, and `reduced_from_yesterday`.
- Enhanced documentation across various files to accurately describe the updated API endpoints and their expected behaviors.
2026-01-25 07:55:32 +00:00
nepiedg 6cf7eb2294 Enhance smoking tracking features with AI next smoke time suggestions
- Added new API endpoint `GET /api/v1/smoke/next_smoke_time` to provide AI-generated suggestions for the next smoking time based on user data.
- Introduced a new database table `fa_smoke_ai_next_smoke` to store structured AI time node suggestions.
- Updated smoke handler and service to integrate the new AI next smoke time functionality.
- Enhanced documentation to reflect the new API endpoint and its usage, including details on how to generate AI time nodes.
2026-01-20 07:08:52 +00:00
nepiedg dc54c4e934 Add user profile management for smoking data
- Introduced new API endpoints `GET /api/v1/smoke/profile` and `PUT /api/v1/smoke/profile` for retrieving and updating user smoking profiles.
- Added a new database table `fa_smoke_user_profile` to store user-specific smoking data, including daily smoking habits and motivations.
- Updated the smoke handler and service to integrate user profile data into AI advice generation.
- Enhanced documentation to reflect the new user profile features and their usage.
2026-01-20 02:37:20 +00:00
nepiedg 0b26ba6d35 Add lawyer information reporting interface and update routes 2026-01-09 10:37:57 +00:00
nepiedg f1f77a4d3d Add dashboard and latest logs endpoints for smoke tracking
- Introduced a new API endpoint `GET /api/v1/smoke/dashboard` to retrieve a summary of smoking statistics over a specified date range, including today's count and weekly breakdown.
- Added `GET /api/v1/smoke/logs/latest` endpoint to fetch the most recent smoking logs with a configurable limit.
- Updated the smoke handler and service to support the new functionality, including error handling for date parsing and limit validation.
- Enhanced documentation to reflect the new API endpoints and their usage.
2026-01-06 00:17:51 +00:00
nepiedg 49b709df9f Add video download failure reporting feature
- Introduced a new API endpoint `POST /api/v1/video/remove_watermark/report_failure` for reporting download failures.
- Added a new database table `video_download_failures` to store details about failed downloads, including domain, URL, error message, and reporting metadata.
- Updated the video handler to process failure reports and save them to the database.
- Enhanced documentation to include details about the new reporting feature and its usage.
2026-01-03 23:50:30 +00:00
nepiedg 16844d4a42 Enhance AI and Redis integration for smoke logging features
- Added AI configuration options to .env.example and config.go for OpenAI integration.
- Implemented Redis caching for session management in main.go and auth middleware.
- Updated smoke logging service to support real smoking time (`smoke_at`) and AI advice retrieval.
- Enhanced API routes to include endpoints for AI advice and unlock functionality for non-members.
- Improved database schema with new tables for AI advice and unlock records.
- Expanded documentation to cover new AI features and Redis caching implementation.
2026-01-03 02:14:21 +00:00
nepiedg 1c48fbdeaf Integrate WeChat Official Account support and update configuration
- Added WeChat Official Account configuration options to .env.example and config.go for OAuth2 integration.
- Updated main.go to initialize WeChat OAuth handler and register routes for handling OAuth requests.
- Enhanced documentation to include references for WeChat Official Account functionality.
- Updated route registration to accommodate the new OAuth handler for improved API structure.
2025-12-31 03:55:30 +00:00
nepiedg bba6dc6b4f Refactor Qiniu upload integration and remove legacy handlers
- Replaced common upload handler and service with Qiniu-specific implementations in main.go and route registration.
- Deleted outdated upload_handler.go and qiniu_service.go files to streamline the codebase.
- Updated route definitions to utilize the new Qiniu upload handler for improved file upload management.
2025-12-31 03:22:16 +00:00
nepiedg cd7ae5ac56 Integrate Qiniu upload service and update configuration
- Added Qiniu configuration options to .env.example and config.go for file uploads.
- Refactored main.go to include new Qiniu service and upload handler.
- Updated route registration to accommodate the new upload handler.
- Enhanced documentation to include references for Qiniu upload functionality.
- Removed legacy authentication handler and services to streamline the codebase.
2025-12-31 03:18:03 +00:00
nepiedg bbc2f5f1d5 Refactor video handling and integrate new services
- Removed legacy video handling code and models to streamline the codebase.
- Updated main.go to include new services for removing watermarks and smoke logging.
- Enhanced route registration to accommodate new handlers for watermark removal and smoke logging.
- Improved database migration to include new models for watermark processing.
2025-12-31 02:51:38 +00:00
nepiedg d23b253609 Enhance API and error handling for video services
- Updated .gitignore to exclude cache files.
- Refactored main.go to streamline route registration and improve code organization.
- Added detailed comments in auth_handler.go, video_handler.go, and service files for better clarity on request handling and service logic.
- Improved error messages in video_handler.go to provide clearer feedback to users in Chinese.
- Introduced context handling in service methods to manage request timeouts effectively.
2025-12-31 02:30:20 +00:00