feat(project): 项目完结

This commit is contained in:
peakxy
2026-05-30 23:16:49 +08:00
commit 60e7777cbd
97 changed files with 15027 additions and 0 deletions

2
internal/api/doc.go Normal file
View File

@@ -0,0 +1,2 @@
// Package api contains request and response contracts exposed by triggers.
package api

27
internal/api/dto/agent.go Normal file
View File

@@ -0,0 +1,27 @@
package dto
type AiAgentConfigResponse struct {
AgentID string `json:"agentId"`
AgentName string `json:"agentName"`
AgentDesc string `json:"agentDesc"`
}
type CreateSessionRequest struct {
AgentID string `json:"agentId"`
UserID string `json:"userId"`
}
type CreateSessionResponse struct {
SessionID string `json:"sessionId"`
}
type ChatRequest struct {
AgentID string `json:"agentId"`
UserID string `json:"userId"`
SessionID string `json:"sessionId"`
Message string `json:"message"`
}
type ChatResponse struct {
Content string `json:"content"`
}

View File

@@ -0,0 +1,24 @@
package response
import "ai-agent-scaffold-go/pkg/types"
type Envelope[T any] struct {
Code string `json:"code"`
Info string `json:"info"`
Data T `json:"data,omitempty"`
}
func Success[T any](data T) Envelope[T] {
return Envelope[T]{
Code: types.CodeSuccess,
Info: types.InfoSuccess,
Data: data,
}
}
func Failure(code, info string) Envelope[any] {
return Envelope[any]{
Code: code,
Info: info,
}
}