[PR #301] [MERGED] feat: Add code generation for plugin controllers and services #432

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/301
Author: @Yeuoly
Created: 5/22/2025
Status: Merged
Merged: 5/23/2025
Merged by: @Yeuoly

Base: mainHead: refactor/codegen


📝 Commits (2)

  • 781dfb5 feat: Add code generation for plugin controllers and services
  • ff5d294 fix

📊 Changes

23 files changed (+1116 additions, -368 deletions)

View changed files

cmd/codegen/main.go (+20 -0)
📝 go.mod (+9 -7)
📝 go.sum (+14 -10)
📝 internal/core/plugin_daemon/model.gen.go (+41 -39)
internal/core/plugin_daemon/oauth.gen.go (+36 -0)
internal/core/plugin_daemon/tool.gen.go (+36 -0)
📝 internal/core/plugin_daemon/tool_service.go (+0 -26)
📝 internal/server/controllers/agent.go (+0 -16)
internal/server/controllers/agent_strategy.gen.go (+24 -0)
internal/server/controllers/config/definitions.go (+40 -0)
internal/server/controllers/controllers.go (+3 -0)
internal/server/controllers/definitions/definitions.go (+226 -0)
internal/server/controllers/generator/generator.go (+185 -0)
internal/server/controllers/generator/templates.go (+92 -0)
internal/server/controllers/model.gen.go (+167 -0)
📝 internal/server/controllers/model.go (+0 -159)
internal/server/controllers/oauth.gen.go (+37 -0)
internal/server/controllers/tool.gen.go (+37 -0)
📝 internal/server/controllers/tool.go (+0 -26)
📝 internal/service/invoke_tool.go (+0 -34)

...and 3 more files

📄 Description

  • Introduced a code generation mechanism for plugin controllers and services, allowing for automatic generation based on defined dispatchers.
  • Created new files for generated controllers, services, and templates to streamline the plugin invocation process.
  • Removed outdated functions related to tool validation and runtime parameters, consolidating functionality into generated files.
  • Updated dependencies in go.mod and go.sum to include necessary packages for the new code generation features.

🔄 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/301 **Author:** [@Yeuoly](https://github.com/Yeuoly) **Created:** 5/22/2025 **Status:** ✅ Merged **Merged:** 5/23/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `refactor/codegen` --- ### 📝 Commits (2) - [`781dfb5`](https://github.com/langgenius/dify-plugin-daemon/commit/781dfb5592f19f24fe1b8dd59ffcfff399f8173c) feat: Add code generation for plugin controllers and services - [`ff5d294`](https://github.com/langgenius/dify-plugin-daemon/commit/ff5d2948c526e2ed0a75d30b5cc3fe8140785098) fix ### 📊 Changes **23 files changed** (+1116 additions, -368 deletions) <details> <summary>View changed files</summary> ➕ `cmd/codegen/main.go` (+20 -0) 📝 `go.mod` (+9 -7) 📝 `go.sum` (+14 -10) 📝 `internal/core/plugin_daemon/model.gen.go` (+41 -39) ➕ `internal/core/plugin_daemon/oauth.gen.go` (+36 -0) ➕ `internal/core/plugin_daemon/tool.gen.go` (+36 -0) 📝 `internal/core/plugin_daemon/tool_service.go` (+0 -26) 📝 `internal/server/controllers/agent.go` (+0 -16) ➕ `internal/server/controllers/agent_strategy.gen.go` (+24 -0) ➕ `internal/server/controllers/config/definitions.go` (+40 -0) ➕ `internal/server/controllers/controllers.go` (+3 -0) ➕ `internal/server/controllers/definitions/definitions.go` (+226 -0) ➕ `internal/server/controllers/generator/generator.go` (+185 -0) ➕ `internal/server/controllers/generator/templates.go` (+92 -0) ➕ `internal/server/controllers/model.gen.go` (+167 -0) 📝 `internal/server/controllers/model.go` (+0 -159) ➕ `internal/server/controllers/oauth.gen.go` (+37 -0) ➕ `internal/server/controllers/tool.gen.go` (+37 -0) 📝 `internal/server/controllers/tool.go` (+0 -26) 📝 `internal/service/invoke_tool.go` (+0 -34) _...and 3 more files_ </details> ### 📄 Description - Introduced a code generation mechanism for plugin controllers and services, allowing for automatic generation based on defined dispatchers. - Created new files for generated controllers, services, and templates to streamline the plugin invocation process. - Removed outdated functions related to tool validation and runtime parameters, consolidating functionality into generated files. - Updated dependencies in go.mod and go.sum to include necessary packages for the new code generation features. --- <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#432