Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

agent_service.go 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package service
  2. import (
  3. "context"
  4. "git.x2erp.com/qdy/go-base/ctx"
  5. "git.x2erp.com/qdy/go-base/logger"
  6. "git.x2erp.com/qdy/go-base/model/response"
  7. "git.x2erp.com/qdy/go-base/util"
  8. "git.x2erp.com/qdy/go-svc-code/internal/model"
  9. )
  10. // AgentItem 智能体项结构
  11. type AgentItem struct {
  12. ID string `json:"id"` // 智能体ID
  13. Name string `json:"name"` // 智能体名称(标题)
  14. }
  15. // GetAgents 获取智能体列表
  16. func GetAgents(ctx context.Context, reqCtx *ctx.RequestContext) *response.QueryResult[[]AgentItem] {
  17. logger.Debug("GetAgents-开始获取智能体列表")
  18. // 按固定顺序构建智能体列表
  19. agents := []AgentItem{
  20. {
  21. ID: model.AgentReplenish,
  22. Name: model.AgentDisplayName[model.AgentReplenish],
  23. },
  24. {
  25. ID: model.AgentTransfer,
  26. Name: model.AgentDisplayName[model.AgentTransfer],
  27. },
  28. {
  29. ID: model.AgentAllocation,
  30. Name: model.AgentDisplayName[model.AgentAllocation],
  31. },
  32. {
  33. ID: model.AgentReport,
  34. Name: model.AgentDisplayName[model.AgentReport],
  35. },
  36. }
  37. logger.Debug("返回智能体列表结构")
  38. return util.CreateSuccessResultData(agents, reqCtx)
  39. }