mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-22 09:45:27 -04:00
3d28e0ceed
* feat: Add code generation for plugin controllers and services - 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. * fix
29 lines
880 B
Go
29 lines
880 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/langgenius/dify-plugin-daemon/internal/service"
|
|
)
|
|
|
|
func ListAgentStrategies(c *gin.Context) {
|
|
BindRequest(c, func(request struct {
|
|
TenantID string `uri:"tenant_id" validate:"required"`
|
|
Page int `form:"page" validate:"required,min=1"`
|
|
PageSize int `form:"page_size" validate:"required,min=1,max=256"`
|
|
}) {
|
|
c.JSON(http.StatusOK, service.ListAgentStrategies(request.TenantID, request.Page, request.PageSize))
|
|
})
|
|
}
|
|
|
|
func GetAgentStrategy(c *gin.Context) {
|
|
BindRequest(c, func(request struct {
|
|
TenantID string `uri:"tenant_id" validate:"required"`
|
|
PluginID string `form:"plugin_id" validate:"required"`
|
|
Provider string `form:"provider" validate:"required"`
|
|
}) {
|
|
c.JSON(http.StatusOK, service.GetAgentStrategy(request.TenantID, request.PluginID, request.Provider))
|
|
})
|
|
}
|