[PR #306] [MERGED] feat: Generate HTTP server routes from template #436

Closed
opened 2026-02-16 01:15:57 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/306
Author: @Yeuoly
Created: 5/23/2025
Status: Merged
Merged: 5/23/2025
Merged by: @Yeuoly

Base: mainHead: refactor/implement-gen-routes


📝 Commits (2)

  • e30b78d feat: Generate HTTP server routes from template
  • 3fc2b0a fix: Update OAuth paths in PluginDispatchers for consistency

📊 Changes

5 files changed (+104 additions, -18 deletions)

View changed files

📝 internal/server/controllers/definitions/definitions.go (+2 -2)
📝 internal/server/controllers/generator/generator.go (+57 -0)
📝 internal/server/controllers/generator/templates.go (+16 -0)
internal/server/http_server.gen.go (+27 -0)
📝 internal/server/http_server.go (+2 -16)

📄 Description

  • Added a new file http_server.gen.go to automatically generate HTTP server routes based on defined dispatchers.
  • Refactored existing route definitions in http_server.go to utilize the generated routes, improving maintainability.
  • Introduced a code generation function in generator.go to create the HTTP server file, enhancing the plugin development workflow.
  • Updated the template for HTTP server generation to streamline route creation for various controllers.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-daemon/pull/306 **Author:** [@Yeuoly](https://github.com/Yeuoly) **Created:** 5/23/2025 **Status:** ✅ Merged **Merged:** 5/23/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `refactor/implement-gen-routes` --- ### 📝 Commits (2) - [`e30b78d`](https://github.com/langgenius/dify-plugin-daemon/commit/e30b78d93d11ee95c8518831c78994248c323559) feat: Generate HTTP server routes from template - [`3fc2b0a`](https://github.com/langgenius/dify-plugin-daemon/commit/3fc2b0ad54d89e26a2c81dec32719172028e87c2) fix: Update OAuth paths in PluginDispatchers for consistency ### 📊 Changes **5 files changed** (+104 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `internal/server/controllers/definitions/definitions.go` (+2 -2) 📝 `internal/server/controllers/generator/generator.go` (+57 -0) 📝 `internal/server/controllers/generator/templates.go` (+16 -0) ➕ `internal/server/http_server.gen.go` (+27 -0) 📝 `internal/server/http_server.go` (+2 -16) </details> ### 📄 Description - Added a new file `http_server.gen.go` to automatically generate HTTP server routes based on defined dispatchers. - Refactored existing route definitions in `http_server.go` to utilize the generated routes, improving maintainability. - Introduced a code generation function in `generator.go` to create the HTTP server file, enhancing the plugin development workflow. - Updated the template for HTTP server generation to streamline route creation for various controllers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:15:57 -05:00
yindo closed this issue 2026-02-16 01:15:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#436