Compare commits
1 Commits
release/v0
...
feat/telem
| Author | SHA1 | Date | |
|---|---|---|---|
| 9335447977 |
@ -1,36 +0,0 @@
|
|||||||
# Exclude node_modules directories
|
|
||||||
**/node_modules
|
|
||||||
**/node_modules/**
|
|
||||||
|
|
||||||
# Exclude build artifacts
|
|
||||||
**/dist
|
|
||||||
**/build
|
|
||||||
**/.rush/temp
|
|
||||||
**/.rush/build-cache
|
|
||||||
**/common/temp
|
|
||||||
|
|
||||||
# Exclude development files
|
|
||||||
**/.git
|
|
||||||
**/.gitignore
|
|
||||||
**/.eslintrc*
|
|
||||||
**/.prettierrc*
|
|
||||||
**/*.log
|
|
||||||
|
|
||||||
# Exclude test files
|
|
||||||
**/__tests__
|
|
||||||
**/*.test.*
|
|
||||||
**/*.spec.*
|
|
||||||
|
|
||||||
# Exclude documentation
|
|
||||||
**/README.md
|
|
||||||
**/CHANGELOG.md
|
|
||||||
**/docs
|
|
||||||
|
|
||||||
# Exclude IDE files
|
|
||||||
**/.vscode
|
|
||||||
**/.idea
|
|
||||||
**/*.swp
|
|
||||||
**/*.swo
|
|
||||||
*.iml
|
|
||||||
*.iws
|
|
||||||
*.ipr
|
|
||||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -11,10 +11,6 @@ on:
|
|||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
4
.github/workflows/ci@main.yml
vendored
4
.github/workflows/ci@main.yml
vendored
@ -12,10 +12,6 @@ on:
|
|||||||
- 'rush.json'
|
- 'rush.json'
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
3
.github/workflows/common-pr-checks.yml
vendored
3
.github/workflows/common-pr-checks.yml
vendored
@ -9,9 +9,6 @@ on:
|
|||||||
- 'rush.json'
|
- 'rush.json'
|
||||||
types: [opened, edited, synchronize, reopened]
|
types: [opened, edited, synchronize, reopened]
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
common-checks:
|
common-checks:
|
||||||
name: PR Common Checks
|
name: PR Common Checks
|
||||||
|
|||||||
3
.github/workflows/idl.yaml
vendored
3
.github/workflows/idl.yaml
vendored
@ -12,9 +12,6 @@ on:
|
|||||||
- 'idl/**'
|
- 'idl/**'
|
||||||
- '.github/workflows/idl.yaml'
|
- '.github/workflows/idl.yaml'
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate-thrift:
|
validate-thrift:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
3
.github/workflows/license-check.yaml
vendored
3
.github/workflows/license-check.yaml
vendored
@ -7,9 +7,6 @@ on:
|
|||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
license-check:
|
license-check:
|
||||||
name: License Check
|
name: License Check
|
||||||
|
|||||||
3
.github/workflows/semantic-pull-request.yaml
vendored
3
.github/workflows/semantic-pull-request.yaml
vendored
@ -11,9 +11,6 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
name: Check Pull Request Title
|
name: Check Pull Request Title
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,7 +34,6 @@ output/*
|
|||||||
|
|
||||||
# Vscode files
|
# Vscode files
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
.vscode/launch.json
|
|
||||||
|
|
||||||
/patches
|
/patches
|
||||||
/oldimpl
|
/oldimpl
|
||||||
|
|||||||
11
.mcp.json
11
.mcp.json
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"mcpServers": {
|
|
||||||
"github": {
|
|
||||||
"type": "http",
|
|
||||||
"url": "https://api.githubcopilot.com/mcp/",
|
|
||||||
"headers": {
|
|
||||||
"Authorization": "Bearer ${GITHUB_PAT}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
196
CLAUDE.md
196
CLAUDE.md
@ -1,196 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Project Overview
|
|
||||||
|
|
||||||
Coze Studio is an all-in-one AI agent development platform with both frontend (React + TypeScript) and backend (Go) components. The project uses a sophisticated monorepo architecture managed by Rush.js with 135+ frontend packages organized in a hierarchical dependency system.
|
|
||||||
|
|
||||||
## Development Commands
|
|
||||||
|
|
||||||
### Environment Setup
|
|
||||||
```bash
|
|
||||||
# Clone and setup
|
|
||||||
git clone https://github.com/coze-dev/coze-studio.git
|
|
||||||
cd coze-studio
|
|
||||||
|
|
||||||
# Install frontend dependencies
|
|
||||||
rush update
|
|
||||||
|
|
||||||
# For Docker-based development
|
|
||||||
cd docker
|
|
||||||
cp .env.example .env
|
|
||||||
# Configure model settings in backend/conf/model/
|
|
||||||
docker compose up -d
|
|
||||||
# Access at http://localhost:8888
|
|
||||||
```
|
|
||||||
|
|
||||||
### Development Workflow
|
|
||||||
```bash
|
|
||||||
# Start middleware services (MySQL, Redis, Elasticsearch, etc.)
|
|
||||||
make middleware
|
|
||||||
|
|
||||||
# Start Go backend in development mode
|
|
||||||
make server
|
|
||||||
|
|
||||||
# Start frontend development server
|
|
||||||
cd frontend/apps/coze-studio
|
|
||||||
npm run dev
|
|
||||||
|
|
||||||
# Full development environment
|
|
||||||
make debug
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build Commands
|
|
||||||
```bash
|
|
||||||
# Build frontend only
|
|
||||||
make fe
|
|
||||||
|
|
||||||
# Build Go server
|
|
||||||
make build_server
|
|
||||||
|
|
||||||
# Build everything with Docker
|
|
||||||
make web
|
|
||||||
|
|
||||||
# Rush monorepo commands
|
|
||||||
rush build # Build all packages
|
|
||||||
rush rebuild -o @coze-studio/app # Build specific package
|
|
||||||
rush test # Run all tests
|
|
||||||
rush lint # Lint all packages
|
|
||||||
```
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
```bash
|
|
||||||
# Run tests (Vitest-based)
|
|
||||||
rush test
|
|
||||||
npm run test # In specific package
|
|
||||||
npm run test:cov # With coverage
|
|
||||||
|
|
||||||
# Backend tests
|
|
||||||
cd backend && go test ./...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture Overview
|
|
||||||
|
|
||||||
### Frontend Architecture
|
|
||||||
- **Monorepo**: Rush.js with 135+ packages across 4 dependency levels
|
|
||||||
- **Build System**: Rsbuild (Rspack-based) for fast builds
|
|
||||||
- **UI Framework**: React 18 + TypeScript + Semi Design + Tailwind CSS
|
|
||||||
- **State Management**: Zustand for global state
|
|
||||||
- **Package Organization**:
|
|
||||||
- `arch/`: Core infrastructure (level-1)
|
|
||||||
- `common/`: Shared components and utilities (level-2)
|
|
||||||
- `agent-ide/`, `workflow/`, `studio/`: Feature domains (level-3)
|
|
||||||
- `apps/coze-studio`: Main application (level-4)
|
|
||||||
|
|
||||||
### Backend Architecture (Go)
|
|
||||||
- **Framework**: Hertz HTTP framework
|
|
||||||
- **Architecture**: Domain-Driven Design (DDD) with microservices
|
|
||||||
- **Structure**:
|
|
||||||
- `domain/`: Business logic and entities
|
|
||||||
- `application/`: Application services and use cases
|
|
||||||
- `api/`: HTTP handlers and routing
|
|
||||||
- `infra/`: Infrastructure implementations
|
|
||||||
- `crossdomain/`: Cross-cutting concerns
|
|
||||||
|
|
||||||
### Key Architectural Patterns
|
|
||||||
- **Adapter Pattern**: Extensive use for loose coupling between layers
|
|
||||||
- **Interface Segregation**: Clear contracts between domains
|
|
||||||
- **Event-Driven**: NSQ message queue for async communication
|
|
||||||
- **API-First**: Comprehensive OpenAPI specifications
|
|
||||||
|
|
||||||
## Database & Infrastructure
|
|
||||||
|
|
||||||
### Docker Services Stack
|
|
||||||
- **Database**: MySQL 8.4.5
|
|
||||||
- **Cache**: Redis 8.0
|
|
||||||
- **Search**: Elasticsearch 8.18.0 with SmartCN analyzer
|
|
||||||
- **Vector DB**: Milvus v2.5.10 for embeddings
|
|
||||||
- **Storage**: MinIO for object storage
|
|
||||||
- **Message Queue**: NSQ (nsqlookupd, nsqd, nsqadmin)
|
|
||||||
- **Configuration**: etcd 3.5
|
|
||||||
|
|
||||||
### Database Management
|
|
||||||
```bash
|
|
||||||
# Sync database schema
|
|
||||||
make sync_db
|
|
||||||
|
|
||||||
# Dump database schema
|
|
||||||
make dump_db
|
|
||||||
|
|
||||||
# Initialize SQL data
|
|
||||||
make sql_init
|
|
||||||
|
|
||||||
# Atlas migration management
|
|
||||||
make atlas-hash
|
|
||||||
```
|
|
||||||
|
|
||||||
## Key Development Patterns
|
|
||||||
|
|
||||||
### Frontend Package Development
|
|
||||||
- Each package follows consistent structure with `README.md`, `package.json`, `tsconfig.json`, `eslint.config.js`
|
|
||||||
- Adapter pattern extensively used for decoupling (e.g., `-adapter` suffix packages)
|
|
||||||
- Base/Core pattern for shared functionality (e.g., `-base` suffix packages)
|
|
||||||
- Use workspace references (`workspace:*`) for internal dependencies
|
|
||||||
|
|
||||||
### Backend Development
|
|
||||||
- Follow DDD principles with clear domain boundaries
|
|
||||||
- Use dependency injection via interfaces
|
|
||||||
- Implement proper error handling with custom error types
|
|
||||||
- Write comprehensive tests for domain logic
|
|
||||||
|
|
||||||
### Model Configuration
|
|
||||||
Before deployment, configure AI models in `backend/conf/model/`:
|
|
||||||
1. Copy template from `backend/conf/model/template/`
|
|
||||||
2. Set `id`, `meta.conn_config.api_key`, and `meta.conn_config.model`
|
|
||||||
3. Supported providers: OpenAI, Volcengine Ark, Claude, Gemini, Qwen, DeepSeek, Ollama
|
|
||||||
|
|
||||||
## Testing Strategy
|
|
||||||
|
|
||||||
### Coverage Requirements by Package Level
|
|
||||||
- **Level 1**: 80% coverage, 90% increment
|
|
||||||
- **Level 2**: 30% coverage, 60% increment
|
|
||||||
- **Level 3-4**: 0% coverage (flexible)
|
|
||||||
|
|
||||||
### Testing Framework
|
|
||||||
- **Frontend**: Vitest for unit/integration tests
|
|
||||||
- **Backend**: Go's built-in testing framework
|
|
||||||
- **E2E**: Separate e2e subspace configuration
|
|
||||||
|
|
||||||
## Common Issues & Solutions
|
|
||||||
|
|
||||||
### Frontend Development
|
|
||||||
- Use `rush update` instead of `npm install` at root level
|
|
||||||
- Build packages in dependency order using `rush build`
|
|
||||||
- For hot reload issues, check Rsbuild configuration in specific package
|
|
||||||
|
|
||||||
### Backend Development
|
|
||||||
- Ensure middleware services are running (`make middleware`)
|
|
||||||
- Check database connectivity and schema sync
|
|
||||||
- Verify model configurations are properly set
|
|
||||||
|
|
||||||
### Docker Issues
|
|
||||||
- Ensure sufficient resources (minimum 2 Core, 4GB RAM)
|
|
||||||
- Check port conflicts (8888 for frontend, various for services)
|
|
||||||
- Use `make clean` to reset Docker volumes if needed
|
|
||||||
|
|
||||||
## IDL and Code Generation
|
|
||||||
|
|
||||||
The project uses Interface Definition Language (IDL) for API contract management:
|
|
||||||
- IDL files in `idl/` directory (Thrift format)
|
|
||||||
- Frontend code generation via `@coze-arch/idl2ts-*` packages
|
|
||||||
- Backend uses generated Go structs
|
|
||||||
|
|
||||||
## Plugin Development
|
|
||||||
|
|
||||||
For custom plugin development:
|
|
||||||
- Reference templates in `backend/conf/plugin/pluginproduct/`
|
|
||||||
- Follow OAuth schema in `backend/conf/plugin/common/oauth_schema.json`
|
|
||||||
- Configure authentication keys for third-party services
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
- Use conventional commits via `rush commit`
|
|
||||||
- Run linting with `rush lint-staged` (pre-commit hook)
|
|
||||||
- Ensure tests pass before submitting PRs
|
|
||||||
- Follow team-based package organization and tagging conventions
|
|
||||||
2
Makefile
2
Makefile
@ -28,7 +28,7 @@ fe:
|
|||||||
@echo "Building frontend..."
|
@echo "Building frontend..."
|
||||||
@bash $(BUILD_FE_SCRIPT)
|
@bash $(BUILD_FE_SCRIPT)
|
||||||
|
|
||||||
server: env
|
server: env setup_es_index
|
||||||
@if [ ! -d "$(STATIC_DIR)" ]; then \
|
@if [ ! -d "$(STATIC_DIR)" ]; then \
|
||||||
echo "Static directory '$(STATIC_DIR)' not found, building frontend..."; \
|
echo "Static directory '$(STATIC_DIR)' not found, building frontend..."; \
|
||||||
$(MAKE) fe; \
|
$(MAKE) fe; \
|
||||||
|
|||||||
@ -33,8 +33,9 @@ RUN apk add --no-cache --virtual .python-build-deps build-base py3-pip git && \
|
|||||||
# Activate venv and install packages
|
# Activate venv and install packages
|
||||||
. /app/.venv/bin/activate && \
|
. /app/.venv/bin/activate && \
|
||||||
# If you want to use other third-party libraries, you can install them here.
|
# If you want to use other third-party libraries, you can install them here.
|
||||||
|
pip install git+https://gitcode.com/gh_mirrors/re/requests-async.git@master && \
|
||||||
pip install urllib3==1.26.16 && \
|
pip install urllib3==1.26.16 && \
|
||||||
pip install --no-cache-dir h11==0.16.0 httpx==0.28.1 pillow==11.2.1 pdfplumber==0.11.7 python-docx==1.2.0 numpy==2.3.1 && \
|
pip install --no-cache-dir pillow==11.2.1 pdfplumber==0.11.7 python-docx==1.2.0 numpy==2.3.1 && \
|
||||||
# Deactivate (optional, as RUN is a new shell)
|
# Deactivate (optional, as RUN is a new shell)
|
||||||
# deactivate && \
|
# deactivate && \
|
||||||
# Remove build dependencies
|
# Remove build dependencies
|
||||||
@ -51,7 +52,7 @@ COPY backend/infra/impl/coderunner/script/sandbox.py /app/sandbox.py
|
|||||||
|
|
||||||
|
|
||||||
# Copy static resources
|
# Copy static resources
|
||||||
# COPY backend/static /app/resources/static/
|
COPY backend/static /app/resources/static/
|
||||||
COPY backend/conf /app/resources/conf/
|
COPY backend/conf /app/resources/conf/
|
||||||
COPY docker/.env.example /app/.env
|
COPY docker/.env.example /app/.env
|
||||||
# COPY docker/.env.ve /app/.env
|
# COPY docker/.env.ve /app/.env
|
||||||
|
|||||||
@ -20,17 +20,13 @@ package coze
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/application/singleagent"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/application/upload"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/conf"
|
|
||||||
|
|
||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api"
|
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
||||||
|
|
||||||
|
bot_open_api "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_open_api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// OauthAuthorizationCode .
|
// OauthAuthorizationCode .
|
||||||
@ -45,7 +41,7 @@ func OauthAuthorizationCode(ctx context.Context, c *app.RequestContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if req.Code == "" {
|
if req.Code == "" {
|
||||||
invalidParamRequestResponse(c, "authorization failed, code is required")
|
invalidParamRequestResponse(c, "code is required")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if req.State == "" {
|
if req.State == "" {
|
||||||
@ -53,55 +49,11 @@ func OauthAuthorizationCode(ctx context.Context, c *app.RequestContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = plugin.PluginApplicationSVC.OauthAuthorizationCode(ctx, &req)
|
resp, err := plugin.PluginApplicationSVC.OauthAuthorizationCode(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
internalServerErrorResponse(ctx, c, err)
|
internalServerErrorResponse(ctx, c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectURL := fmt.Sprintf("%s/information/auth/success", conf.GetServerHost())
|
|
||||||
c.Redirect(consts.StatusFound, []byte(redirectURL))
|
|
||||||
c.Abort()
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// UploadFileOpen .
|
|
||||||
// @router /v1/files/upload [POST]
|
|
||||||
func UploadFileOpen(ctx context.Context, c *app.RequestContext) {
|
|
||||||
var err error
|
|
||||||
var req bot_open_api.UploadFileOpenRequest
|
|
||||||
err = c.BindAndValidate(&req)
|
|
||||||
if err != nil {
|
|
||||||
c.String(consts.StatusBadRequest, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp := new(bot_open_api.UploadFileOpenResponse)
|
|
||||||
resp, err = upload.SVC.UploadFileOpen(ctx, &req)
|
|
||||||
if err != nil {
|
|
||||||
internalServerErrorResponse(ctx, c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
c.JSON(consts.StatusOK, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBotOnlineInfo .
|
|
||||||
// @router /v1/bot/get_online_info [GET]
|
|
||||||
func GetBotOnlineInfo(ctx context.Context, c *app.RequestContext) {
|
|
||||||
var err error
|
|
||||||
var req bot_open_api.GetBotOnlineInfoReq
|
|
||||||
err = c.BindAndValidate(&req)
|
|
||||||
if err != nil {
|
|
||||||
c.String(consts.StatusBadRequest, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := singleagent.SingleAgentSVC.GetAgentOnlineInfo(ctx, &req)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
internalServerErrorResponse(ctx, c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
c.JSON(consts.StatusOK, resp)
|
c.JSON(consts.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ import (
|
|||||||
|
|
||||||
func TestClearConversationCtx(t *testing.T) {
|
func TestClearConversationCtx(t *testing.T) {
|
||||||
h := server.Default()
|
h := server.Default()
|
||||||
err := application.Init(context.Background())
|
_, err := application.Init(context.Background())
|
||||||
|
|
||||||
t.Logf("application init err: %v", err)
|
t.Logf("application init err: %v", err)
|
||||||
h.POST("/api/conversation/create_section", ClearConversationCtx)
|
h.POST("/api/conversation/create_section", ClearConversationCtx)
|
||||||
@ -55,7 +55,7 @@ func TestClearConversationCtx(t *testing.T) {
|
|||||||
|
|
||||||
func TestClearConversationHistory(t *testing.T) {
|
func TestClearConversationHistory(t *testing.T) {
|
||||||
h := server.Default()
|
h := server.Default()
|
||||||
err := application.Init(context.Background())
|
_, err := application.Init(context.Background())
|
||||||
t.Logf("application init err: %v", err)
|
t.Logf("application init err: %v", err)
|
||||||
h.POST("/api/conversation/clear_message", ClearConversationHistory)
|
h.POST("/api/conversation/clear_message", ClearConversationHistory)
|
||||||
req := &conversation.ClearConversationHistoryRequest{
|
req := &conversation.ClearConversationHistoryRequest{
|
||||||
|
|||||||
@ -24,8 +24,8 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
"github.com/coze-dev/coze-studio/backend/api/model/knowledge/document"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/memory"
|
"github.com/coze-dev/coze-studio/backend/application/memory"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/singleagent"
|
"github.com/coze-dev/coze-studio/backend/application/singleagent"
|
||||||
)
|
)
|
||||||
@ -341,7 +341,7 @@ func GetDatabaseTableSchema(ctx context.Context, c *app.RequestContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var resp *knowledge.GetTableSchemaInfoResponse
|
var resp *document.GetTableSchemaInfoResponse
|
||||||
resp, err = memory.DatabaseApplicationSVC.GetDatabaseTableSchema(ctx, &req)
|
resp, err = memory.DatabaseApplicationSVC.GetDatabaseTableSchema(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
internalServerErrorResponse(ctx, c, err)
|
internalServerErrorResponse(ctx, c, err)
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
developer_api "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/modelmgr"
|
"github.com/coze-dev/coze-studio/backend/application/modelmgr"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/singleagent"
|
"github.com/coze-dev/coze-studio/backend/application/singleagent"
|
||||||
|
|||||||
@ -25,11 +25,11 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence"
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
project "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project"
|
project "github.com/coze-dev/coze-studio/backend/api/model/project"
|
||||||
publish "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish"
|
publish "github.com/coze-dev/coze-studio/backend/api/model/publish"
|
||||||
task "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task"
|
task "github.com/coze-dev/coze-studio/backend/api/model/task"
|
||||||
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/search"
|
"github.com/coze-dev/coze-studio/backend/application/search"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -24,10 +24,8 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
dataset "github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/knowledge"
|
|
||||||
application "github.com/coze-dev/coze-studio/backend/application/knowledge"
|
application "github.com/coze-dev/coze-studio/backend/application/knowledge"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/memory"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/application/upload"
|
"github.com/coze-dev/coze-studio/backend/application/upload"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -528,48 +526,3 @@ func ExtractPhotoCaption(ctx context.Context, c *app.RequestContext) {
|
|||||||
}
|
}
|
||||||
c.JSON(consts.StatusOK, resp)
|
c.JSON(consts.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDocumentTableInfo .
|
|
||||||
// @router /api/memory/doc_table_info [GET]
|
|
||||||
func GetDocumentTableInfo(ctx context.Context, c *app.RequestContext) {
|
|
||||||
var err error
|
|
||||||
var req dataset.GetDocumentTableInfoRequest
|
|
||||||
err = c.BindAndValidate(&req)
|
|
||||||
if err != nil {
|
|
||||||
c.String(consts.StatusBadRequest, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp := new(dataset.GetDocumentTableInfoResponse)
|
|
||||||
resp, err = knowledge.KnowledgeSVC.GetDocumentTableInfo(ctx, &req)
|
|
||||||
if err != nil {
|
|
||||||
internalServerErrorResponse(ctx, c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
c.JSON(consts.StatusOK, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetModeConfig .
|
|
||||||
// @router /api/memory/table_mode_config [GET]
|
|
||||||
func GetModeConfig(ctx context.Context, c *app.RequestContext) {
|
|
||||||
var err error
|
|
||||||
var req dataset.GetModeConfigRequest
|
|
||||||
err = c.BindAndValidate(&req)
|
|
||||||
if err != nil {
|
|
||||||
c.String(consts.StatusBadRequest, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.BotID == 0 {
|
|
||||||
invalidParamRequestResponse(c, "bot_id is zero")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := memory.DatabaseApplicationSVC.GetModeConfig(ctx, &req)
|
|
||||||
if err != nil {
|
|
||||||
internalServerErrorResponse(ctx, c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
c.JSON(consts.StatusOK, resp)
|
|
||||||
}
|
|
||||||
|
|||||||
@ -24,9 +24,12 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory"
|
"github.com/coze-dev/coze-studio/backend/api/model/knowledge/document"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/kvmemory"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
|
table "github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/application/knowledge"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/memory"
|
"github.com/coze-dev/coze-studio/backend/application/memory"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"
|
||||||
)
|
)
|
||||||
@ -227,3 +230,48 @@ func GetPlayGroundMemory(ctx context.Context, c *app.RequestContext) {
|
|||||||
|
|
||||||
c.JSON(consts.StatusOK, resp)
|
c.JSON(consts.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDocumentTableInfo .
|
||||||
|
// @router /api/memory/doc_table_info [GET]
|
||||||
|
func GetDocumentTableInfo(ctx context.Context, c *app.RequestContext) {
|
||||||
|
var err error
|
||||||
|
var req document.GetDocumentTableInfoRequest
|
||||||
|
err = c.BindAndValidate(&req)
|
||||||
|
if err != nil {
|
||||||
|
c.String(consts.StatusBadRequest, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := new(document.GetDocumentTableInfoResponse)
|
||||||
|
resp, err = knowledge.KnowledgeSVC.GetDocumentTableInfo(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
internalServerErrorResponse(ctx, c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(consts.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetModeConfig .
|
||||||
|
// @router /api/memory/table_mode_config [GET]
|
||||||
|
func GetModeConfig(ctx context.Context, c *app.RequestContext) {
|
||||||
|
var err error
|
||||||
|
var req table.GetModeConfigRequest
|
||||||
|
err = c.BindAndValidate(&req)
|
||||||
|
if err != nil {
|
||||||
|
c.String(consts.StatusBadRequest, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.BotID == 0 {
|
||||||
|
invalidParamRequestResponse(c, "bot_id is zero")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := memory.DatabaseApplicationSVC.GetModeConfig(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
internalServerErrorResponse(ctx, c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(consts.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ import (
|
|||||||
|
|
||||||
func TestGetMessageList(t *testing.T) {
|
func TestGetMessageList(t *testing.T) {
|
||||||
h := server.Default()
|
h := server.Default()
|
||||||
err := application.Init(context.Background())
|
_, err := application.Init(context.Background())
|
||||||
|
|
||||||
t.Logf("application init err: %v", err)
|
t.Logf("application init err: %v", err)
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/prompt"
|
"github.com/coze-dev/coze-studio/backend/application/prompt"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/shortcutcmd"
|
"github.com/coze-dev/coze-studio/backend/application/shortcutcmd"
|
||||||
@ -371,3 +371,43 @@ func GetFileUrls(ctx context.Context, c *app.RequestContext) {
|
|||||||
|
|
||||||
c.JSON(consts.StatusOK, resp)
|
c.JSON(consts.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UploadFileOpen .
|
||||||
|
// @router /v1/files/upload [POST]
|
||||||
|
func UploadFileOpen(ctx context.Context, c *app.RequestContext) {
|
||||||
|
var err error
|
||||||
|
var req playground.UploadFileOpenRequest
|
||||||
|
err = c.BindAndValidate(&req)
|
||||||
|
if err != nil {
|
||||||
|
c.String(consts.StatusBadRequest, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := new(playground.UploadFileOpenResponse)
|
||||||
|
resp, err = upload.SVC.UploadFileOpen(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
internalServerErrorResponse(ctx, c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(consts.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBotOnlineInfo .
|
||||||
|
// @router /v1/bot/get_online_info [GET]
|
||||||
|
func GetBotOnlineInfo(ctx context.Context, c *app.RequestContext) {
|
||||||
|
var err error
|
||||||
|
var req playground.GetBotOnlineInfoReq
|
||||||
|
err = c.BindAndValidate(&req)
|
||||||
|
if err != nil {
|
||||||
|
c.String(consts.StatusBadRequest, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := singleagent.SingleAgentSVC.GetAgentOnlineInfo(ctx, &req)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
internalServerErrorResponse(ctx, c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(consts.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|||||||
@ -25,8 +25,8 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop"
|
||||||
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
||||||
appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow"
|
appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -22,18 +22,18 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
product_public_api "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
|
|
||||||
appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow"
|
appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow"
|
||||||
|
|
||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
appApplication "github.com/coze-dev/coze-studio/backend/application/app"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/modelmgr"
|
"github.com/coze-dev/coze-studio/backend/application/modelmgr"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
||||||
|
|||||||
@ -29,7 +29,7 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/sse"
|
"github.com/cloudwego/hertz/pkg/protocol/sse"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||||
appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow"
|
appworkflow "github.com/coze-dev/coze-studio/backend/application/workflow"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
|
||||||
|
|||||||
@ -32,7 +32,6 @@ import (
|
|||||||
|
|
||||||
"github.com/alicebob/miniredis/v2"
|
"github.com/alicebob/miniredis/v2"
|
||||||
"github.com/bytedance/mockey"
|
"github.com/bytedance/mockey"
|
||||||
"github.com/cloudwego/eino/callbacks"
|
|
||||||
model2 "github.com/cloudwego/eino/components/model"
|
model2 "github.com/cloudwego/eino/components/model"
|
||||||
"github.com/cloudwego/eino/schema"
|
"github.com/cloudwego/eino/schema"
|
||||||
"github.com/cloudwego/hertz/pkg/app"
|
"github.com/cloudwego/hertz/pkg/app"
|
||||||
@ -41,6 +40,7 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/common/ut"
|
"github.com/cloudwego/hertz/pkg/common/ut"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol"
|
"github.com/cloudwego/hertz/pkg/protocol"
|
||||||
"github.com/cloudwego/hertz/pkg/protocol/sse"
|
"github.com/cloudwego/hertz/pkg/protocol/sse"
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"go.uber.org/mock/gomock"
|
"go.uber.org/mock/gomock"
|
||||||
@ -50,9 +50,9 @@ import (
|
|||||||
modelknowledge "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
modelknowledge "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
||||||
plugin2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
plugin2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
pluginmodel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
pluginmodel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
|
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
appknowledge "github.com/coze-dev/coze-studio/backend/application/knowledge"
|
appknowledge "github.com/coze-dev/coze-studio/backend/application/knowledge"
|
||||||
appmemory "github.com/coze-dev/coze-studio/backend/application/memory"
|
appmemory "github.com/coze-dev/coze-studio/backend/application/memory"
|
||||||
@ -85,7 +85,6 @@ import (
|
|||||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/service"
|
"github.com/coze-dev/coze-studio/backend/domain/workflow/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/coderunner"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/coderunner"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/cache/redis"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/checkpoint"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/checkpoint"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/coderunner/direct"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/coderunner/direct"
|
||||||
mockCrossUser "github.com/coze-dev/coze-studio/backend/internal/mock/crossdomain/crossuser"
|
mockCrossUser "github.com/coze-dev/coze-studio/backend/internal/mock/crossdomain/crossuser"
|
||||||
@ -103,30 +102,23 @@ import (
|
|||||||
"github.com/coze-dev/coze-studio/backend/types/errno"
|
"github.com/coze-dev/coze-studio/backend/types/errno"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
|
||||||
callbacks.AppendGlobalHandlers(service.GetTokenCallbackHandler())
|
|
||||||
service.RegisterAllNodeAdaptors()
|
|
||||||
os.Exit(m.Run())
|
|
||||||
}
|
|
||||||
|
|
||||||
type wfTestRunner struct {
|
type wfTestRunner struct {
|
||||||
t *testing.T
|
t *testing.T
|
||||||
h *server.Hertz
|
h *server.Hertz
|
||||||
ctrl *gomock.Controller
|
ctrl *gomock.Controller
|
||||||
idGen *mock.MockIDGenerator
|
idGen *mock.MockIDGenerator
|
||||||
search *searchmock.MockNotifier
|
search *searchmock.MockNotifier
|
||||||
appVarS *mockvar.MockStore
|
appVarS *mockvar.MockStore
|
||||||
userVarS *mockvar.MockStore
|
userVarS *mockvar.MockStore
|
||||||
varGetter *mockvar.MockVariablesMetaGetter
|
varGetter *mockvar.MockVariablesMetaGetter
|
||||||
modelManage *mockmodel.MockManager
|
modelManage *mockmodel.MockManager
|
||||||
plugin *mockPlugin.MockPluginService
|
plugin *mockPlugin.MockPluginService
|
||||||
tos *storageMock.MockStorage
|
tos *storageMock.MockStorage
|
||||||
knowledge *knowledgemock.MockKnowledgeOperator
|
knowledge *knowledgemock.MockKnowledgeOperator
|
||||||
database *databasemock.MockDatabaseOperator
|
database *databasemock.MockDatabaseOperator
|
||||||
pluginSrv *pluginmock.MockService
|
pluginSrv *pluginmock.MockService
|
||||||
internalModel *testutil.UTChatModel
|
ctx context.Context
|
||||||
ctx context.Context
|
closeFn func()
|
||||||
closeFn func()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var req2URL = map[reflect.Type]string{
|
var req2URL = map[reflect.Type]string{
|
||||||
@ -239,15 +231,15 @@ func newWfTestRunner(t *testing.T) *wfTestRunner {
|
|||||||
t.Fatalf("Failed to start miniredis: %v", err)
|
t.Fatalf("Failed to start miniredis: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
redisClient := redis.NewWithAddrAndPassword(s.Addr(), "")
|
redisClient := redis.NewClient(&redis.Options{
|
||||||
|
Addr: s.Addr(),
|
||||||
|
})
|
||||||
|
|
||||||
cpStore := checkpoint.NewRedisStore(redisClient)
|
cpStore := checkpoint.NewRedisStore(redisClient)
|
||||||
|
|
||||||
utChatModel := &testutil.UTChatModel{}
|
|
||||||
|
|
||||||
mockTos := storageMock.NewMockStorage(ctrl)
|
mockTos := storageMock.NewMockStorage(ctrl)
|
||||||
mockTos.EXPECT().GetObjectUrl(gomock.Any(), gomock.Any(), gomock.Any()).Return("", nil).AnyTimes()
|
mockTos.EXPECT().GetObjectUrl(gomock.Any(), gomock.Any(), gomock.Any()).Return("", nil).AnyTimes()
|
||||||
workflowRepo := service.NewWorkflowRepository(mockIDGen, db, redisClient, mockTos, cpStore, utChatModel)
|
workflowRepo := service.NewWorkflowRepository(mockIDGen, db, redisClient, mockTos, cpStore, nil)
|
||||||
mockey.Mock(appworkflow.GetWorkflowDomainSVC).Return(service.NewWorkflowService(workflowRepo)).Build()
|
mockey.Mock(appworkflow.GetWorkflowDomainSVC).Return(service.NewWorkflowService(workflowRepo)).Build()
|
||||||
mockey.Mock(workflow2.GetRepository).Return(workflowRepo).Build()
|
mockey.Mock(workflow2.GetRepository).Return(workflowRepo).Build()
|
||||||
|
|
||||||
@ -314,23 +306,22 @@ func newWfTestRunner(t *testing.T) *wfTestRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &wfTestRunner{
|
return &wfTestRunner{
|
||||||
t: t,
|
t: t,
|
||||||
h: h,
|
h: h,
|
||||||
ctrl: ctrl,
|
ctrl: ctrl,
|
||||||
idGen: mockIDGen,
|
idGen: mockIDGen,
|
||||||
search: mockSearchNotify,
|
search: mockSearchNotify,
|
||||||
appVarS: mockGlobalAppVarStore,
|
appVarS: mockGlobalAppVarStore,
|
||||||
userVarS: mockGlobalUserVarStore,
|
userVarS: mockGlobalUserVarStore,
|
||||||
varGetter: mockVarGetter,
|
varGetter: mockVarGetter,
|
||||||
modelManage: mockModelManage,
|
modelManage: mockModelManage,
|
||||||
plugin: mPlugin,
|
plugin: mPlugin,
|
||||||
tos: mockTos,
|
tos: mockTos,
|
||||||
knowledge: mockKwOperator,
|
knowledge: mockKwOperator,
|
||||||
database: mockDatabaseOperator,
|
database: mockDatabaseOperator,
|
||||||
internalModel: utChatModel,
|
ctx: context.Background(),
|
||||||
ctx: context.Background(),
|
closeFn: f,
|
||||||
closeFn: f,
|
pluginSrv: mockPluginSrv,
|
||||||
pluginSrv: mockPluginSrv,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1113,8 +1104,7 @@ func TestValidateTree(t *testing.T) {
|
|||||||
assert.Equal(t, i.Message, `node "代码_1" not connected`)
|
assert.Equal(t, i.Message, `node "代码_1" not connected`)
|
||||||
}
|
}
|
||||||
if i.NodeError.NodeID == "160892" {
|
if i.NodeError.NodeID == "160892" {
|
||||||
assert.Contains(t, i.Message, `node "意图识别"'s port "branch_1" not connected`)
|
assert.Contains(t, i.Message, `node "意图识别"'s port "branch_1" not connected`, `node "意图识别"'s port "default" not connected;`)
|
||||||
assert.Contains(t, i.Message, `node "意图识别"'s port "default" not connected`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1161,8 +1151,7 @@ func TestValidateTree(t *testing.T) {
|
|||||||
assert.Equal(t, i.Message, `node "代码_1" not connected`)
|
assert.Equal(t, i.Message, `node "代码_1" not connected`)
|
||||||
}
|
}
|
||||||
if i.NodeError.NodeID == "160892" {
|
if i.NodeError.NodeID == "160892" {
|
||||||
assert.Contains(t, i.Message, `node "意图识别"'s port "branch_1" not connected`)
|
assert.Contains(t, i.Message, `node "意图识别"'s port "branch_1" not connected`, `node "意图识别"'s port "default" not connected;`)
|
||||||
assert.Contains(t, i.Message, `node "意图识别"'s port "default" not connected`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2955,41 +2944,41 @@ func TestLLMWithSkills(t *testing.T) {
|
|||||||
r := newWfTestRunner(t)
|
r := newWfTestRunner(t)
|
||||||
defer r.closeFn()
|
defer r.closeFn()
|
||||||
|
|
||||||
utChatModel := r.internalModel
|
utChatModel := &testutil.UTChatModel{
|
||||||
utChatModel.InvokeResultProvider = func(index int, in []*schema.Message) (*schema.Message, error) {
|
InvokeResultProvider: func(index int, in []*schema.Message) (*schema.Message, error) {
|
||||||
if index == 0 {
|
if index == 0 {
|
||||||
assert.Equal(t, 1, len(in))
|
assert.Equal(t, 1, len(in))
|
||||||
assert.Contains(t, in[0].Content, "7512369185624686592", "你是一个知识库意图识别AI Agent", "北京有哪些著名的景点")
|
assert.Contains(t, in[0].Content, "7512369185624686592", "你是一个知识库意图识别AI Agent", "北京有哪些著名的景点")
|
||||||
return &schema.Message{
|
return &schema.Message{
|
||||||
Role: schema.Assistant,
|
Role: schema.Assistant,
|
||||||
Content: "7512369185624686592",
|
Content: "7512369185624686592",
|
||||||
ResponseMeta: &schema.ResponseMeta{
|
ResponseMeta: &schema.ResponseMeta{
|
||||||
Usage: &schema.TokenUsage{
|
Usage: &schema.TokenUsage{
|
||||||
PromptTokens: 10,
|
PromptTokens: 10,
|
||||||
CompletionTokens: 11,
|
CompletionTokens: 11,
|
||||||
TotalTokens: 21,
|
TotalTokens: 21,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}, nil
|
||||||
}, nil
|
|
||||||
|
|
||||||
} else if index == 1 {
|
} else if index == 1 {
|
||||||
assert.Equal(t, 2, len(in))
|
assert.Equal(t, 2, len(in))
|
||||||
for _, message := range in {
|
for _, message := range in {
|
||||||
if message.Role == schema.System {
|
if message.Role == schema.System {
|
||||||
assert.Equal(t, "你是一个旅游推荐专家,通过用户提出的问题,推荐用户具体城市的旅游景点", message.Content)
|
assert.Equal(t, "你是一个旅游推荐专家,通过用户提出的问题,推荐用户具体城市的旅游景点", message.Content)
|
||||||
}
|
}
|
||||||
if message.Role == schema.User {
|
if message.Role == schema.User {
|
||||||
assert.Contains(t, message.Content, "天安门广场 :中国政治文化中心,见证了近现代重大历史事件", "八达岭长城 :明代长城的精华段,被誉为“不到长城非好汉")
|
assert.Contains(t, message.Content, "天安门广场 :中国政治文化中心,见证了近现代重大历史事件", "八达岭长城 :明代长城的精华段,被誉为“不到长城非好汉")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return &schema.Message{
|
||||||
|
Role: schema.Assistant,
|
||||||
|
Content: `八达岭长城 :明代长城的精华段,被誉为“不到长城非好汉`,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
return &schema.Message{
|
return nil, fmt.Errorf("unexpected index: %d", index)
|
||||||
Role: schema.Assistant,
|
},
|
||||||
Content: `八达岭长城 :明代长城的精华段,被誉为“不到长城非好汉`,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
return nil, fmt.Errorf("unexpected index: %d", index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r.modelManage.EXPECT().GetModel(gomock.Any(), gomock.Any()).Return(utChatModel, nil, nil).AnyTimes()
|
r.modelManage.EXPECT().GetModel(gomock.Any(), gomock.Any()).Return(utChatModel, nil, nil).AnyTimes()
|
||||||
|
|
||||||
r.knowledge.EXPECT().ListKnowledgeDetail(gomock.Any(), gomock.Any()).Return(&knowledge.ListKnowledgeDetailResponse{
|
r.knowledge.EXPECT().ListKnowledgeDetail(gomock.Any(), gomock.Any()).Return(&knowledge.ListKnowledgeDetailResponse{
|
||||||
@ -3772,10 +3761,10 @@ func TestReleaseApplicationWorkflows(t *testing.T) {
|
|||||||
var validateCv func(ns []*vo.Node)
|
var validateCv func(ns []*vo.Node)
|
||||||
validateCv = func(ns []*vo.Node) {
|
validateCv = func(ns []*vo.Node) {
|
||||||
for _, n := range ns {
|
for _, n := range ns {
|
||||||
if n.Type == entity.NodeTypeSubWorkflow.IDStr() {
|
if n.Type == vo.BlockTypeBotSubWorkflow {
|
||||||
assert.Equal(t, n.Data.Inputs.WorkflowVersion, version)
|
assert.Equal(t, n.Data.Inputs.WorkflowVersion, version)
|
||||||
}
|
}
|
||||||
if n.Type == entity.NodeTypePlugin.IDStr() {
|
if n.Type == vo.BlockTypeBotAPI {
|
||||||
for _, apiParam := range n.Data.Inputs.APIParams {
|
for _, apiParam := range n.Data.Inputs.APIParams {
|
||||||
// In the application, the workflow plugin node When the plugin version is equal to 0, the plugin is a plugin created in the application
|
// In the application, the workflow plugin node When the plugin version is equal to 0, the plugin is a plugin created in the application
|
||||||
if apiParam.Name == "pluginVersion" {
|
if apiParam.Name == "pluginVersion" {
|
||||||
@ -3784,7 +3773,7 @@ func TestReleaseApplicationWorkflows(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if n.Type == entity.NodeTypeLLM.IDStr() {
|
if n.Type == vo.BlockTypeBotLLM {
|
||||||
if n.Data.Inputs.FCParam != nil && n.Data.Inputs.FCParam.PluginFCParam != nil {
|
if n.Data.Inputs.FCParam != nil && n.Data.Inputs.FCParam.PluginFCParam != nil {
|
||||||
// In the application, the workflow llm node When the plugin version is equal to 0, the plugin is a plugin created in the application
|
// In the application, the workflow llm node When the plugin version is equal to 0, the plugin is a plugin created in the application
|
||||||
for _, p := range n.Data.Inputs.FCParam.PluginFCParam.PluginList {
|
for _, p := range n.Data.Inputs.FCParam.PluginFCParam.PluginList {
|
||||||
@ -4068,8 +4057,8 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
|
|||||||
var validateSubWorkflowIDs func(nodes []*vo.Node)
|
var validateSubWorkflowIDs func(nodes []*vo.Node)
|
||||||
validateSubWorkflowIDs = func(nodes []*vo.Node) {
|
validateSubWorkflowIDs = func(nodes []*vo.Node) {
|
||||||
for _, node := range nodes {
|
for _, node := range nodes {
|
||||||
switch entity.IDStrToNodeType(node.Type) {
|
switch node.Type {
|
||||||
case entity.NodeTypePlugin:
|
case vo.BlockTypeBotAPI:
|
||||||
apiParams := slices.ToMap(node.Data.Inputs.APIParams, func(e *vo.Param) (string, *vo.Param) {
|
apiParams := slices.ToMap(node.Data.Inputs.APIParams, func(e *vo.Param) (string, *vo.Param) {
|
||||||
return e.Name, e
|
return e.Name, e
|
||||||
})
|
})
|
||||||
@ -4087,7 +4076,7 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
|
|||||||
assert.Equal(t, "100100", pID)
|
assert.Equal(t, "100100", pID)
|
||||||
}
|
}
|
||||||
|
|
||||||
case entity.NodeTypeSubWorkflow:
|
case vo.BlockTypeBotSubWorkflow:
|
||||||
assert.True(t, copiedIDMap[node.Data.Inputs.WorkflowID])
|
assert.True(t, copiedIDMap[node.Data.Inputs.WorkflowID])
|
||||||
wfId, err := strconv.ParseInt(node.Data.Inputs.WorkflowID, 10, 64)
|
wfId, err := strconv.ParseInt(node.Data.Inputs.WorkflowID, 10, 64)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@ -4101,7 +4090,7 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
|
|||||||
err = sonic.UnmarshalString(subWf.Canvas, subworkflowCanvas)
|
err = sonic.UnmarshalString(subWf.Canvas, subworkflowCanvas)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
validateSubWorkflowIDs(subworkflowCanvas.Nodes)
|
validateSubWorkflowIDs(subworkflowCanvas.Nodes)
|
||||||
case entity.NodeTypeLLM:
|
case vo.BlockTypeBotLLM:
|
||||||
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
|
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
|
||||||
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
|
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
|
||||||
assert.True(t, copiedIDMap[w.WorkflowID])
|
assert.True(t, copiedIDMap[w.WorkflowID])
|
||||||
@ -4121,13 +4110,13 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
|
|||||||
assert.Equal(t, "100100", k.ID)
|
assert.Equal(t, "100100", k.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case entity.NodeTypeKnowledgeIndexer, entity.NodeTypeKnowledgeRetriever:
|
case vo.BlockTypeBotDataset, vo.BlockTypeBotDatasetWrite:
|
||||||
datasetListInfoParam := node.Data.Inputs.DatasetParam[0]
|
datasetListInfoParam := node.Data.Inputs.DatasetParam[0]
|
||||||
knowledgeIDs := datasetListInfoParam.Input.Value.Content.([]any)
|
knowledgeIDs := datasetListInfoParam.Input.Value.Content.([]any)
|
||||||
for idx := range knowledgeIDs {
|
for idx := range knowledgeIDs {
|
||||||
assert.Equal(t, "100100", knowledgeIDs[idx].(string))
|
assert.Equal(t, "100100", knowledgeIDs[idx].(string))
|
||||||
}
|
}
|
||||||
case entity.NodeTypeDatabaseCustomSQL, entity.NodeTypeDatabaseQuery, entity.NodeTypeDatabaseInsert, entity.NodeTypeDatabaseDelete, entity.NodeTypeDatabaseUpdate:
|
case vo.BlockTypeDatabase, vo.BlockTypeDatabaseSelect, vo.BlockTypeDatabaseInsert, vo.BlockTypeDatabaseDelete, vo.BlockTypeDatabaseUpdate:
|
||||||
for _, d := range node.Data.Inputs.DatabaseInfoList {
|
for _, d := range node.Data.Inputs.DatabaseInfoList {
|
||||||
assert.Equal(t, "100100", d.DatabaseInfoID)
|
assert.Equal(t, "100100", d.DatabaseInfoID)
|
||||||
}
|
}
|
||||||
@ -4213,10 +4202,10 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
|
|||||||
var validateSubWorkflowIDs func(nodes []*vo.Node)
|
var validateSubWorkflowIDs func(nodes []*vo.Node)
|
||||||
validateSubWorkflowIDs = func(nodes []*vo.Node) {
|
validateSubWorkflowIDs = func(nodes []*vo.Node) {
|
||||||
for _, node := range nodes {
|
for _, node := range nodes {
|
||||||
switch entity.IDStrToNodeType(node.Type) {
|
switch node.Type {
|
||||||
case entity.NodeTypeSubWorkflow:
|
case vo.BlockTypeBotSubWorkflow:
|
||||||
assert.True(t, copiedIDMap[node.Data.Inputs.WorkflowID])
|
assert.True(t, copiedIDMap[node.Data.Inputs.WorkflowID])
|
||||||
case entity.NodeTypeLLM:
|
case vo.BlockTypeBotLLM:
|
||||||
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
|
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
|
||||||
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
|
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
|
||||||
assert.True(t, copiedIDMap[w.WorkflowID])
|
assert.True(t, copiedIDMap[w.WorkflowID])
|
||||||
@ -4234,13 +4223,13 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
|
|||||||
assert.Equal(t, "100100", k.ID)
|
assert.Equal(t, "100100", k.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case entity.NodeTypeKnowledgeIndexer, entity.NodeTypeKnowledgeRetriever:
|
case vo.BlockTypeBotDataset, vo.BlockTypeBotDatasetWrite:
|
||||||
datasetListInfoParam := node.Data.Inputs.DatasetParam[0]
|
datasetListInfoParam := node.Data.Inputs.DatasetParam[0]
|
||||||
knowledgeIDs := datasetListInfoParam.Input.Value.Content.([]any)
|
knowledgeIDs := datasetListInfoParam.Input.Value.Content.([]any)
|
||||||
for idx := range knowledgeIDs {
|
for idx := range knowledgeIDs {
|
||||||
assert.Equal(t, "100100", knowledgeIDs[idx].(string))
|
assert.Equal(t, "100100", knowledgeIDs[idx].(string))
|
||||||
}
|
}
|
||||||
case entity.NodeTypeDatabaseCustomSQL, entity.NodeTypeDatabaseQuery, entity.NodeTypeDatabaseInsert, entity.NodeTypeDatabaseDelete, entity.NodeTypeDatabaseUpdate:
|
case vo.BlockTypeDatabase, vo.BlockTypeDatabaseSelect, vo.BlockTypeDatabaseInsert, vo.BlockTypeDatabaseDelete, vo.BlockTypeDatabaseUpdate:
|
||||||
for _, d := range node.Data.Inputs.DatabaseInfoList {
|
for _, d := range node.Data.Inputs.DatabaseInfoList {
|
||||||
assert.Equal(t, "100100", d.DatabaseInfoID)
|
assert.Equal(t, "100100", d.DatabaseInfoID)
|
||||||
}
|
}
|
||||||
@ -4361,7 +4350,7 @@ func TestMoveWorkflowAppToLibrary(t *testing.T) {
|
|||||||
err = sonic.Unmarshal(data, mainCanvas)
|
err = sonic.Unmarshal(data, mainCanvas)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
for _, node := range mainCanvas.Nodes {
|
for _, node := range mainCanvas.Nodes {
|
||||||
if node.Type == entity.NodeTypeSubWorkflow.IDStr() {
|
if node.Type == vo.BlockTypeBotSubWorkflow {
|
||||||
if node.Data.Inputs.WorkflowID == "7516826260387921920" {
|
if node.Data.Inputs.WorkflowID == "7516826260387921920" {
|
||||||
node.Data.Inputs.WorkflowID = c1IdStr
|
node.Data.Inputs.WorkflowID = c1IdStr
|
||||||
}
|
}
|
||||||
@ -4377,7 +4366,7 @@ func TestMoveWorkflowAppToLibrary(t *testing.T) {
|
|||||||
err = sonic.Unmarshal(cc1Data, cc1Canvas)
|
err = sonic.Unmarshal(cc1Data, cc1Canvas)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
for _, node := range cc1Canvas.Nodes {
|
for _, node := range cc1Canvas.Nodes {
|
||||||
if node.Type == entity.NodeTypeSubWorkflow.IDStr() {
|
if node.Type == vo.BlockTypeBotSubWorkflow {
|
||||||
if node.Data.Inputs.WorkflowID == "7516826283318181888" {
|
if node.Data.Inputs.WorkflowID == "7516826283318181888" {
|
||||||
node.Data.Inputs.WorkflowID = c2IdStr
|
node.Data.Inputs.WorkflowID = c2IdStr
|
||||||
}
|
}
|
||||||
@ -4428,7 +4417,7 @@ func TestMoveWorkflowAppToLibrary(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
for _, node := range newMainCanvas.Nodes {
|
for _, node := range newMainCanvas.Nodes {
|
||||||
if node.Type == entity.NodeTypeSubWorkflow.IDStr() {
|
if node.Type == vo.BlockTypeBotSubWorkflow {
|
||||||
assert.True(t, newSubWorkflowID[node.Data.Inputs.WorkflowID])
|
assert.True(t, newSubWorkflowID[node.Data.Inputs.WorkflowID])
|
||||||
assert.Equal(t, "v0.0.1", node.Data.Inputs.WorkflowVersion)
|
assert.Equal(t, "v0.0.1", node.Data.Inputs.WorkflowVersion)
|
||||||
}
|
}
|
||||||
@ -4442,7 +4431,7 @@ func TestMoveWorkflowAppToLibrary(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
for _, node := range cc1Canvas.Nodes {
|
for _, node := range cc1Canvas.Nodes {
|
||||||
if node.Type == entity.NodeTypeSubWorkflow.IDStr() {
|
if node.Type == vo.BlockTypeBotSubWorkflow {
|
||||||
assert.True(t, newSubWorkflowID[node.Data.Inputs.WorkflowID])
|
assert.True(t, newSubWorkflowID[node.Data.Inputs.WorkflowID])
|
||||||
assert.Equal(t, "v0.0.1", node.Data.Inputs.WorkflowVersion)
|
assert.Equal(t, "v0.0.1", node.Data.Inputs.WorkflowVersion)
|
||||||
}
|
}
|
||||||
@ -4513,10 +4502,10 @@ func TestDuplicateWorkflowsByAppID(t *testing.T) {
|
|||||||
var validateSubWorkflowIDs func(nodes []*vo.Node)
|
var validateSubWorkflowIDs func(nodes []*vo.Node)
|
||||||
validateSubWorkflowIDs = func(nodes []*vo.Node) {
|
validateSubWorkflowIDs = func(nodes []*vo.Node) {
|
||||||
for _, node := range nodes {
|
for _, node := range nodes {
|
||||||
if node.Type == entity.NodeTypeSubWorkflow.IDStr() {
|
if node.Type == vo.BlockTypeBotSubWorkflow {
|
||||||
assert.True(t, copiedIDMap[node.Data.Inputs.WorkflowID])
|
assert.True(t, copiedIDMap[node.Data.Inputs.WorkflowID])
|
||||||
}
|
}
|
||||||
if node.Type == entity.NodeTypeLLM.IDStr() {
|
if node.Type == vo.BlockTypeBotLLM {
|
||||||
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
|
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
|
||||||
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
|
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
|
||||||
assert.True(t, copiedIDMap[w.WorkflowID])
|
assert.True(t, copiedIDMap[w.WorkflowID])
|
||||||
|
|||||||
@ -61,13 +61,9 @@ func isStaticFile(ctx *app.RequestContext) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(path, "/static/") ||
|
if strings.HasPrefix(string(path), "/static/") ||
|
||||||
strings.HasPrefix(path, "/explore/") ||
|
strings.HasPrefix(string(path), "/explore/") ||
|
||||||
strings.HasPrefix(path, "/space/") {
|
strings.HasPrefix(string(path), "/space/") {
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if path == "/information/auth/success" {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
765
backend/api/model/common/common.go
Normal file
765
backend/api/model/common/common.go
Normal file
@ -0,0 +1,765 @@
|
|||||||
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
|
package common
|
||||||
|
|
||||||
|
import (
|
||||||
|
"database/sql"
|
||||||
|
"database/sql/driver"
|
||||||
|
"fmt"
|
||||||
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ColumnType int64
|
||||||
|
|
||||||
|
const (
|
||||||
|
ColumnType_Unknown ColumnType = 0
|
||||||
|
// Text
|
||||||
|
ColumnType_Text ColumnType = 1
|
||||||
|
// number
|
||||||
|
ColumnType_Number ColumnType = 2
|
||||||
|
// time
|
||||||
|
ColumnType_Date ColumnType = 3
|
||||||
|
// float
|
||||||
|
ColumnType_Float ColumnType = 4
|
||||||
|
// bool
|
||||||
|
ColumnType_Boolean ColumnType = 5
|
||||||
|
// picture
|
||||||
|
ColumnType_Image ColumnType = 6
|
||||||
|
)
|
||||||
|
|
||||||
|
func (p ColumnType) String() string {
|
||||||
|
switch p {
|
||||||
|
case ColumnType_Unknown:
|
||||||
|
return "Unknown"
|
||||||
|
case ColumnType_Text:
|
||||||
|
return "Text"
|
||||||
|
case ColumnType_Number:
|
||||||
|
return "Number"
|
||||||
|
case ColumnType_Date:
|
||||||
|
return "Date"
|
||||||
|
case ColumnType_Float:
|
||||||
|
return "Float"
|
||||||
|
case ColumnType_Boolean:
|
||||||
|
return "Boolean"
|
||||||
|
case ColumnType_Image:
|
||||||
|
return "Image"
|
||||||
|
}
|
||||||
|
return "<UNSET>"
|
||||||
|
}
|
||||||
|
|
||||||
|
func ColumnTypeFromString(s string) (ColumnType, error) {
|
||||||
|
switch s {
|
||||||
|
case "Unknown":
|
||||||
|
return ColumnType_Unknown, nil
|
||||||
|
case "Text":
|
||||||
|
return ColumnType_Text, nil
|
||||||
|
case "Number":
|
||||||
|
return ColumnType_Number, nil
|
||||||
|
case "Date":
|
||||||
|
return ColumnType_Date, nil
|
||||||
|
case "Float":
|
||||||
|
return ColumnType_Float, nil
|
||||||
|
case "Boolean":
|
||||||
|
return ColumnType_Boolean, nil
|
||||||
|
case "Image":
|
||||||
|
return ColumnType_Image, nil
|
||||||
|
}
|
||||||
|
return ColumnType(0), fmt.Errorf("not a valid ColumnType string")
|
||||||
|
}
|
||||||
|
|
||||||
|
func ColumnTypePtr(v ColumnType) *ColumnType { return &v }
|
||||||
|
func (p *ColumnType) Scan(value interface{}) (err error) {
|
||||||
|
var result sql.NullInt64
|
||||||
|
err = result.Scan(value)
|
||||||
|
*p = ColumnType(result.Int64)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *ColumnType) Value() (driver.Value, error) {
|
||||||
|
if p == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return int64(*p), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocTableSheet struct {
|
||||||
|
// Number of sheet
|
||||||
|
ID int64 `thrift:"id,1" form:"id" json:"id" query:"id"`
|
||||||
|
// Sheet name
|
||||||
|
SheetName string `thrift:"sheet_name,2" form:"sheet_name" json:"sheet_name" query:"sheet_name"`
|
||||||
|
// total number of rows
|
||||||
|
TotalRow int64 `thrift:"total_row,3" form:"total_row" json:"total_row" query:"total_row"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDocTableSheet() *DocTableSheet {
|
||||||
|
return &DocTableSheet{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) GetID() (v int64) {
|
||||||
|
return p.ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) GetSheetName() (v string) {
|
||||||
|
return p.SheetName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) GetTotalRow() (v int64) {
|
||||||
|
return p.TotalRow
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_DocTableSheet = map[int16]string{
|
||||||
|
1: "id",
|
||||||
|
2: "sheet_name",
|
||||||
|
3: "total_row",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField2(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField3(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableSheet[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.ID = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableSheet) ReadField2(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.SheetName = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableSheet) ReadField3(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.TotalRow = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("DocTableSheet"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField2(oprot); err != nil {
|
||||||
|
fieldId = 2
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField3(oprot); err != nil {
|
||||||
|
fieldId = 3
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(p.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableSheet) writeField2(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("sheet_name", thrift.STRING, 2); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(p.SheetName); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableSheet) writeField3(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("total_row", thrift.I64, 3); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(p.TotalRow); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableSheet) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("DocTableSheet(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Table column information
|
||||||
|
type DocTableColumn struct {
|
||||||
|
// Column ID
|
||||||
|
ID int64 `thrift:"id,1" form:"id" json:"id,string"`
|
||||||
|
// column_name
|
||||||
|
ColumnName string `thrift:"column_name,2" form:"column_name" json:"column_name" query:"column_name"`
|
||||||
|
// Is it a semantically matched column?
|
||||||
|
IsSemantic bool `thrift:"is_semantic,3" form:"is_semantic" json:"is_semantic" query:"is_semantic"`
|
||||||
|
// List the serial number originally in excel
|
||||||
|
Sequence int64 `thrift:"sequence,4" form:"sequence" json:"sequence,string"`
|
||||||
|
// column type
|
||||||
|
ColumnType *ColumnType `thrift:"column_type,5,optional" form:"column_type" json:"column_type,omitempty" query:"column_type"`
|
||||||
|
ContainsEmptyValue *bool `thrift:"contains_empty_value,6,optional" form:"contains_empty_value" json:"contains_empty_value,omitempty" query:"contains_empty_value"`
|
||||||
|
// describe
|
||||||
|
Desc *string `thrift:"desc,7,optional" form:"desc" json:"desc,omitempty" query:"desc"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDocTableColumn() *DocTableColumn {
|
||||||
|
return &DocTableColumn{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetID() (v int64) {
|
||||||
|
return p.ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetColumnName() (v string) {
|
||||||
|
return p.ColumnName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetIsSemantic() (v bool) {
|
||||||
|
return p.IsSemantic
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetSequence() (v int64) {
|
||||||
|
return p.Sequence
|
||||||
|
}
|
||||||
|
|
||||||
|
var DocTableColumn_ColumnType_DEFAULT ColumnType
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetColumnType() (v ColumnType) {
|
||||||
|
if !p.IsSetColumnType() {
|
||||||
|
return DocTableColumn_ColumnType_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.ColumnType
|
||||||
|
}
|
||||||
|
|
||||||
|
var DocTableColumn_ContainsEmptyValue_DEFAULT bool
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetContainsEmptyValue() (v bool) {
|
||||||
|
if !p.IsSetContainsEmptyValue() {
|
||||||
|
return DocTableColumn_ContainsEmptyValue_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.ContainsEmptyValue
|
||||||
|
}
|
||||||
|
|
||||||
|
var DocTableColumn_Desc_DEFAULT string
|
||||||
|
|
||||||
|
func (p *DocTableColumn) GetDesc() (v string) {
|
||||||
|
if !p.IsSetDesc() {
|
||||||
|
return DocTableColumn_Desc_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.Desc
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_DocTableColumn = map[int16]string{
|
||||||
|
1: "id",
|
||||||
|
2: "column_name",
|
||||||
|
3: "is_semantic",
|
||||||
|
4: "sequence",
|
||||||
|
5: "column_type",
|
||||||
|
6: "contains_empty_value",
|
||||||
|
7: "desc",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) IsSetColumnType() bool {
|
||||||
|
return p.ColumnType != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) IsSetContainsEmptyValue() bool {
|
||||||
|
return p.ContainsEmptyValue != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) IsSetDesc() bool {
|
||||||
|
return p.Desc != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField2(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
if fieldTypeId == thrift.BOOL {
|
||||||
|
if err = p.ReadField3(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField4(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
if fieldTypeId == thrift.I32 {
|
||||||
|
if err = p.ReadField5(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
if fieldTypeId == thrift.BOOL {
|
||||||
|
if err = p.ReadField6(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 7:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField7(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableColumn[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.ID = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) ReadField2(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.ColumnName = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) ReadField3(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field bool
|
||||||
|
if v, err := iprot.ReadBool(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.IsSemantic = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) ReadField4(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.Sequence = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) ReadField5(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *ColumnType
|
||||||
|
if v, err := iprot.ReadI32(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
tmp := ColumnType(v)
|
||||||
|
_field = &tmp
|
||||||
|
}
|
||||||
|
p.ColumnType = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) ReadField6(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *bool
|
||||||
|
if v, err := iprot.ReadBool(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.ContainsEmptyValue = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) ReadField7(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.Desc = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("DocTableColumn"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField2(oprot); err != nil {
|
||||||
|
fieldId = 2
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField3(oprot); err != nil {
|
||||||
|
fieldId = 3
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField4(oprot); err != nil {
|
||||||
|
fieldId = 4
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField5(oprot); err != nil {
|
||||||
|
fieldId = 5
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField6(oprot); err != nil {
|
||||||
|
fieldId = 6
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField7(oprot); err != nil {
|
||||||
|
fieldId = 7
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(p.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) writeField2(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("column_name", thrift.STRING, 2); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(p.ColumnName); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) writeField3(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("is_semantic", thrift.BOOL, 3); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteBool(p.IsSemantic); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) writeField4(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("sequence", thrift.I64, 4); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(p.Sequence); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) writeField5(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetColumnType() {
|
||||||
|
if err = oprot.WriteFieldBegin("column_type", thrift.I32, 5); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI32(int32(*p.ColumnType)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) writeField6(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetContainsEmptyValue() {
|
||||||
|
if err = oprot.WriteFieldBegin("contains_empty_value", thrift.BOOL, 6); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteBool(*p.ContainsEmptyValue); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *DocTableColumn) writeField7(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetDesc() {
|
||||||
|
if err = oprot.WriteFieldBegin("desc", thrift.STRING, 7); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(*p.Desc); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *DocTableColumn) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("DocTableColumn(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,42 +1,26 @@
|
|||||||
/*
|
|
||||||
* Copyright 2025 coze-dev Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package coze
|
package coze
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/conversation/agentrun"
|
"github.com/coze-dev/coze-studio/backend/api/model/conversation/agentrun"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/conversation/conversation"
|
"github.com/coze-dev/coze-studio/backend/api/model/conversation/conversation"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/conversation/message"
|
"github.com/coze-dev/coze-studio/backend/api/model/conversation/message"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database"
|
"github.com/coze-dev/coze-studio/backend/api/model/database"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/file/upload"
|
"github.com/coze-dev/coze-studio/backend/api/model/file/upload"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_open_api"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/memory"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/passport"
|
"github.com/coze-dev/coze-studio/backend/api/model/passport"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/permission/openapiauth"
|
"github.com/coze-dev/coze-studio/backend/api/model/permission/openapiauth"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/resource"
|
"github.com/coze-dev/coze-studio/backend/api/model/resource"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type IntelligenceService interface {
|
type IntelligenceService interface {
|
||||||
@ -170,28 +154,28 @@ func NewOpenAPIAuthServiceClient(c thrift.TClient) *OpenAPIAuthServiceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MemoryService interface {
|
type MemoryService interface {
|
||||||
variable.MemoryService
|
memory.MemoryService
|
||||||
}
|
}
|
||||||
|
|
||||||
type MemoryServiceClient struct {
|
type MemoryServiceClient struct {
|
||||||
*variable.MemoryServiceClient
|
*memory.MemoryServiceClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMemoryServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MemoryServiceClient {
|
func NewMemoryServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MemoryServiceClient {
|
||||||
return &MemoryServiceClient{
|
return &MemoryServiceClient{
|
||||||
MemoryServiceClient: variable.NewMemoryServiceClientFactory(t, f),
|
MemoryServiceClient: memory.NewMemoryServiceClientFactory(t, f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMemoryServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *MemoryServiceClient {
|
func NewMemoryServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *MemoryServiceClient {
|
||||||
return &MemoryServiceClient{
|
return &MemoryServiceClient{
|
||||||
MemoryServiceClient: variable.NewMemoryServiceClientProtocol(t, iprot, oprot),
|
MemoryServiceClient: memory.NewMemoryServiceClientProtocol(t, iprot, oprot),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMemoryServiceClient(c thrift.TClient) *MemoryServiceClient {
|
func NewMemoryServiceClient(c thrift.TClient) *MemoryServiceClient {
|
||||||
return &MemoryServiceClient{
|
return &MemoryServiceClient{
|
||||||
MemoryServiceClient: variable.NewMemoryServiceClient(c),
|
MemoryServiceClient: memory.NewMemoryServiceClient(c),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,28 +388,28 @@ func NewWorkflowServiceClient(c thrift.TClient) *WorkflowServiceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type KnowledgeService interface {
|
type KnowledgeService interface {
|
||||||
knowledge.DatasetService
|
dataset.DatasetService
|
||||||
}
|
}
|
||||||
|
|
||||||
type KnowledgeServiceClient struct {
|
type KnowledgeServiceClient struct {
|
||||||
*knowledge.DatasetServiceClient
|
*dataset.DatasetServiceClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewKnowledgeServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *KnowledgeServiceClient {
|
func NewKnowledgeServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *KnowledgeServiceClient {
|
||||||
return &KnowledgeServiceClient{
|
return &KnowledgeServiceClient{
|
||||||
DatasetServiceClient: knowledge.NewDatasetServiceClientFactory(t, f),
|
DatasetServiceClient: dataset.NewDatasetServiceClientFactory(t, f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewKnowledgeServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *KnowledgeServiceClient {
|
func NewKnowledgeServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *KnowledgeServiceClient {
|
||||||
return &KnowledgeServiceClient{
|
return &KnowledgeServiceClient{
|
||||||
DatasetServiceClient: knowledge.NewDatasetServiceClientProtocol(t, iprot, oprot),
|
DatasetServiceClient: dataset.NewDatasetServiceClientProtocol(t, iprot, oprot),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewKnowledgeServiceClient(c thrift.TClient) *KnowledgeServiceClient {
|
func NewKnowledgeServiceClient(c thrift.TClient) *KnowledgeServiceClient {
|
||||||
return &KnowledgeServiceClient{
|
return &KnowledgeServiceClient{
|
||||||
DatasetServiceClient: knowledge.NewDatasetServiceClient(c),
|
DatasetServiceClient: dataset.NewDatasetServiceClient(c),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,11 +511,11 @@ func NewOpenAPIAuthServiceProcessor(handler OpenAPIAuthService) *OpenAPIAuthServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MemoryServiceProcessor struct {
|
type MemoryServiceProcessor struct {
|
||||||
*variable.MemoryServiceProcessor
|
*memory.MemoryServiceProcessor
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMemoryServiceProcessor(handler MemoryService) *MemoryServiceProcessor {
|
func NewMemoryServiceProcessor(handler MemoryService) *MemoryServiceProcessor {
|
||||||
self := &MemoryServiceProcessor{variable.NewMemoryServiceProcessor(handler)}
|
self := &MemoryServiceProcessor{memory.NewMemoryServiceProcessor(handler)}
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -608,11 +592,11 @@ func NewWorkflowServiceProcessor(handler WorkflowService) *WorkflowServiceProces
|
|||||||
}
|
}
|
||||||
|
|
||||||
type KnowledgeServiceProcessor struct {
|
type KnowledgeServiceProcessor struct {
|
||||||
*knowledge.DatasetServiceProcessor
|
*dataset.DatasetServiceProcessor
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewKnowledgeServiceProcessor(handler KnowledgeService) *KnowledgeServiceProcessor {
|
func NewKnowledgeServiceProcessor(handler KnowledgeService) *KnowledgeServiceProcessor {
|
||||||
self := &KnowledgeServiceProcessor{knowledge.NewDatasetServiceProcessor(handler)}
|
self := &KnowledgeServiceProcessor{dataset.NewDatasetServiceProcessor(handler)}
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package connector
|
package connector
|
||||||
|
|
||||||
import "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
|
|
||||||
type Connector struct {
|
type Connector struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
package database
|
package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExecuteSQLRequest struct {
|
type ExecuteSQLRequest struct {
|
||||||
|
|||||||
@ -101,7 +101,4 @@ const (
|
|||||||
MessageTypeFlowUp MessageType = "follow_up"
|
MessageTypeFlowUp MessageType = "follow_up"
|
||||||
MessageTypeInterrupt MessageType = "interrupt"
|
MessageTypeInterrupt MessageType = "interrupt"
|
||||||
MessageTypeVerbose MessageType = "verbose"
|
MessageTypeVerbose MessageType = "verbose"
|
||||||
|
|
||||||
MessageTypeToolAsAnswer MessageType = "tool_as_answer"
|
|
||||||
MessageTypeToolMidAnswer MessageType = "tool_mid_answer"
|
|
||||||
)
|
)
|
||||||
|
|||||||
@ -77,7 +77,6 @@ type InvalidResponseProcessStrategy int8
|
|||||||
const (
|
const (
|
||||||
InvalidResponseProcessStrategyOfReturnRaw InvalidResponseProcessStrategy = 0 // If the value of a field is invalid, the raw response value of the field is returned.
|
InvalidResponseProcessStrategyOfReturnRaw InvalidResponseProcessStrategy = 0 // If the value of a field is invalid, the raw response value of the field is returned.
|
||||||
InvalidResponseProcessStrategyOfReturnDefault InvalidResponseProcessStrategy = 1 // If the value of a field is invalid, the default value of the field is returned.
|
InvalidResponseProcessStrategyOfReturnDefault InvalidResponseProcessStrategy = 1 // If the value of a field is invalid, the default value of the field is returned.
|
||||||
InvalidResponseProcessStrategyOfReturnErr InvalidResponseProcessStrategy = 2 // If the value of a field is invalid, error is returned.
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
"github.com/getkin/kin-openapi/openapi3"
|
||||||
|
|
||||||
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
)
|
)
|
||||||
|
|
||||||
var httpParamLocations = map[common.ParameterLocation]HTTPParamLocation{
|
var httpParamLocations = map[common.ParameterLocation]HTTPParamLocation{
|
||||||
|
|||||||
@ -181,9 +181,6 @@ func (op *Openapi3Operation) ToEinoSchemaParameterInfo(ctx context.Context) (map
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if subParam == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
subParams[paramName] = subParam
|
subParams[paramName] = subParam
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ package plugin
|
|||||||
import (
|
import (
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
"github.com/getkin/kin-openapi/openapi3"
|
||||||
|
|
||||||
api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type VersionPlugin struct {
|
type VersionPlugin struct {
|
||||||
|
|||||||
@ -19,11 +19,10 @@ package plugin
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/encrypt"
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/utils"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
||||||
"github.com/coze-dev/coze-studio/backend/types/errno"
|
"github.com/coze-dev/coze-studio/backend/types/errno"
|
||||||
|
|
||||||
@ -75,12 +74,7 @@ func (mf *PluginManifest) EncryptAuthPayload() (*PluginManifest, error) {
|
|||||||
return mf_, nil
|
return mf_, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
secret := os.Getenv(encrypt.AuthSecretEnv)
|
payload_, err := utils.EncryptByAES([]byte(mf_.Auth.Payload), utils.AuthSecretKey)
|
||||||
if secret == "" {
|
|
||||||
secret = encrypt.DefaultAuthSecret
|
|
||||||
}
|
|
||||||
|
|
||||||
payload_, err := encrypt.EncryptByAES([]byte(mf_.Auth.Payload), secret)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -363,12 +357,7 @@ func (au *AuthV2) UnmarshalJSON(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if auth.Payload != "" {
|
if auth.Payload != "" {
|
||||||
secret := os.Getenv(encrypt.AuthSecretEnv)
|
payload_, err := utils.DecryptByAES(auth.Payload, utils.AuthSecretKey)
|
||||||
if secret == "" {
|
|
||||||
secret = encrypt.DefaultAuthSecret
|
|
||||||
}
|
|
||||||
|
|
||||||
payload_, err := encrypt.DecryptByAES(auth.Payload, secret)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
auth.Payload = string(payload_)
|
auth.Payload = string(payload_)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,12 +22,14 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"
|
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
"github.com/getkin/kin-openapi/openapi3"
|
||||||
gonanoid "github.com/matoous/go-nanoid"
|
gonanoid "github.com/matoous/go-nanoid"
|
||||||
|
|
||||||
|
productAPI "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
|
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ToolInfo struct {
|
type ToolInfo struct {
|
||||||
@ -38,7 +40,7 @@ type ToolInfo struct {
|
|||||||
Version *string
|
Version *string
|
||||||
|
|
||||||
ActivatedStatus *ActivatedStatus
|
ActivatedStatus *ActivatedStatus
|
||||||
DebugStatus *common.APIDebugStatus
|
DebugStatus *plugin_develop_common.APIDebugStatus
|
||||||
|
|
||||||
Method *string
|
Method *string
|
||||||
SubURL *string
|
SubURL *string
|
||||||
|
|||||||
@ -20,9 +20,9 @@ import (
|
|||||||
"github.com/cloudwego/eino/schema"
|
"github.com/cloudwego/eino/schema"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossworkflow"
|
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossworkflow"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -37,22 +37,17 @@ type AgentRuntime struct {
|
|||||||
type EventType string
|
type EventType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EventTypeOfChatModelAnswer EventType = "chatmodel_answer"
|
EventTypeOfChatModelAnswer EventType = "chatmodel_answer"
|
||||||
EventTypeOfToolsAsChatModelStream EventType = "tools_as_chatmodel_answer"
|
EventTypeOfToolsMessage EventType = "tools_message"
|
||||||
EventTypeOfToolMidAnswer EventType = "tool_mid_answer"
|
EventTypeOfFuncCall EventType = "func_call"
|
||||||
EventTypeOfToolsMessage EventType = "tools_message"
|
EventTypeOfSuggest EventType = "suggest"
|
||||||
EventTypeOfFuncCall EventType = "func_call"
|
EventTypeOfKnowledge EventType = "knowledge"
|
||||||
EventTypeOfSuggest EventType = "suggest"
|
EventTypeOfInterrupt EventType = "interrupt"
|
||||||
EventTypeOfKnowledge EventType = "knowledge"
|
|
||||||
EventTypeOfInterrupt EventType = "interrupt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AgentEvent struct {
|
type AgentEvent struct {
|
||||||
EventType EventType
|
EventType EventType
|
||||||
|
|
||||||
ToolMidAnswer *schema.StreamReader[*schema.Message]
|
|
||||||
ToolAsChatModelAnswer *schema.StreamReader[*schema.Message]
|
|
||||||
|
|
||||||
ChatModelAnswer *schema.StreamReader[*schema.Message]
|
ChatModelAnswer *schema.StreamReader[*schema.Message]
|
||||||
ToolsMessage []*schema.Message
|
ToolsMessage []*schema.Message
|
||||||
FuncCall *schema.Message
|
FuncCall *schema.Message
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
package variables
|
package variables
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserVariableMeta struct {
|
type UserVariableMeta struct {
|
||||||
|
|||||||
@ -6,8 +6,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
"github.com/coze-dev/coze-studio/backend/api/model/knowledge/document"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DatabaseService interface {
|
type DatabaseService interface {
|
||||||
@ -41,7 +41,7 @@ type DatabaseService interface {
|
|||||||
|
|
||||||
UpdateDatabaseBotSwitch(ctx context.Context, req *table.UpdateDatabaseBotSwitchRequest) (r *table.UpdateDatabaseBotSwitchResponse, err error)
|
UpdateDatabaseBotSwitch(ctx context.Context, req *table.UpdateDatabaseBotSwitchRequest) (r *table.UpdateDatabaseBotSwitchResponse, err error)
|
||||||
|
|
||||||
GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *knowledge.GetTableSchemaInfoResponse, err error)
|
GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *document.GetTableSchemaInfoResponse, err error)
|
||||||
|
|
||||||
ValidateDatabaseTableSchema(ctx context.Context, req *table.ValidateTableSchemaRequest) (r *table.ValidateTableSchemaResponse, err error)
|
ValidateDatabaseTableSchema(ctx context.Context, req *table.ValidateTableSchemaRequest) (r *table.ValidateTableSchemaResponse, err error)
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ func (p *DatabaseServiceClient) UpdateDatabaseBotSwitch(ctx context.Context, req
|
|||||||
}
|
}
|
||||||
return _result.GetSuccess(), nil
|
return _result.GetSuccess(), nil
|
||||||
}
|
}
|
||||||
func (p *DatabaseServiceClient) GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *knowledge.GetTableSchemaInfoResponse, err error) {
|
func (p *DatabaseServiceClient) GetDatabaseTableSchema(ctx context.Context, req *table.GetTableSchemaRequest) (r *document.GetTableSchemaInfoResponse, err error) {
|
||||||
var _args DatabaseServiceGetDatabaseTableSchemaArgs
|
var _args DatabaseServiceGetDatabaseTableSchemaArgs
|
||||||
_args.Req = req
|
_args.Req = req
|
||||||
var _result DatabaseServiceGetDatabaseTableSchemaResult
|
var _result DatabaseServiceGetDatabaseTableSchemaResult
|
||||||
@ -1046,7 +1046,7 @@ func (p *databaseServiceProcessorGetDatabaseTableSchema) Process(ctx context.Con
|
|||||||
iprot.ReadMessageEnd()
|
iprot.ReadMessageEnd()
|
||||||
var err2 error
|
var err2 error
|
||||||
result := DatabaseServiceGetDatabaseTableSchemaResult{}
|
result := DatabaseServiceGetDatabaseTableSchemaResult{}
|
||||||
var retval *knowledge.GetTableSchemaInfoResponse
|
var retval *document.GetTableSchemaInfoResponse
|
||||||
if retval, err2 = p.handler.GetDatabaseTableSchema(ctx, args.Req); err2 != nil {
|
if retval, err2 = p.handler.GetDatabaseTableSchema(ctx, args.Req); err2 != nil {
|
||||||
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDatabaseTableSchema: "+err2.Error())
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDatabaseTableSchema: "+err2.Error())
|
||||||
oprot.WriteMessageBegin("GetDatabaseTableSchema", thrift.EXCEPTION, seqId)
|
oprot.WriteMessageBegin("GetDatabaseTableSchema", thrift.EXCEPTION, seqId)
|
||||||
@ -5745,7 +5745,7 @@ func (p *DatabaseServiceGetDatabaseTableSchemaArgs) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DatabaseServiceGetDatabaseTableSchemaResult struct {
|
type DatabaseServiceGetDatabaseTableSchemaResult struct {
|
||||||
Success *knowledge.GetTableSchemaInfoResponse `thrift:"success,0,optional"`
|
Success *document.GetTableSchemaInfoResponse `thrift:"success,0,optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDatabaseServiceGetDatabaseTableSchemaResult() *DatabaseServiceGetDatabaseTableSchemaResult {
|
func NewDatabaseServiceGetDatabaseTableSchemaResult() *DatabaseServiceGetDatabaseTableSchemaResult {
|
||||||
@ -5755,9 +5755,9 @@ func NewDatabaseServiceGetDatabaseTableSchemaResult() *DatabaseServiceGetDatabas
|
|||||||
func (p *DatabaseServiceGetDatabaseTableSchemaResult) InitDefault() {
|
func (p *DatabaseServiceGetDatabaseTableSchemaResult) InitDefault() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT *knowledge.GetTableSchemaInfoResponse
|
var DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT *document.GetTableSchemaInfoResponse
|
||||||
|
|
||||||
func (p *DatabaseServiceGetDatabaseTableSchemaResult) GetSuccess() (v *knowledge.GetTableSchemaInfoResponse) {
|
func (p *DatabaseServiceGetDatabaseTableSchemaResult) GetSuccess() (v *document.GetTableSchemaInfoResponse) {
|
||||||
if !p.IsSetSuccess() {
|
if !p.IsSetSuccess() {
|
||||||
return DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT
|
return DatabaseServiceGetDatabaseTableSchemaResult_Success_DEFAULT
|
||||||
}
|
}
|
||||||
@ -5828,7 +5828,7 @@ ReadStructEndError:
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *DatabaseServiceGetDatabaseTableSchemaResult) ReadField0(iprot thrift.TProtocol) error {
|
func (p *DatabaseServiceGetDatabaseTableSchemaResult) ReadField0(iprot thrift.TProtocol) error {
|
||||||
_field := knowledge.NewGetTableSchemaInfoResponse()
|
_field := document.NewGetTableSchemaInfoResponse()
|
||||||
if err := _field.Read(iprot); err != nil {
|
if err := _field.Read(iprot); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
4068
backend/api/model/developer/connector/connector.go
Normal file
4068
backend/api/model/developer/connector/connector.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package knowledge
|
package dataset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
@ -503,79 +503,6 @@ func (p *ReviewStatus) Value() (driver.Value, error) {
|
|||||||
return int64(*p), nil
|
return int64(*p), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type ColumnType int64
|
|
||||||
|
|
||||||
const (
|
|
||||||
ColumnType_Unknown ColumnType = 0
|
|
||||||
// Text
|
|
||||||
ColumnType_Text ColumnType = 1
|
|
||||||
// number
|
|
||||||
ColumnType_Number ColumnType = 2
|
|
||||||
// time
|
|
||||||
ColumnType_Date ColumnType = 3
|
|
||||||
// float
|
|
||||||
ColumnType_Float ColumnType = 4
|
|
||||||
// bool
|
|
||||||
ColumnType_Boolean ColumnType = 5
|
|
||||||
// picture
|
|
||||||
ColumnType_Image ColumnType = 6
|
|
||||||
)
|
|
||||||
|
|
||||||
func (p ColumnType) String() string {
|
|
||||||
switch p {
|
|
||||||
case ColumnType_Unknown:
|
|
||||||
return "Unknown"
|
|
||||||
case ColumnType_Text:
|
|
||||||
return "Text"
|
|
||||||
case ColumnType_Number:
|
|
||||||
return "Number"
|
|
||||||
case ColumnType_Date:
|
|
||||||
return "Date"
|
|
||||||
case ColumnType_Float:
|
|
||||||
return "Float"
|
|
||||||
case ColumnType_Boolean:
|
|
||||||
return "Boolean"
|
|
||||||
case ColumnType_Image:
|
|
||||||
return "Image"
|
|
||||||
}
|
|
||||||
return "<UNSET>"
|
|
||||||
}
|
|
||||||
|
|
||||||
func ColumnTypeFromString(s string) (ColumnType, error) {
|
|
||||||
switch s {
|
|
||||||
case "Unknown":
|
|
||||||
return ColumnType_Unknown, nil
|
|
||||||
case "Text":
|
|
||||||
return ColumnType_Text, nil
|
|
||||||
case "Number":
|
|
||||||
return ColumnType_Number, nil
|
|
||||||
case "Date":
|
|
||||||
return ColumnType_Date, nil
|
|
||||||
case "Float":
|
|
||||||
return ColumnType_Float, nil
|
|
||||||
case "Boolean":
|
|
||||||
return ColumnType_Boolean, nil
|
|
||||||
case "Image":
|
|
||||||
return ColumnType_Image, nil
|
|
||||||
}
|
|
||||||
return ColumnType(0), fmt.Errorf("not a valid ColumnType string")
|
|
||||||
}
|
|
||||||
|
|
||||||
func ColumnTypePtr(v ColumnType) *ColumnType { return &v }
|
|
||||||
func (p *ColumnType) Scan(value interface{}) (err error) {
|
|
||||||
var result sql.NullInt64
|
|
||||||
err = result.Scan(value)
|
|
||||||
*p = ColumnType(result.Int64)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *ColumnType) Value() (driver.Value, error) {
|
|
||||||
if p == nil {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return int64(*p), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ChunkStrategy struct {
|
type ChunkStrategy struct {
|
||||||
// A separator, such as a period
|
// A separator, such as a period
|
||||||
Separator string `thrift:"separator,1" form:"separator" json:"separator" query:"separator"`
|
Separator string `thrift:"separator,1" form:"separator" json:"separator" query:"separator"`
|
||||||
@ -2084,453 +2011,3 @@ func (p *SinkStrategy) String() string {
|
|||||||
return fmt.Sprintf("SinkStrategy(%+v)", *p)
|
return fmt.Sprintf("SinkStrategy(%+v)", *p)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Table column information
|
|
||||||
type DocTableColumn struct {
|
|
||||||
// Column ID
|
|
||||||
ID int64 `thrift:"id,1" form:"id" json:"id,string"`
|
|
||||||
// column_name
|
|
||||||
ColumnName string `thrift:"column_name,2" form:"column_name" json:"column_name" query:"column_name"`
|
|
||||||
// Is it a semantically matched column?
|
|
||||||
IsSemantic bool `thrift:"is_semantic,3" form:"is_semantic" json:"is_semantic" query:"is_semantic"`
|
|
||||||
// List the serial number originally in excel
|
|
||||||
Sequence int64 `thrift:"sequence,4" form:"sequence" json:"sequence,string"`
|
|
||||||
// column type
|
|
||||||
ColumnType *ColumnType `thrift:"column_type,5,optional" form:"column_type" json:"column_type,omitempty" query:"column_type"`
|
|
||||||
ContainsEmptyValue *bool `thrift:"contains_empty_value,6,optional" form:"contains_empty_value" json:"contains_empty_value,omitempty" query:"contains_empty_value"`
|
|
||||||
// describe
|
|
||||||
Desc *string `thrift:"desc,7,optional" form:"desc" json:"desc,omitempty" query:"desc"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDocTableColumn() *DocTableColumn {
|
|
||||||
return &DocTableColumn{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetID() (v int64) {
|
|
||||||
return p.ID
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetColumnName() (v string) {
|
|
||||||
return p.ColumnName
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetIsSemantic() (v bool) {
|
|
||||||
return p.IsSemantic
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetSequence() (v int64) {
|
|
||||||
return p.Sequence
|
|
||||||
}
|
|
||||||
|
|
||||||
var DocTableColumn_ColumnType_DEFAULT ColumnType
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetColumnType() (v ColumnType) {
|
|
||||||
if !p.IsSetColumnType() {
|
|
||||||
return DocTableColumn_ColumnType_DEFAULT
|
|
||||||
}
|
|
||||||
return *p.ColumnType
|
|
||||||
}
|
|
||||||
|
|
||||||
var DocTableColumn_ContainsEmptyValue_DEFAULT bool
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetContainsEmptyValue() (v bool) {
|
|
||||||
if !p.IsSetContainsEmptyValue() {
|
|
||||||
return DocTableColumn_ContainsEmptyValue_DEFAULT
|
|
||||||
}
|
|
||||||
return *p.ContainsEmptyValue
|
|
||||||
}
|
|
||||||
|
|
||||||
var DocTableColumn_Desc_DEFAULT string
|
|
||||||
|
|
||||||
func (p *DocTableColumn) GetDesc() (v string) {
|
|
||||||
if !p.IsSetDesc() {
|
|
||||||
return DocTableColumn_Desc_DEFAULT
|
|
||||||
}
|
|
||||||
return *p.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_DocTableColumn = map[int16]string{
|
|
||||||
1: "id",
|
|
||||||
2: "column_name",
|
|
||||||
3: "is_semantic",
|
|
||||||
4: "sequence",
|
|
||||||
5: "column_type",
|
|
||||||
6: "contains_empty_value",
|
|
||||||
7: "desc",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) IsSetColumnType() bool {
|
|
||||||
return p.ColumnType != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) IsSetContainsEmptyValue() bool {
|
|
||||||
return p.ContainsEmptyValue != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) IsSetDesc() bool {
|
|
||||||
return p.Desc != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 1:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField1(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
if fieldTypeId == thrift.STRING {
|
|
||||||
if err = p.ReadField2(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
if fieldTypeId == thrift.BOOL {
|
|
||||||
if err = p.ReadField3(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField4(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
if fieldTypeId == thrift.I32 {
|
|
||||||
if err = p.ReadField5(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
if fieldTypeId == thrift.BOOL {
|
|
||||||
if err = p.ReadField6(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 7:
|
|
||||||
if fieldTypeId == thrift.STRING {
|
|
||||||
if err = p.ReadField7(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DocTableColumn[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) ReadField1(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.ID = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) ReadField2(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field string
|
|
||||||
if v, err := iprot.ReadString(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.ColumnName = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) ReadField3(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field bool
|
|
||||||
if v, err := iprot.ReadBool(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.IsSemantic = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) ReadField4(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.Sequence = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) ReadField5(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field *ColumnType
|
|
||||||
if v, err := iprot.ReadI32(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
tmp := ColumnType(v)
|
|
||||||
_field = &tmp
|
|
||||||
}
|
|
||||||
p.ColumnType = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) ReadField6(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field *bool
|
|
||||||
if v, err := iprot.ReadBool(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = &v
|
|
||||||
}
|
|
||||||
p.ContainsEmptyValue = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) ReadField7(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field *string
|
|
||||||
if v, err := iprot.ReadString(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = &v
|
|
||||||
}
|
|
||||||
p.Desc = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("DocTableColumn"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField1(oprot); err != nil {
|
|
||||||
fieldId = 1
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField2(oprot); err != nil {
|
|
||||||
fieldId = 2
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField3(oprot); err != nil {
|
|
||||||
fieldId = 3
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField4(oprot); err != nil {
|
|
||||||
fieldId = 4
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField5(oprot); err != nil {
|
|
||||||
fieldId = 5
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField6(oprot); err != nil {
|
|
||||||
fieldId = 6
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField7(oprot); err != nil {
|
|
||||||
fieldId = 7
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) writeField1(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.ID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) writeField2(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("column_name", thrift.STRING, 2); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteString(p.ColumnName); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) writeField3(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("is_semantic", thrift.BOOL, 3); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteBool(p.IsSemantic); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) writeField4(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("sequence", thrift.I64, 4); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.Sequence); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) writeField5(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetColumnType() {
|
|
||||||
if err = oprot.WriteFieldBegin("column_type", thrift.I32, 5); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI32(int32(*p.ColumnType)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) writeField6(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetContainsEmptyValue() {
|
|
||||||
if err = oprot.WriteFieldBegin("contains_empty_value", thrift.BOOL, 6); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteBool(*p.ContainsEmptyValue); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *DocTableColumn) writeField7(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetDesc() {
|
|
||||||
if err = oprot.WriteFieldBegin("desc", thrift.STRING, 7); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteString(*p.Desc); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DocTableColumn) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("DocTableColumn(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package knowledge
|
package dataset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
@ -5958,825 +5958,3 @@ func (p *GetIconResponse) String() string {
|
|||||||
return fmt.Sprintf("GetIconResponse(%+v)", *p)
|
return fmt.Sprintf("GetIconResponse(%+v)", *p)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetModeConfigRequest struct {
|
|
||||||
// bot id
|
|
||||||
BotID int64 `thrift:"bot_id,1,required" form:"bot_id,required" json:"bot_id,required" query:"bot_id,required"`
|
|
||||||
// line of business id
|
|
||||||
ConnectorID *int64 `thrift:"connector_id,2,optional" form:"connector_id" json:"connector_id,omitempty" query:"connector_id"`
|
|
||||||
// line of business user id
|
|
||||||
ConnectorUID *string `thrift:"connector_uid,3,optional" form:"connector_uid" json:"connector_uid,omitempty" query:"connector_uid"`
|
|
||||||
Base *base.Base `thrift:"Base,255,optional" form:"Base" json:"Base,omitempty" query:"Base"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGetModeConfigRequest() *GetModeConfigRequest {
|
|
||||||
return &GetModeConfigRequest{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) GetBotID() (v int64) {
|
|
||||||
return p.BotID
|
|
||||||
}
|
|
||||||
|
|
||||||
var GetModeConfigRequest_ConnectorID_DEFAULT int64
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) GetConnectorID() (v int64) {
|
|
||||||
if !p.IsSetConnectorID() {
|
|
||||||
return GetModeConfigRequest_ConnectorID_DEFAULT
|
|
||||||
}
|
|
||||||
return *p.ConnectorID
|
|
||||||
}
|
|
||||||
|
|
||||||
var GetModeConfigRequest_ConnectorUID_DEFAULT string
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) GetConnectorUID() (v string) {
|
|
||||||
if !p.IsSetConnectorUID() {
|
|
||||||
return GetModeConfigRequest_ConnectorUID_DEFAULT
|
|
||||||
}
|
|
||||||
return *p.ConnectorUID
|
|
||||||
}
|
|
||||||
|
|
||||||
var GetModeConfigRequest_Base_DEFAULT *base.Base
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) GetBase() (v *base.Base) {
|
|
||||||
if !p.IsSetBase() {
|
|
||||||
return GetModeConfigRequest_Base_DEFAULT
|
|
||||||
}
|
|
||||||
return p.Base
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_GetModeConfigRequest = map[int16]string{
|
|
||||||
1: "bot_id",
|
|
||||||
2: "connector_id",
|
|
||||||
3: "connector_uid",
|
|
||||||
255: "Base",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) IsSetConnectorID() bool {
|
|
||||||
return p.ConnectorID != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) IsSetConnectorUID() bool {
|
|
||||||
return p.ConnectorUID != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) IsSetBase() bool {
|
|
||||||
return p.Base != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
var issetBotID bool = false
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 1:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField1(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
issetBotID = true
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField2(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
if fieldTypeId == thrift.STRING {
|
|
||||||
if err = p.ReadField3(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 255:
|
|
||||||
if fieldTypeId == thrift.STRUCT {
|
|
||||||
if err = p.ReadField255(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
if !issetBotID {
|
|
||||||
fieldId = 1
|
|
||||||
goto RequiredFieldNotSetError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetModeConfigRequest[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
RequiredFieldNotSetError:
|
|
||||||
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetModeConfigRequest[fieldId]))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) ReadField1(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.BotID = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigRequest) ReadField2(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field *int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = &v
|
|
||||||
}
|
|
||||||
p.ConnectorID = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigRequest) ReadField3(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field *string
|
|
||||||
if v, err := iprot.ReadString(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = &v
|
|
||||||
}
|
|
||||||
p.ConnectorUID = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigRequest) ReadField255(iprot thrift.TProtocol) error {
|
|
||||||
_field := base.NewBase()
|
|
||||||
if err := _field.Read(iprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
p.Base = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("GetModeConfigRequest"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField1(oprot); err != nil {
|
|
||||||
fieldId = 1
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField2(oprot); err != nil {
|
|
||||||
fieldId = 2
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField3(oprot); err != nil {
|
|
||||||
fieldId = 3
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField255(oprot); err != nil {
|
|
||||||
fieldId = 255
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) writeField1(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 1); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.BotID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigRequest) writeField2(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetConnectorID() {
|
|
||||||
if err = oprot.WriteFieldBegin("connector_id", thrift.I64, 2); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(*p.ConnectorID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigRequest) writeField3(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetConnectorUID() {
|
|
||||||
if err = oprot.WriteFieldBegin("connector_uid", thrift.STRING, 3); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteString(*p.ConnectorUID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigRequest) writeField255(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetBase() {
|
|
||||||
if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := p.Base.Write(oprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigRequest) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("GetModeConfigRequest(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetModeConfigResponse struct {
|
|
||||||
Code int32 `thrift:"code,1" form:"code" json:"code" query:"code"`
|
|
||||||
Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"`
|
|
||||||
Mode string `thrift:"mode,3" form:"mode" json:"mode" query:"mode"`
|
|
||||||
BotID int64 `thrift:"bot_id,4" form:"bot_id" json:"bot_id" query:"bot_id"`
|
|
||||||
MaxTableNum int64 `thrift:"max_table_num,5" form:"max_table_num" json:"max_table_num" query:"max_table_num"`
|
|
||||||
MaxColumnNum int64 `thrift:"max_column_num,6" form:"max_column_num" json:"max_column_num" query:"max_column_num"`
|
|
||||||
MaxCapacityKb int64 `thrift:"max_capacity_kb,7" form:"max_capacity_kb" json:"max_capacity_kb" query:"max_capacity_kb"`
|
|
||||||
MaxRowNum int64 `thrift:"max_row_num,8" form:"max_row_num" json:"max_row_num" query:"max_row_num"`
|
|
||||||
BaseResp *base.BaseResp `thrift:"BaseResp,255,optional" form:"BaseResp" json:"BaseResp,omitempty" query:"BaseResp"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGetModeConfigResponse() *GetModeConfigResponse {
|
|
||||||
return &GetModeConfigResponse{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetCode() (v int32) {
|
|
||||||
return p.Code
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetMsg() (v string) {
|
|
||||||
return p.Msg
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetMode() (v string) {
|
|
||||||
return p.Mode
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetBotID() (v int64) {
|
|
||||||
return p.BotID
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetMaxTableNum() (v int64) {
|
|
||||||
return p.MaxTableNum
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetMaxColumnNum() (v int64) {
|
|
||||||
return p.MaxColumnNum
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetMaxCapacityKb() (v int64) {
|
|
||||||
return p.MaxCapacityKb
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetMaxRowNum() (v int64) {
|
|
||||||
return p.MaxRowNum
|
|
||||||
}
|
|
||||||
|
|
||||||
var GetModeConfigResponse_BaseResp_DEFAULT *base.BaseResp
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) GetBaseResp() (v *base.BaseResp) {
|
|
||||||
if !p.IsSetBaseResp() {
|
|
||||||
return GetModeConfigResponse_BaseResp_DEFAULT
|
|
||||||
}
|
|
||||||
return p.BaseResp
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_GetModeConfigResponse = map[int16]string{
|
|
||||||
1: "code",
|
|
||||||
2: "msg",
|
|
||||||
3: "mode",
|
|
||||||
4: "bot_id",
|
|
||||||
5: "max_table_num",
|
|
||||||
6: "max_column_num",
|
|
||||||
7: "max_capacity_kb",
|
|
||||||
8: "max_row_num",
|
|
||||||
255: "BaseResp",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) IsSetBaseResp() bool {
|
|
||||||
return p.BaseResp != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 1:
|
|
||||||
if fieldTypeId == thrift.I32 {
|
|
||||||
if err = p.ReadField1(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
if fieldTypeId == thrift.STRING {
|
|
||||||
if err = p.ReadField2(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
if fieldTypeId == thrift.STRING {
|
|
||||||
if err = p.ReadField3(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField4(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField5(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField6(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 7:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField7(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 8:
|
|
||||||
if fieldTypeId == thrift.I64 {
|
|
||||||
if err = p.ReadField8(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
case 255:
|
|
||||||
if fieldTypeId == thrift.STRUCT {
|
|
||||||
if err = p.ReadField255(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetModeConfigResponse[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) ReadField1(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int32
|
|
||||||
if v, err := iprot.ReadI32(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.Code = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField2(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field string
|
|
||||||
if v, err := iprot.ReadString(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.Msg = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField3(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field string
|
|
||||||
if v, err := iprot.ReadString(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.Mode = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField4(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.BotID = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField5(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.MaxTableNum = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField6(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.MaxColumnNum = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField7(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.MaxCapacityKb = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField8(iprot thrift.TProtocol) error {
|
|
||||||
|
|
||||||
var _field int64
|
|
||||||
if v, err := iprot.ReadI64(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
_field = v
|
|
||||||
}
|
|
||||||
p.MaxRowNum = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) ReadField255(iprot thrift.TProtocol) error {
|
|
||||||
_field := base.NewBaseResp()
|
|
||||||
if err := _field.Read(iprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
p.BaseResp = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("GetModeConfigResponse"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField1(oprot); err != nil {
|
|
||||||
fieldId = 1
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField2(oprot); err != nil {
|
|
||||||
fieldId = 2
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField3(oprot); err != nil {
|
|
||||||
fieldId = 3
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField4(oprot); err != nil {
|
|
||||||
fieldId = 4
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField5(oprot); err != nil {
|
|
||||||
fieldId = 5
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField6(oprot); err != nil {
|
|
||||||
fieldId = 6
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField7(oprot); err != nil {
|
|
||||||
fieldId = 7
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField8(oprot); err != nil {
|
|
||||||
fieldId = 8
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
if err = p.writeField255(oprot); err != nil {
|
|
||||||
fieldId = 255
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) writeField1(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI32(p.Code); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField2(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteString(p.Msg); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField3(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("mode", thrift.STRING, 3); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteString(p.Mode); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField4(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("bot_id", thrift.I64, 4); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.BotID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField5(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("max_table_num", thrift.I64, 5); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.MaxTableNum); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField6(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("max_column_num", thrift.I64, 6); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.MaxColumnNum); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField7(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("max_capacity_kb", thrift.I64, 7); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.MaxCapacityKb); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField8(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("max_row_num", thrift.I64, 8); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := oprot.WriteI64(p.MaxRowNum); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
|
|
||||||
}
|
|
||||||
func (p *GetModeConfigResponse) writeField255(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetBaseResp() {
|
|
||||||
if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := p.BaseResp.Write(oprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *GetModeConfigResponse) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("GetModeConfigResponse(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package knowledge
|
package dataset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -21,8 +21,6 @@ type DatasetService interface {
|
|||||||
DeleteDataset(ctx context.Context, req *DeleteDatasetRequest) (r *DeleteDatasetResponse, err error)
|
DeleteDataset(ctx context.Context, req *DeleteDatasetRequest) (r *DeleteDatasetResponse, err error)
|
||||||
|
|
||||||
UpdateDataset(ctx context.Context, req *UpdateDatasetRequest) (r *UpdateDatasetResponse, err error)
|
UpdateDataset(ctx context.Context, req *UpdateDatasetRequest) (r *UpdateDatasetResponse, err error)
|
||||||
|
|
||||||
GetModeConfig(ctx context.Context, req *GetModeConfigRequest) (r *GetModeConfigResponse, err error)
|
|
||||||
// Document related
|
// Document related
|
||||||
CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error)
|
CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error)
|
||||||
|
|
||||||
@ -47,8 +45,6 @@ type DatasetService interface {
|
|||||||
GetTableSchema(ctx context.Context, req *GetTableSchemaRequest) (r *GetTableSchemaResponse, err error)
|
GetTableSchema(ctx context.Context, req *GetTableSchemaRequest) (r *GetTableSchemaResponse, err error)
|
||||||
|
|
||||||
ValidateTableSchema(ctx context.Context, req *ValidateTableSchemaRequest) (r *ValidateTableSchemaResponse, err error)
|
ValidateTableSchema(ctx context.Context, req *ValidateTableSchemaRequest) (r *ValidateTableSchemaResponse, err error)
|
||||||
|
|
||||||
GetDocumentTableInfo(ctx context.Context, req *GetDocumentTableInfoRequest) (r *GetDocumentTableInfoResponse, err error)
|
|
||||||
// Slice related
|
// Slice related
|
||||||
DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error)
|
DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error)
|
||||||
|
|
||||||
@ -145,15 +141,6 @@ func (p *DatasetServiceClient) UpdateDataset(ctx context.Context, req *UpdateDat
|
|||||||
}
|
}
|
||||||
return _result.GetSuccess(), nil
|
return _result.GetSuccess(), nil
|
||||||
}
|
}
|
||||||
func (p *DatasetServiceClient) GetModeConfig(ctx context.Context, req *GetModeConfigRequest) (r *GetModeConfigResponse, err error) {
|
|
||||||
var _args DatasetServiceGetModeConfigArgs
|
|
||||||
_args.Req = req
|
|
||||||
var _result DatasetServiceGetModeConfigResult
|
|
||||||
if err = p.Client_().Call(ctx, "GetModeConfig", &_args, &_result); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return _result.GetSuccess(), nil
|
|
||||||
}
|
|
||||||
func (p *DatasetServiceClient) CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error) {
|
func (p *DatasetServiceClient) CreateDocument(ctx context.Context, req *CreateDocumentRequest) (r *CreateDocumentResponse, err error) {
|
||||||
var _args DatasetServiceCreateDocumentArgs
|
var _args DatasetServiceCreateDocumentArgs
|
||||||
_args.Req = req
|
_args.Req = req
|
||||||
@ -262,15 +249,6 @@ func (p *DatasetServiceClient) ValidateTableSchema(ctx context.Context, req *Val
|
|||||||
}
|
}
|
||||||
return _result.GetSuccess(), nil
|
return _result.GetSuccess(), nil
|
||||||
}
|
}
|
||||||
func (p *DatasetServiceClient) GetDocumentTableInfo(ctx context.Context, req *GetDocumentTableInfoRequest) (r *GetDocumentTableInfoResponse, err error) {
|
|
||||||
var _args DatasetServiceGetDocumentTableInfoArgs
|
|
||||||
_args.Req = req
|
|
||||||
var _result DatasetServiceGetDocumentTableInfoResult
|
|
||||||
if err = p.Client_().Call(ctx, "GetDocumentTableInfo", &_args, &_result); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return _result.GetSuccess(), nil
|
|
||||||
}
|
|
||||||
func (p *DatasetServiceClient) DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error) {
|
func (p *DatasetServiceClient) DeleteSlice(ctx context.Context, req *DeleteSliceRequest) (r *DeleteSliceResponse, err error) {
|
||||||
var _args DatasetServiceDeleteSliceArgs
|
var _args DatasetServiceDeleteSliceArgs
|
||||||
_args.Req = req
|
_args.Req = req
|
||||||
@ -361,7 +339,6 @@ func NewDatasetServiceProcessor(handler DatasetService) *DatasetServiceProcessor
|
|||||||
self.AddToProcessorMap("ListDataset", &datasetServiceProcessorListDataset{handler: handler})
|
self.AddToProcessorMap("ListDataset", &datasetServiceProcessorListDataset{handler: handler})
|
||||||
self.AddToProcessorMap("DeleteDataset", &datasetServiceProcessorDeleteDataset{handler: handler})
|
self.AddToProcessorMap("DeleteDataset", &datasetServiceProcessorDeleteDataset{handler: handler})
|
||||||
self.AddToProcessorMap("UpdateDataset", &datasetServiceProcessorUpdateDataset{handler: handler})
|
self.AddToProcessorMap("UpdateDataset", &datasetServiceProcessorUpdateDataset{handler: handler})
|
||||||
self.AddToProcessorMap("GetModeConfig", &datasetServiceProcessorGetModeConfig{handler: handler})
|
|
||||||
self.AddToProcessorMap("CreateDocument", &datasetServiceProcessorCreateDocument{handler: handler})
|
self.AddToProcessorMap("CreateDocument", &datasetServiceProcessorCreateDocument{handler: handler})
|
||||||
self.AddToProcessorMap("ListDocument", &datasetServiceProcessorListDocument{handler: handler})
|
self.AddToProcessorMap("ListDocument", &datasetServiceProcessorListDocument{handler: handler})
|
||||||
self.AddToProcessorMap("DeleteDocument", &datasetServiceProcessorDeleteDocument{handler: handler})
|
self.AddToProcessorMap("DeleteDocument", &datasetServiceProcessorDeleteDocument{handler: handler})
|
||||||
@ -374,7 +351,6 @@ func NewDatasetServiceProcessor(handler DatasetService) *DatasetServiceProcessor
|
|||||||
self.AddToProcessorMap("ExtractPhotoCaption", &datasetServiceProcessorExtractPhotoCaption{handler: handler})
|
self.AddToProcessorMap("ExtractPhotoCaption", &datasetServiceProcessorExtractPhotoCaption{handler: handler})
|
||||||
self.AddToProcessorMap("GetTableSchema", &datasetServiceProcessorGetTableSchema{handler: handler})
|
self.AddToProcessorMap("GetTableSchema", &datasetServiceProcessorGetTableSchema{handler: handler})
|
||||||
self.AddToProcessorMap("ValidateTableSchema", &datasetServiceProcessorValidateTableSchema{handler: handler})
|
self.AddToProcessorMap("ValidateTableSchema", &datasetServiceProcessorValidateTableSchema{handler: handler})
|
||||||
self.AddToProcessorMap("GetDocumentTableInfo", &datasetServiceProcessorGetDocumentTableInfo{handler: handler})
|
|
||||||
self.AddToProcessorMap("DeleteSlice", &datasetServiceProcessorDeleteSlice{handler: handler})
|
self.AddToProcessorMap("DeleteSlice", &datasetServiceProcessorDeleteSlice{handler: handler})
|
||||||
self.AddToProcessorMap("CreateSlice", &datasetServiceProcessorCreateSlice{handler: handler})
|
self.AddToProcessorMap("CreateSlice", &datasetServiceProcessorCreateSlice{handler: handler})
|
||||||
self.AddToProcessorMap("UpdateSlice", &datasetServiceProcessorUpdateSlice{handler: handler})
|
self.AddToProcessorMap("UpdateSlice", &datasetServiceProcessorUpdateSlice{handler: handler})
|
||||||
@ -690,54 +666,6 @@ func (p *datasetServiceProcessorUpdateDataset) Process(ctx context.Context, seqI
|
|||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type datasetServiceProcessorGetModeConfig struct {
|
|
||||||
handler DatasetService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *datasetServiceProcessorGetModeConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
||||||
args := DatasetServiceGetModeConfigArgs{}
|
|
||||||
if err = args.Read(iprot); err != nil {
|
|
||||||
iprot.ReadMessageEnd()
|
|
||||||
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
||||||
oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId)
|
|
||||||
x.Write(oprot)
|
|
||||||
oprot.WriteMessageEnd()
|
|
||||||
oprot.Flush(ctx)
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
iprot.ReadMessageEnd()
|
|
||||||
var err2 error
|
|
||||||
result := DatasetServiceGetModeConfigResult{}
|
|
||||||
var retval *GetModeConfigResponse
|
|
||||||
if retval, err2 = p.handler.GetModeConfig(ctx, args.Req); err2 != nil {
|
|
||||||
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetModeConfig: "+err2.Error())
|
|
||||||
oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId)
|
|
||||||
x.Write(oprot)
|
|
||||||
oprot.WriteMessageEnd()
|
|
||||||
oprot.Flush(ctx)
|
|
||||||
return true, err2
|
|
||||||
} else {
|
|
||||||
result.Success = retval
|
|
||||||
}
|
|
||||||
if err2 = oprot.WriteMessageBegin("GetModeConfig", thrift.REPLY, seqId); err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return true, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type datasetServiceProcessorCreateDocument struct {
|
type datasetServiceProcessorCreateDocument struct {
|
||||||
handler DatasetService
|
handler DatasetService
|
||||||
}
|
}
|
||||||
@ -1314,54 +1242,6 @@ func (p *datasetServiceProcessorValidateTableSchema) Process(ctx context.Context
|
|||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type datasetServiceProcessorGetDocumentTableInfo struct {
|
|
||||||
handler DatasetService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *datasetServiceProcessorGetDocumentTableInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
|
||||||
args := DatasetServiceGetDocumentTableInfoArgs{}
|
|
||||||
if err = args.Read(iprot); err != nil {
|
|
||||||
iprot.ReadMessageEnd()
|
|
||||||
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
|
||||||
oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId)
|
|
||||||
x.Write(oprot)
|
|
||||||
oprot.WriteMessageEnd()
|
|
||||||
oprot.Flush(ctx)
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
iprot.ReadMessageEnd()
|
|
||||||
var err2 error
|
|
||||||
result := DatasetServiceGetDocumentTableInfoResult{}
|
|
||||||
var retval *GetDocumentTableInfoResponse
|
|
||||||
if retval, err2 = p.handler.GetDocumentTableInfo(ctx, args.Req); err2 != nil {
|
|
||||||
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDocumentTableInfo: "+err2.Error())
|
|
||||||
oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId)
|
|
||||||
x.Write(oprot)
|
|
||||||
oprot.WriteMessageEnd()
|
|
||||||
oprot.Flush(ctx)
|
|
||||||
return true, err2
|
|
||||||
} else {
|
|
||||||
result.Success = retval
|
|
||||||
}
|
|
||||||
if err2 = oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.REPLY, seqId); err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
||||||
err = err2
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return true, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type datasetServiceProcessorDeleteSlice struct {
|
type datasetServiceProcessorDeleteSlice struct {
|
||||||
handler DatasetService
|
handler DatasetService
|
||||||
}
|
}
|
||||||
@ -3450,298 +3330,6 @@ func (p *DatasetServiceUpdateDatasetResult) String() string {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type DatasetServiceGetModeConfigArgs struct {
|
|
||||||
Req *GetModeConfigRequest `thrift:"req,1"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDatasetServiceGetModeConfigArgs() *DatasetServiceGetModeConfigArgs {
|
|
||||||
return &DatasetServiceGetModeConfigArgs{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
var DatasetServiceGetModeConfigArgs_Req_DEFAULT *GetModeConfigRequest
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) GetReq() (v *GetModeConfigRequest) {
|
|
||||||
if !p.IsSetReq() {
|
|
||||||
return DatasetServiceGetModeConfigArgs_Req_DEFAULT
|
|
||||||
}
|
|
||||||
return p.Req
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_DatasetServiceGetModeConfigArgs = map[int16]string{
|
|
||||||
1: "req",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) IsSetReq() bool {
|
|
||||||
return p.Req != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 1:
|
|
||||||
if fieldTypeId == thrift.STRUCT {
|
|
||||||
if err = p.ReadField1(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetModeConfigArgs[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
||||||
_field := NewGetModeConfigRequest()
|
|
||||||
if err := _field.Read(iprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
p.Req = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("GetModeConfig_args"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField1(oprot); err != nil {
|
|
||||||
fieldId = 1
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := p.Req.Write(oprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigArgs) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("DatasetServiceGetModeConfigArgs(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
type DatasetServiceGetModeConfigResult struct {
|
|
||||||
Success *GetModeConfigResponse `thrift:"success,0,optional"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDatasetServiceGetModeConfigResult() *DatasetServiceGetModeConfigResult {
|
|
||||||
return &DatasetServiceGetModeConfigResult{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
var DatasetServiceGetModeConfigResult_Success_DEFAULT *GetModeConfigResponse
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) GetSuccess() (v *GetModeConfigResponse) {
|
|
||||||
if !p.IsSetSuccess() {
|
|
||||||
return DatasetServiceGetModeConfigResult_Success_DEFAULT
|
|
||||||
}
|
|
||||||
return p.Success
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_DatasetServiceGetModeConfigResult = map[int16]string{
|
|
||||||
0: "success",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) IsSetSuccess() bool {
|
|
||||||
return p.Success != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 0:
|
|
||||||
if fieldTypeId == thrift.STRUCT {
|
|
||||||
if err = p.ReadField0(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetModeConfigResult[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) ReadField0(iprot thrift.TProtocol) error {
|
|
||||||
_field := NewGetModeConfigResponse()
|
|
||||||
if err := _field.Read(iprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
p.Success = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("GetModeConfig_result"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField0(oprot); err != nil {
|
|
||||||
fieldId = 0
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) writeField0(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetSuccess() {
|
|
||||||
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := p.Success.Write(oprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetModeConfigResult) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("DatasetServiceGetModeConfigResult(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
type DatasetServiceCreateDocumentArgs struct {
|
type DatasetServiceCreateDocumentArgs struct {
|
||||||
Req *CreateDocumentRequest `thrift:"req,1"`
|
Req *CreateDocumentRequest `thrift:"req,1"`
|
||||||
}
|
}
|
||||||
@ -7246,298 +6834,6 @@ func (p *DatasetServiceValidateTableSchemaResult) String() string {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type DatasetServiceGetDocumentTableInfoArgs struct {
|
|
||||||
Req *GetDocumentTableInfoRequest `thrift:"req,1"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDatasetServiceGetDocumentTableInfoArgs() *DatasetServiceGetDocumentTableInfoArgs {
|
|
||||||
return &DatasetServiceGetDocumentTableInfoArgs{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
var DatasetServiceGetDocumentTableInfoArgs_Req_DEFAULT *GetDocumentTableInfoRequest
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) GetReq() (v *GetDocumentTableInfoRequest) {
|
|
||||||
if !p.IsSetReq() {
|
|
||||||
return DatasetServiceGetDocumentTableInfoArgs_Req_DEFAULT
|
|
||||||
}
|
|
||||||
return p.Req
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_DatasetServiceGetDocumentTableInfoArgs = map[int16]string{
|
|
||||||
1: "req",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) IsSetReq() bool {
|
|
||||||
return p.Req != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 1:
|
|
||||||
if fieldTypeId == thrift.STRUCT {
|
|
||||||
if err = p.ReadField1(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetDocumentTableInfoArgs[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) ReadField1(iprot thrift.TProtocol) error {
|
|
||||||
_field := NewGetDocumentTableInfoRequest()
|
|
||||||
if err := _field.Read(iprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
p.Req = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("GetDocumentTableInfo_args"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField1(oprot); err != nil {
|
|
||||||
fieldId = 1
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
|
||||||
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := p.Req.Write(oprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoArgs) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("DatasetServiceGetDocumentTableInfoArgs(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
type DatasetServiceGetDocumentTableInfoResult struct {
|
|
||||||
Success *GetDocumentTableInfoResponse `thrift:"success,0,optional"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDatasetServiceGetDocumentTableInfoResult() *DatasetServiceGetDocumentTableInfoResult {
|
|
||||||
return &DatasetServiceGetDocumentTableInfoResult{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) InitDefault() {
|
|
||||||
}
|
|
||||||
|
|
||||||
var DatasetServiceGetDocumentTableInfoResult_Success_DEFAULT *GetDocumentTableInfoResponse
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) GetSuccess() (v *GetDocumentTableInfoResponse) {
|
|
||||||
if !p.IsSetSuccess() {
|
|
||||||
return DatasetServiceGetDocumentTableInfoResult_Success_DEFAULT
|
|
||||||
}
|
|
||||||
return p.Success
|
|
||||||
}
|
|
||||||
|
|
||||||
var fieldIDToName_DatasetServiceGetDocumentTableInfoResult = map[int16]string{
|
|
||||||
0: "success",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) IsSetSuccess() bool {
|
|
||||||
return p.Success != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) Read(iprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldTypeId thrift.TType
|
|
||||||
var fieldId int16
|
|
||||||
|
|
||||||
if _, err = iprot.ReadStructBegin(); err != nil {
|
|
||||||
goto ReadStructBeginError
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
|
||||||
if err != nil {
|
|
||||||
goto ReadFieldBeginError
|
|
||||||
}
|
|
||||||
if fieldTypeId == thrift.STOP {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldId {
|
|
||||||
case 0:
|
|
||||||
if fieldTypeId == thrift.STRUCT {
|
|
||||||
if err = p.ReadField0(iprot); err != nil {
|
|
||||||
goto ReadFieldError
|
|
||||||
}
|
|
||||||
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
if err = iprot.Skip(fieldTypeId); err != nil {
|
|
||||||
goto SkipFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadFieldEnd(); err != nil {
|
|
||||||
goto ReadFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = iprot.ReadStructEnd(); err != nil {
|
|
||||||
goto ReadStructEndError
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
ReadStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
|
||||||
ReadFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
|
||||||
ReadFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DatasetServiceGetDocumentTableInfoResult[fieldId]), err)
|
|
||||||
SkipFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
|
||||||
|
|
||||||
ReadFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
|
||||||
ReadStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) ReadField0(iprot thrift.TProtocol) error {
|
|
||||||
_field := NewGetDocumentTableInfoResponse()
|
|
||||||
if err := _field.Read(iprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
p.Success = _field
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) Write(oprot thrift.TProtocol) (err error) {
|
|
||||||
var fieldId int16
|
|
||||||
if err = oprot.WriteStructBegin("GetDocumentTableInfo_result"); err != nil {
|
|
||||||
goto WriteStructBeginError
|
|
||||||
}
|
|
||||||
if p != nil {
|
|
||||||
if err = p.writeField0(oprot); err != nil {
|
|
||||||
fieldId = 0
|
|
||||||
goto WriteFieldError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldStop(); err != nil {
|
|
||||||
goto WriteFieldStopError
|
|
||||||
}
|
|
||||||
if err = oprot.WriteStructEnd(); err != nil {
|
|
||||||
goto WriteStructEndError
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteStructBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
||||||
WriteFieldError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
|
||||||
WriteFieldStopError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
|
||||||
WriteStructEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) writeField0(oprot thrift.TProtocol) (err error) {
|
|
||||||
if p.IsSetSuccess() {
|
|
||||||
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
|
||||||
goto WriteFieldBeginError
|
|
||||||
}
|
|
||||||
if err := p.Success.Write(oprot); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err = oprot.WriteFieldEnd(); err != nil {
|
|
||||||
goto WriteFieldEndError
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
WriteFieldBeginError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
|
||||||
WriteFieldEndError:
|
|
||||||
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *DatasetServiceGetDocumentTableInfoResult) String() string {
|
|
||||||
if p == nil {
|
|
||||||
return "<nil>"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("DatasetServiceGetDocumentTableInfoResult(%+v)", *p)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
type DatasetServiceDeleteSliceArgs struct {
|
type DatasetServiceDeleteSliceArgs struct {
|
||||||
Req *DeleteSliceRequest `thrift:"req,1"`
|
Req *DeleteSliceRequest `thrift:"req,1"`
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package knowledge
|
package dataset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package knowledge
|
package dataset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
File diff suppressed because it is too large
Load Diff
1392
backend/api/model/flow/devops/debugger/domain/infra/infra.go
Normal file
1392
backend/api/model/flow/devops/debugger/domain/infra/infra.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,810 @@
|
|||||||
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
|
package testcase
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/devops/debugger/domain/infra"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CaseDataBase struct {
|
||||||
|
// Do not fill in when adding, fill in when updating
|
||||||
|
CaseID *int64 `thrift:"caseID,1,optional" json:"caseID,string" form:"caseID" query:"caseID"`
|
||||||
|
Name *string `thrift:"name,2,optional" form:"name" json:"name,omitempty" query:"name"`
|
||||||
|
Description *string `thrift:"description,3,optional" form:"description" json:"description,omitempty" query:"description"`
|
||||||
|
// Input information in JSON format
|
||||||
|
Input *string `thrift:"input,4,optional" form:"input" json:"input,omitempty" query:"input"`
|
||||||
|
IsDefault *bool `thrift:"isDefault,5,optional" form:"isDefault" json:"isDefault,omitempty" query:"isDefault"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCaseDataBase() *CaseDataBase {
|
||||||
|
return &CaseDataBase{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataBase_CaseID_DEFAULT int64
|
||||||
|
|
||||||
|
func (p *CaseDataBase) GetCaseID() (v int64) {
|
||||||
|
if !p.IsSetCaseID() {
|
||||||
|
return CaseDataBase_CaseID_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.CaseID
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataBase_Name_DEFAULT string
|
||||||
|
|
||||||
|
func (p *CaseDataBase) GetName() (v string) {
|
||||||
|
if !p.IsSetName() {
|
||||||
|
return CaseDataBase_Name_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.Name
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataBase_Description_DEFAULT string
|
||||||
|
|
||||||
|
func (p *CaseDataBase) GetDescription() (v string) {
|
||||||
|
if !p.IsSetDescription() {
|
||||||
|
return CaseDataBase_Description_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.Description
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataBase_Input_DEFAULT string
|
||||||
|
|
||||||
|
func (p *CaseDataBase) GetInput() (v string) {
|
||||||
|
if !p.IsSetInput() {
|
||||||
|
return CaseDataBase_Input_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.Input
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataBase_IsDefault_DEFAULT bool
|
||||||
|
|
||||||
|
func (p *CaseDataBase) GetIsDefault() (v bool) {
|
||||||
|
if !p.IsSetIsDefault() {
|
||||||
|
return CaseDataBase_IsDefault_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.IsDefault
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_CaseDataBase = map[int16]string{
|
||||||
|
1: "caseID",
|
||||||
|
2: "name",
|
||||||
|
3: "description",
|
||||||
|
4: "input",
|
||||||
|
5: "isDefault",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) IsSetCaseID() bool {
|
||||||
|
return p.CaseID != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) IsSetName() bool {
|
||||||
|
return p.Name != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) IsSetDescription() bool {
|
||||||
|
return p.Description != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) IsSetInput() bool {
|
||||||
|
return p.Input != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) IsSetIsDefault() bool {
|
||||||
|
return p.IsDefault != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField2(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField3(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField4(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
if fieldTypeId == thrift.BOOL {
|
||||||
|
if err = p.ReadField5(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CaseDataBase[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.CaseID = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) ReadField2(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.Name = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) ReadField3(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.Description = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) ReadField4(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.Input = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) ReadField5(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *bool
|
||||||
|
if v, err := iprot.ReadBool(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.IsDefault = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("CaseDataBase"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField2(oprot); err != nil {
|
||||||
|
fieldId = 2
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField3(oprot); err != nil {
|
||||||
|
fieldId = 3
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField4(oprot); err != nil {
|
||||||
|
fieldId = 4
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField5(oprot); err != nil {
|
||||||
|
fieldId = 5
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetCaseID() {
|
||||||
|
if err = oprot.WriteFieldBegin("caseID", thrift.I64, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(*p.CaseID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) writeField2(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetName() {
|
||||||
|
if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(*p.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) writeField3(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetDescription() {
|
||||||
|
if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(*p.Description); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) writeField4(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetInput() {
|
||||||
|
if err = oprot.WriteFieldBegin("input", thrift.STRING, 4); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(*p.Input); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataBase) writeField5(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetIsDefault() {
|
||||||
|
if err = oprot.WriteFieldBegin("isDefault", thrift.BOOL, 5); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteBool(*p.IsDefault); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataBase) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("CaseDataBase(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type CaseDataDetail struct {
|
||||||
|
CaseBase *CaseDataBase `thrift:"caseBase,1,optional" form:"caseBase" json:"caseBase,omitempty" query:"caseBase"`
|
||||||
|
CreatorID *string `thrift:"creatorID,2,optional" form:"creatorID" json:"creatorID,omitempty" query:"creatorID"`
|
||||||
|
CreateTimeInSec *int64 `thrift:"createTimeInSec,3,optional" form:"createTimeInSec" json:"createTimeInSec,omitempty" query:"createTimeInSec"`
|
||||||
|
UpdateTimeInSec *int64 `thrift:"updateTimeInSec,4,optional" form:"updateTimeInSec" json:"updateTimeInSec,omitempty" query:"updateTimeInSec"`
|
||||||
|
// Schema incompatibility
|
||||||
|
SchemaIncompatible *bool `thrift:"schemaIncompatible,5,optional" form:"schemaIncompatible" json:"schemaIncompatible,omitempty" query:"schemaIncompatible"`
|
||||||
|
Updater *infra.Creator `thrift:"updater,6,optional" form:"updater" json:"updater,omitempty" query:"updater"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCaseDataDetail() *CaseDataDetail {
|
||||||
|
return &CaseDataDetail{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataDetail_CaseBase_DEFAULT *CaseDataBase
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) GetCaseBase() (v *CaseDataBase) {
|
||||||
|
if !p.IsSetCaseBase() {
|
||||||
|
return CaseDataDetail_CaseBase_DEFAULT
|
||||||
|
}
|
||||||
|
return p.CaseBase
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataDetail_CreatorID_DEFAULT string
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) GetCreatorID() (v string) {
|
||||||
|
if !p.IsSetCreatorID() {
|
||||||
|
return CaseDataDetail_CreatorID_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.CreatorID
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataDetail_CreateTimeInSec_DEFAULT int64
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) GetCreateTimeInSec() (v int64) {
|
||||||
|
if !p.IsSetCreateTimeInSec() {
|
||||||
|
return CaseDataDetail_CreateTimeInSec_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.CreateTimeInSec
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataDetail_UpdateTimeInSec_DEFAULT int64
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) GetUpdateTimeInSec() (v int64) {
|
||||||
|
if !p.IsSetUpdateTimeInSec() {
|
||||||
|
return CaseDataDetail_UpdateTimeInSec_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.UpdateTimeInSec
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataDetail_SchemaIncompatible_DEFAULT bool
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) GetSchemaIncompatible() (v bool) {
|
||||||
|
if !p.IsSetSchemaIncompatible() {
|
||||||
|
return CaseDataDetail_SchemaIncompatible_DEFAULT
|
||||||
|
}
|
||||||
|
return *p.SchemaIncompatible
|
||||||
|
}
|
||||||
|
|
||||||
|
var CaseDataDetail_Updater_DEFAULT *infra.Creator
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) GetUpdater() (v *infra.Creator) {
|
||||||
|
if !p.IsSetUpdater() {
|
||||||
|
return CaseDataDetail_Updater_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Updater
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_CaseDataDetail = map[int16]string{
|
||||||
|
1: "caseBase",
|
||||||
|
2: "creatorID",
|
||||||
|
3: "createTimeInSec",
|
||||||
|
4: "updateTimeInSec",
|
||||||
|
5: "schemaIncompatible",
|
||||||
|
6: "updater",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) IsSetCaseBase() bool {
|
||||||
|
return p.CaseBase != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) IsSetCreatorID() bool {
|
||||||
|
return p.CreatorID != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) IsSetCreateTimeInSec() bool {
|
||||||
|
return p.CreateTimeInSec != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) IsSetUpdateTimeInSec() bool {
|
||||||
|
return p.UpdateTimeInSec != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) IsSetSchemaIncompatible() bool {
|
||||||
|
return p.SchemaIncompatible != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) IsSetUpdater() bool {
|
||||||
|
return p.Updater != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField2(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField3(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
if fieldTypeId == thrift.I64 {
|
||||||
|
if err = p.ReadField4(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
if fieldTypeId == thrift.BOOL {
|
||||||
|
if err = p.ReadField5(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField6(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CaseDataDetail[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
_field := NewCaseDataBase()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.CaseBase = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) ReadField2(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.CreatorID = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) ReadField3(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.CreateTimeInSec = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) ReadField4(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *int64
|
||||||
|
if v, err := iprot.ReadI64(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.UpdateTimeInSec = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) ReadField5(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field *bool
|
||||||
|
if v, err := iprot.ReadBool(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = &v
|
||||||
|
}
|
||||||
|
p.SchemaIncompatible = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) ReadField6(iprot thrift.TProtocol) error {
|
||||||
|
_field := infra.NewCreator()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Updater = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("CaseDataDetail"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField2(oprot); err != nil {
|
||||||
|
fieldId = 2
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField3(oprot); err != nil {
|
||||||
|
fieldId = 3
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField4(oprot); err != nil {
|
||||||
|
fieldId = 4
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField5(oprot); err != nil {
|
||||||
|
fieldId = 5
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField6(oprot); err != nil {
|
||||||
|
fieldId = 6
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetCaseBase() {
|
||||||
|
if err = oprot.WriteFieldBegin("caseBase", thrift.STRUCT, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.CaseBase.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) writeField2(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetCreatorID() {
|
||||||
|
if err = oprot.WriteFieldBegin("creatorID", thrift.STRING, 2); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(*p.CreatorID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) writeField3(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetCreateTimeInSec() {
|
||||||
|
if err = oprot.WriteFieldBegin("createTimeInSec", thrift.I64, 3); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(*p.CreateTimeInSec); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) writeField4(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetUpdateTimeInSec() {
|
||||||
|
if err = oprot.WriteFieldBegin("updateTimeInSec", thrift.I64, 4); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteI64(*p.UpdateTimeInSec); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) writeField5(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetSchemaIncompatible() {
|
||||||
|
if err = oprot.WriteFieldBegin("schemaIncompatible", thrift.BOOL, 5); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteBool(*p.SchemaIncompatible); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *CaseDataDetail) writeField6(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetUpdater() {
|
||||||
|
if err = oprot.WriteFieldBegin("updater", thrift.STRUCT, 6); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Updater.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *CaseDataDetail) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("CaseDataDetail(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
@ -7,7 +7,7 @@ import (
|
|||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProductEntityType int64
|
type ProductEntityType int64
|
||||||
@ -9,8 +9,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PluginAuthMode int64
|
type PluginAuthMode int64
|
||||||
@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2025 coze-dev Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package intelligence
|
package intelligence
|
||||||
@ -22,9 +6,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project"
|
"github.com/coze-dev/coze-studio/backend/api/model/project"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish"
|
"github.com/coze-dev/coze-studio/backend/api/model/publish"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task"
|
"github.com/coze-dev/coze-studio/backend/api/model/task"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IntelligenceService interface {
|
type IntelligenceService interface {
|
||||||
@ -7,8 +7,8 @@ import (
|
|||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type OrderBy int64
|
type OrderBy int64
|
||||||
1308
backend/api/model/knowledge/document/kdocument.go
Normal file
1308
backend/api/model/knowledge/document/kdocument.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,8 +6,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
)
|
)
|
||||||
|
|
||||||
type KVItem struct {
|
type KVItem struct {
|
||||||
768
backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go
Normal file
768
backend/api/model/ocean/cloud/bot_open_api/bot_open_api.go
Normal file
@ -0,0 +1,768 @@
|
|||||||
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
|
package bot_open_api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
|
)
|
||||||
|
|
||||||
|
type OauthAuthorizationCodeReq struct {
|
||||||
|
Code string `thrift:"code,1" json:"code" query:"code"`
|
||||||
|
State string `thrift:"state,2" json:"state" query:"state"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewOauthAuthorizationCodeReq() *OauthAuthorizationCodeReq {
|
||||||
|
return &OauthAuthorizationCodeReq{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) GetCode() (v string) {
|
||||||
|
return p.Code
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) GetState() (v string) {
|
||||||
|
return p.State
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_OauthAuthorizationCodeReq = map[int16]string{
|
||||||
|
1: "code",
|
||||||
|
2: "state",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if fieldTypeId == thrift.STRING {
|
||||||
|
if err = p.ReadField2(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthAuthorizationCodeReq[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.Code = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (p *OauthAuthorizationCodeReq) ReadField2(iprot thrift.TProtocol) error {
|
||||||
|
|
||||||
|
var _field string
|
||||||
|
if v, err := iprot.ReadString(); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
_field = v
|
||||||
|
}
|
||||||
|
p.State = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("OauthAuthorizationCodeReq"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
if err = p.writeField2(oprot); err != nil {
|
||||||
|
fieldId = 2
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("code", thrift.STRING, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(p.Code); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
func (p *OauthAuthorizationCodeReq) writeField2(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("state", thrift.STRING, 2); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := oprot.WriteString(p.State); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeReq) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("OauthAuthorizationCodeReq(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type OauthAuthorizationCodeResp struct {
|
||||||
|
BaseResp *base.BaseResp `thrift:"BaseResp,255,required" form:"BaseResp,required" json:"BaseResp,required" query:"BaseResp,required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewOauthAuthorizationCodeResp() *OauthAuthorizationCodeResp {
|
||||||
|
return &OauthAuthorizationCodeResp{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var OauthAuthorizationCodeResp_BaseResp_DEFAULT *base.BaseResp
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) GetBaseResp() (v *base.BaseResp) {
|
||||||
|
if !p.IsSetBaseResp() {
|
||||||
|
return OauthAuthorizationCodeResp_BaseResp_DEFAULT
|
||||||
|
}
|
||||||
|
return p.BaseResp
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_OauthAuthorizationCodeResp = map[int16]string{
|
||||||
|
255: "BaseResp",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) IsSetBaseResp() bool {
|
||||||
|
return p.BaseResp != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
var issetBaseResp bool = false
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 255:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField255(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
issetBaseResp = true
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
if !issetBaseResp {
|
||||||
|
fieldId = 255
|
||||||
|
goto RequiredFieldNotSetError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthAuthorizationCodeResp[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
RequiredFieldNotSetError:
|
||||||
|
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_OauthAuthorizationCodeResp[fieldId]))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) ReadField255(iprot thrift.TProtocol) error {
|
||||||
|
_field := base.NewBaseResp()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.BaseResp = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("OauthAuthorizationCodeResp"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField255(oprot); err != nil {
|
||||||
|
fieldId = 255
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) writeField255(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.BaseResp.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *OauthAuthorizationCodeResp) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("OauthAuthorizationCodeResp(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type BotOpenApiService interface {
|
||||||
|
OauthAuthorizationCode(ctx context.Context, request *OauthAuthorizationCodeReq) (r *OauthAuthorizationCodeResp, err error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type BotOpenApiServiceClient struct {
|
||||||
|
c thrift.TClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBotOpenApiServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *BotOpenApiServiceClient {
|
||||||
|
return &BotOpenApiServiceClient{
|
||||||
|
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBotOpenApiServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BotOpenApiServiceClient {
|
||||||
|
return &BotOpenApiServiceClient{
|
||||||
|
c: thrift.NewTStandardClient(iprot, oprot),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBotOpenApiServiceClient(c thrift.TClient) *BotOpenApiServiceClient {
|
||||||
|
return &BotOpenApiServiceClient{
|
||||||
|
c: c,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceClient) Client_() thrift.TClient {
|
||||||
|
return p.c
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceClient) OauthAuthorizationCode(ctx context.Context, request *OauthAuthorizationCodeReq) (r *OauthAuthorizationCodeResp, err error) {
|
||||||
|
var _args BotOpenApiServiceOauthAuthorizationCodeArgs
|
||||||
|
_args.Request = request
|
||||||
|
var _result BotOpenApiServiceOauthAuthorizationCodeResult
|
||||||
|
if err = p.Client_().Call(ctx, "OauthAuthorizationCode", &_args, &_result); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return _result.GetSuccess(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type BotOpenApiServiceProcessor struct {
|
||||||
|
processorMap map[string]thrift.TProcessorFunction
|
||||||
|
handler BotOpenApiService
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
||||||
|
p.processorMap[key] = processor
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
||||||
|
processor, ok = p.processorMap[key]
|
||||||
|
return processor, ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
||||||
|
return p.processorMap
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBotOpenApiServiceProcessor(handler BotOpenApiService) *BotOpenApiServiceProcessor {
|
||||||
|
self := &BotOpenApiServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
||||||
|
self.AddToProcessorMap("OauthAuthorizationCode", &botOpenApiServiceProcessorOauthAuthorizationCode{handler: handler})
|
||||||
|
return self
|
||||||
|
}
|
||||||
|
func (p *BotOpenApiServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||||
|
name, _, seqId, err := iprot.ReadMessageBegin()
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if processor, ok := p.GetProcessorFunction(name); ok {
|
||||||
|
return processor.Process(ctx, seqId, iprot, oprot)
|
||||||
|
}
|
||||||
|
iprot.Skip(thrift.STRUCT)
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
|
||||||
|
oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return false, x
|
||||||
|
}
|
||||||
|
|
||||||
|
type botOpenApiServiceProcessorOauthAuthorizationCode struct {
|
||||||
|
handler BotOpenApiService
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *botOpenApiServiceProcessorOauthAuthorizationCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||||
|
args := BotOpenApiServiceOauthAuthorizationCodeArgs{}
|
||||||
|
if err = args.Read(iprot); err != nil {
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
||||||
|
oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
var err2 error
|
||||||
|
result := BotOpenApiServiceOauthAuthorizationCodeResult{}
|
||||||
|
var retval *OauthAuthorizationCodeResp
|
||||||
|
if retval, err2 = p.handler.OauthAuthorizationCode(ctx, args.Request); err2 != nil {
|
||||||
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OauthAuthorizationCode: "+err2.Error())
|
||||||
|
oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return true, err2
|
||||||
|
} else {
|
||||||
|
result.Success = retval
|
||||||
|
}
|
||||||
|
if err2 = oprot.WriteMessageBegin("OauthAuthorizationCode", thrift.REPLY, seqId); err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return true, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type BotOpenApiServiceOauthAuthorizationCodeArgs struct {
|
||||||
|
Request *OauthAuthorizationCodeReq `thrift:"request,1"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBotOpenApiServiceOauthAuthorizationCodeArgs() *BotOpenApiServiceOauthAuthorizationCodeArgs {
|
||||||
|
return &BotOpenApiServiceOauthAuthorizationCodeArgs{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var BotOpenApiServiceOauthAuthorizationCodeArgs_Request_DEFAULT *OauthAuthorizationCodeReq
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) GetRequest() (v *OauthAuthorizationCodeReq) {
|
||||||
|
if !p.IsSetRequest() {
|
||||||
|
return BotOpenApiServiceOauthAuthorizationCodeArgs_Request_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Request
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeArgs = map[int16]string{
|
||||||
|
1: "request",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) IsSetRequest() bool {
|
||||||
|
return p.Request != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeArgs[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
_field := NewOauthAuthorizationCodeReq()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Request = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("OauthAuthorizationCode_args"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Request.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeArgs) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("BotOpenApiServiceOauthAuthorizationCodeArgs(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type BotOpenApiServiceOauthAuthorizationCodeResult struct {
|
||||||
|
Success *OauthAuthorizationCodeResp `thrift:"success,0,optional"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBotOpenApiServiceOauthAuthorizationCodeResult() *BotOpenApiServiceOauthAuthorizationCodeResult {
|
||||||
|
return &BotOpenApiServiceOauthAuthorizationCodeResult{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var BotOpenApiServiceOauthAuthorizationCodeResult_Success_DEFAULT *OauthAuthorizationCodeResp
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) GetSuccess() (v *OauthAuthorizationCodeResp) {
|
||||||
|
if !p.IsSetSuccess() {
|
||||||
|
return BotOpenApiServiceOauthAuthorizationCodeResult_Success_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Success
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeResult = map[int16]string{
|
||||||
|
0: "success",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) IsSetSuccess() bool {
|
||||||
|
return p.Success != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 0:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField0(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BotOpenApiServiceOauthAuthorizationCodeResult[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) ReadField0(iprot thrift.TProtocol) error {
|
||||||
|
_field := NewOauthAuthorizationCodeResp()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Success = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("OauthAuthorizationCode_result"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField0(oprot); err != nil {
|
||||||
|
fieldId = 0
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) writeField0(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetSuccess() {
|
||||||
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Success.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *BotOpenApiServiceOauthAuthorizationCodeResult) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("BotOpenApiServiceOauthAuthorizationCodeResult(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
@ -8,8 +8,8 @@ import (
|
|||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
)
|
)
|
||||||
|
|
||||||
type VisibilityType int64
|
type VisibilityType int64
|
||||||
@ -1,13 +1,15 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package variable
|
package memory
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory"
|
"github.com/coze-dev/coze-studio/backend/api/model/knowledge/document"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/kvmemory"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MemoryService interface {
|
type MemoryService interface {
|
||||||
@ -25,6 +27,10 @@ type MemoryService interface {
|
|||||||
GetSysVariableConf(ctx context.Context, req *kvmemory.GetSysVariableConfRequest) (r *kvmemory.GetSysVariableConfResponse, err error)
|
GetSysVariableConf(ctx context.Context, req *kvmemory.GetSysVariableConfRequest) (r *kvmemory.GetSysVariableConfResponse, err error)
|
||||||
|
|
||||||
SetKvMemory(ctx context.Context, req *kvmemory.SetKvMemoryReq) (r *kvmemory.SetKvMemoryResp, err error)
|
SetKvMemory(ctx context.Context, req *kvmemory.SetKvMemoryReq) (r *kvmemory.SetKvMemoryResp, err error)
|
||||||
|
// ---
|
||||||
|
GetModeConfig(ctx context.Context, req *table.GetModeConfigRequest) (r *table.GetModeConfigResponse, err error)
|
||||||
|
|
||||||
|
GetDocumentTableInfo(ctx context.Context, req *document.GetDocumentTableInfoRequest) (r *document.GetDocumentTableInfoResponse, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type MemoryServiceClient struct {
|
type MemoryServiceClient struct {
|
||||||
@ -116,6 +122,24 @@ func (p *MemoryServiceClient) SetKvMemory(ctx context.Context, req *kvmemory.Set
|
|||||||
}
|
}
|
||||||
return _result.GetSuccess(), nil
|
return _result.GetSuccess(), nil
|
||||||
}
|
}
|
||||||
|
func (p *MemoryServiceClient) GetModeConfig(ctx context.Context, req *table.GetModeConfigRequest) (r *table.GetModeConfigResponse, err error) {
|
||||||
|
var _args MemoryServiceGetModeConfigArgs
|
||||||
|
_args.Req = req
|
||||||
|
var _result MemoryServiceGetModeConfigResult
|
||||||
|
if err = p.Client_().Call(ctx, "GetModeConfig", &_args, &_result); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return _result.GetSuccess(), nil
|
||||||
|
}
|
||||||
|
func (p *MemoryServiceClient) GetDocumentTableInfo(ctx context.Context, req *document.GetDocumentTableInfoRequest) (r *document.GetDocumentTableInfoResponse, err error) {
|
||||||
|
var _args MemoryServiceGetDocumentTableInfoArgs
|
||||||
|
_args.Req = req
|
||||||
|
var _result MemoryServiceGetDocumentTableInfoResult
|
||||||
|
if err = p.Client_().Call(ctx, "GetDocumentTableInfo", &_args, &_result); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return _result.GetSuccess(), nil
|
||||||
|
}
|
||||||
|
|
||||||
type MemoryServiceProcessor struct {
|
type MemoryServiceProcessor struct {
|
||||||
processorMap map[string]thrift.TProcessorFunction
|
processorMap map[string]thrift.TProcessorFunction
|
||||||
@ -144,6 +168,8 @@ func NewMemoryServiceProcessor(handler MemoryService) *MemoryServiceProcessor {
|
|||||||
self.AddToProcessorMap("GetPlayGroundMemory", &memoryServiceProcessorGetPlayGroundMemory{handler: handler})
|
self.AddToProcessorMap("GetPlayGroundMemory", &memoryServiceProcessorGetPlayGroundMemory{handler: handler})
|
||||||
self.AddToProcessorMap("GetSysVariableConf", &memoryServiceProcessorGetSysVariableConf{handler: handler})
|
self.AddToProcessorMap("GetSysVariableConf", &memoryServiceProcessorGetSysVariableConf{handler: handler})
|
||||||
self.AddToProcessorMap("SetKvMemory", &memoryServiceProcessorSetKvMemory{handler: handler})
|
self.AddToProcessorMap("SetKvMemory", &memoryServiceProcessorSetKvMemory{handler: handler})
|
||||||
|
self.AddToProcessorMap("GetModeConfig", &memoryServiceProcessorGetModeConfig{handler: handler})
|
||||||
|
self.AddToProcessorMap("GetDocumentTableInfo", &memoryServiceProcessorGetDocumentTableInfo{handler: handler})
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
func (p *MemoryServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
func (p *MemoryServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||||
@ -500,6 +526,102 @@ func (p *memoryServiceProcessorSetKvMemory) Process(ctx context.Context, seqId i
|
|||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type memoryServiceProcessorGetModeConfig struct {
|
||||||
|
handler MemoryService
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *memoryServiceProcessorGetModeConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||||
|
args := MemoryServiceGetModeConfigArgs{}
|
||||||
|
if err = args.Read(iprot); err != nil {
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
||||||
|
oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
var err2 error
|
||||||
|
result := MemoryServiceGetModeConfigResult{}
|
||||||
|
var retval *table.GetModeConfigResponse
|
||||||
|
if retval, err2 = p.handler.GetModeConfig(ctx, args.Req); err2 != nil {
|
||||||
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetModeConfig: "+err2.Error())
|
||||||
|
oprot.WriteMessageBegin("GetModeConfig", thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return true, err2
|
||||||
|
} else {
|
||||||
|
result.Success = retval
|
||||||
|
}
|
||||||
|
if err2 = oprot.WriteMessageBegin("GetModeConfig", thrift.REPLY, seqId); err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return true, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type memoryServiceProcessorGetDocumentTableInfo struct {
|
||||||
|
handler MemoryService
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *memoryServiceProcessorGetDocumentTableInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||||
|
args := MemoryServiceGetDocumentTableInfoArgs{}
|
||||||
|
if err = args.Read(iprot); err != nil {
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
||||||
|
oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
iprot.ReadMessageEnd()
|
||||||
|
var err2 error
|
||||||
|
result := MemoryServiceGetDocumentTableInfoResult{}
|
||||||
|
var retval *document.GetDocumentTableInfoResponse
|
||||||
|
if retval, err2 = p.handler.GetDocumentTableInfo(ctx, args.Req); err2 != nil {
|
||||||
|
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDocumentTableInfo: "+err2.Error())
|
||||||
|
oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.EXCEPTION, seqId)
|
||||||
|
x.Write(oprot)
|
||||||
|
oprot.WriteMessageEnd()
|
||||||
|
oprot.Flush(ctx)
|
||||||
|
return true, err2
|
||||||
|
} else {
|
||||||
|
result.Success = retval
|
||||||
|
}
|
||||||
|
if err2 = oprot.WriteMessageBegin("GetDocumentTableInfo", thrift.REPLY, seqId); err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
||||||
|
err = err2
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return true, err
|
||||||
|
}
|
||||||
|
|
||||||
type MemoryServiceGetProjectVariableListArgs struct {
|
type MemoryServiceGetProjectVariableListArgs struct {
|
||||||
Req *project_memory.GetProjectVariableListReq `thrift:"req,1"`
|
Req *project_memory.GetProjectVariableListReq `thrift:"req,1"`
|
||||||
}
|
}
|
||||||
@ -2543,3 +2665,587 @@ func (p *MemoryServiceSetKvMemoryResult) String() string {
|
|||||||
return fmt.Sprintf("MemoryServiceSetKvMemoryResult(%+v)", *p)
|
return fmt.Sprintf("MemoryServiceSetKvMemoryResult(%+v)", *p)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MemoryServiceGetModeConfigArgs struct {
|
||||||
|
Req *table.GetModeConfigRequest `thrift:"req,1"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMemoryServiceGetModeConfigArgs() *MemoryServiceGetModeConfigArgs {
|
||||||
|
return &MemoryServiceGetModeConfigArgs{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var MemoryServiceGetModeConfigArgs_Req_DEFAULT *table.GetModeConfigRequest
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) GetReq() (v *table.GetModeConfigRequest) {
|
||||||
|
if !p.IsSetReq() {
|
||||||
|
return MemoryServiceGetModeConfigArgs_Req_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Req
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_MemoryServiceGetModeConfigArgs = map[int16]string{
|
||||||
|
1: "req",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) IsSetReq() bool {
|
||||||
|
return p.Req != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetModeConfigArgs[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
_field := table.NewGetModeConfigRequest()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Req = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("GetModeConfig_args"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Req.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigArgs) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("MemoryServiceGetModeConfigArgs(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type MemoryServiceGetModeConfigResult struct {
|
||||||
|
Success *table.GetModeConfigResponse `thrift:"success,0,optional"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMemoryServiceGetModeConfigResult() *MemoryServiceGetModeConfigResult {
|
||||||
|
return &MemoryServiceGetModeConfigResult{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var MemoryServiceGetModeConfigResult_Success_DEFAULT *table.GetModeConfigResponse
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) GetSuccess() (v *table.GetModeConfigResponse) {
|
||||||
|
if !p.IsSetSuccess() {
|
||||||
|
return MemoryServiceGetModeConfigResult_Success_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Success
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_MemoryServiceGetModeConfigResult = map[int16]string{
|
||||||
|
0: "success",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) IsSetSuccess() bool {
|
||||||
|
return p.Success != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 0:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField0(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetModeConfigResult[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) ReadField0(iprot thrift.TProtocol) error {
|
||||||
|
_field := table.NewGetModeConfigResponse()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Success = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("GetModeConfig_result"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField0(oprot); err != nil {
|
||||||
|
fieldId = 0
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) writeField0(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetSuccess() {
|
||||||
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Success.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetModeConfigResult) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("MemoryServiceGetModeConfigResult(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type MemoryServiceGetDocumentTableInfoArgs struct {
|
||||||
|
Req *document.GetDocumentTableInfoRequest `thrift:"req,1"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMemoryServiceGetDocumentTableInfoArgs() *MemoryServiceGetDocumentTableInfoArgs {
|
||||||
|
return &MemoryServiceGetDocumentTableInfoArgs{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var MemoryServiceGetDocumentTableInfoArgs_Req_DEFAULT *document.GetDocumentTableInfoRequest
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) GetReq() (v *document.GetDocumentTableInfoRequest) {
|
||||||
|
if !p.IsSetReq() {
|
||||||
|
return MemoryServiceGetDocumentTableInfoArgs_Req_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Req
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_MemoryServiceGetDocumentTableInfoArgs = map[int16]string{
|
||||||
|
1: "req",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) IsSetReq() bool {
|
||||||
|
return p.Req != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 1:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField1(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetDocumentTableInfoArgs[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) ReadField1(iprot thrift.TProtocol) error {
|
||||||
|
_field := document.NewGetDocumentTableInfoRequest()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Req = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("GetDocumentTableInfo_args"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField1(oprot); err != nil {
|
||||||
|
fieldId = 1
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
||||||
|
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Req.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoArgs) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("MemoryServiceGetDocumentTableInfoArgs(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type MemoryServiceGetDocumentTableInfoResult struct {
|
||||||
|
Success *document.GetDocumentTableInfoResponse `thrift:"success,0,optional"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMemoryServiceGetDocumentTableInfoResult() *MemoryServiceGetDocumentTableInfoResult {
|
||||||
|
return &MemoryServiceGetDocumentTableInfoResult{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) InitDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var MemoryServiceGetDocumentTableInfoResult_Success_DEFAULT *document.GetDocumentTableInfoResponse
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) GetSuccess() (v *document.GetDocumentTableInfoResponse) {
|
||||||
|
if !p.IsSetSuccess() {
|
||||||
|
return MemoryServiceGetDocumentTableInfoResult_Success_DEFAULT
|
||||||
|
}
|
||||||
|
return p.Success
|
||||||
|
}
|
||||||
|
|
||||||
|
var fieldIDToName_MemoryServiceGetDocumentTableInfoResult = map[int16]string{
|
||||||
|
0: "success",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) IsSetSuccess() bool {
|
||||||
|
return p.Success != nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) Read(iprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldTypeId thrift.TType
|
||||||
|
var fieldId int16
|
||||||
|
|
||||||
|
if _, err = iprot.ReadStructBegin(); err != nil {
|
||||||
|
goto ReadStructBeginError
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
|
||||||
|
if err != nil {
|
||||||
|
goto ReadFieldBeginError
|
||||||
|
}
|
||||||
|
if fieldTypeId == thrift.STOP {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fieldId {
|
||||||
|
case 0:
|
||||||
|
if fieldTypeId == thrift.STRUCT {
|
||||||
|
if err = p.ReadField0(iprot); err != nil {
|
||||||
|
goto ReadFieldError
|
||||||
|
}
|
||||||
|
} else if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if err = iprot.Skip(fieldTypeId); err != nil {
|
||||||
|
goto SkipFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadFieldEnd(); err != nil {
|
||||||
|
goto ReadFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = iprot.ReadStructEnd(); err != nil {
|
||||||
|
goto ReadStructEndError
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
ReadStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
|
||||||
|
ReadFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
|
||||||
|
ReadFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MemoryServiceGetDocumentTableInfoResult[fieldId]), err)
|
||||||
|
SkipFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
|
||||||
|
|
||||||
|
ReadFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
|
||||||
|
ReadStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) ReadField0(iprot thrift.TProtocol) error {
|
||||||
|
_field := document.NewGetDocumentTableInfoResponse()
|
||||||
|
if err := _field.Read(iprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
p.Success = _field
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) Write(oprot thrift.TProtocol) (err error) {
|
||||||
|
var fieldId int16
|
||||||
|
if err = oprot.WriteStructBegin("GetDocumentTableInfo_result"); err != nil {
|
||||||
|
goto WriteStructBeginError
|
||||||
|
}
|
||||||
|
if p != nil {
|
||||||
|
if err = p.writeField0(oprot); err != nil {
|
||||||
|
fieldId = 0
|
||||||
|
goto WriteFieldError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldStop(); err != nil {
|
||||||
|
goto WriteFieldStopError
|
||||||
|
}
|
||||||
|
if err = oprot.WriteStructEnd(); err != nil {
|
||||||
|
goto WriteStructEndError
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteStructBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||||
|
WriteFieldError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
|
||||||
|
WriteFieldStopError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
|
||||||
|
WriteStructEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) writeField0(oprot thrift.TProtocol) (err error) {
|
||||||
|
if p.IsSetSuccess() {
|
||||||
|
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
||||||
|
goto WriteFieldBeginError
|
||||||
|
}
|
||||||
|
if err := p.Success.Write(oprot); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = oprot.WriteFieldEnd(); err != nil {
|
||||||
|
goto WriteFieldEndError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
WriteFieldBeginError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
|
||||||
|
WriteFieldEndError:
|
||||||
|
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *MemoryServiceGetDocumentTableInfoResult) String() string {
|
||||||
|
if p == nil {
|
||||||
|
return "<nil>"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("MemoryServiceGetDocumentTableInfoResult(%+v)", *p)
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package common
|
package plugin_develop_common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
@ -5,8 +5,8 @@ package project
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DraftProjectCreateRequest struct {
|
type DraftProjectCreateRequest struct {
|
||||||
@ -7,8 +7,8 @@ import (
|
|||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConnectorClassification int64
|
type ConnectorClassification int64
|
||||||
File diff suppressed because it is too large
Load Diff
@ -5,8 +5,8 @@ package task
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/apache/thrift/lib/go/thrift"
|
"github.com/apache/thrift/lib/go/thrift"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/task_struct"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DraftProjectInnerTaskListRequest struct {
|
type DraftProjectInnerTaskListRequest struct {
|
||||||
@ -513,7 +513,7 @@ func (p *DraftProjectInnerTaskListResponse) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DraftProjectInnerTaskListData struct {
|
type DraftProjectInnerTaskListData struct {
|
||||||
TaskList []*common.ProjectInnerTaskInfo `thrift:"task_list,1" form:"task_list" json:"task_list" query:"task_list"`
|
TaskList []*task_struct.ProjectInnerTaskInfo `thrift:"task_list,1" form:"task_list" json:"task_list" query:"task_list"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDraftProjectInnerTaskListData() *DraftProjectInnerTaskListData {
|
func NewDraftProjectInnerTaskListData() *DraftProjectInnerTaskListData {
|
||||||
@ -523,7 +523,7 @@ func NewDraftProjectInnerTaskListData() *DraftProjectInnerTaskListData {
|
|||||||
func (p *DraftProjectInnerTaskListData) InitDefault() {
|
func (p *DraftProjectInnerTaskListData) InitDefault() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *DraftProjectInnerTaskListData) GetTaskList() (v []*common.ProjectInnerTaskInfo) {
|
func (p *DraftProjectInnerTaskListData) GetTaskList() (v []*task_struct.ProjectInnerTaskInfo) {
|
||||||
return p.TaskList
|
return p.TaskList
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,8 +591,8 @@ func (p *DraftProjectInnerTaskListData) ReadField1(iprot thrift.TProtocol) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_field := make([]*common.ProjectInnerTaskInfo, 0, size)
|
_field := make([]*task_struct.ProjectInnerTaskInfo, 0, size)
|
||||||
values := make([]common.ProjectInnerTaskInfo, size)
|
values := make([]task_struct.ProjectInnerTaskInfo, size)
|
||||||
for i := 0; i < size; i++ {
|
for i := 0; i < size; i++ {
|
||||||
_elem := &values[i]
|
_elem := &values[i]
|
||||||
_elem.InitDefault()
|
_elem.InitDefault()
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
|
||||||
|
|
||||||
package common
|
package task_struct
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -26,21 +26,21 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
intelligenceAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
taskStruct "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
projectAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project"
|
|
||||||
publishAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish"
|
|
||||||
taskAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task"
|
|
||||||
connectorModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector"
|
connectorModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector"
|
||||||
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
||||||
pluginModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
pluginModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
intelligenceAPI "github.com/coze-dev/coze-studio/backend/api/model/intelligence"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
|
workflowAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||||
|
projectAPI "github.com/coze-dev/coze-studio/backend/api/model/project"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
|
publishAPI "github.com/coze-dev/coze-studio/backend/api/model/publish"
|
||||||
resourceAPI "github.com/coze-dev/coze-studio/backend/api/model/resource"
|
resourceAPI "github.com/coze-dev/coze-studio/backend/api/model/resource"
|
||||||
resourceCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
resourceCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
||||||
workflowAPI "github.com/coze-dev/coze-studio/backend/api/model/workflow"
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
|
taskAPI "github.com/coze-dev/coze-studio/backend/api/model/task"
|
||||||
|
taskStruct "github.com/coze-dev/coze-studio/backend/api/model/task_struct"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/knowledge"
|
"github.com/coze-dev/coze-studio/backend/application/knowledge"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/memory"
|
"github.com/coze-dev/coze-studio/backend/application/memory"
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
redisV9 "github.com/redis/go-redis/v9"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/app/repository"
|
"github.com/coze-dev/coze-studio/backend/domain/app/repository"
|
||||||
@ -25,7 +26,6 @@ import (
|
|||||||
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
|
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
|
||||||
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
||||||
user "github.com/coze-dev/coze-studio/backend/domain/user/service"
|
user "github.com/coze-dev/coze-studio/backend/domain/user/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/idgen"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/idgen"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/storage"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/storage"
|
||||||
@ -35,7 +35,7 @@ type ServiceComponents struct {
|
|||||||
IDGen idgen.IDGenerator
|
IDGen idgen.IDGenerator
|
||||||
DB *gorm.DB
|
DB *gorm.DB
|
||||||
OSS storage.Storage
|
OSS storage.Storage
|
||||||
CacheCli cache.Cmdable
|
CacheCli *redisV9.Client
|
||||||
ProjectEventBus search.ProjectEventBus
|
ProjectEventBus search.ProjectEventBus
|
||||||
|
|
||||||
ModelMgr modelmgr.Manager
|
ModelMgr modelmgr.Manager
|
||||||
|
|||||||
@ -20,9 +20,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/cloudwego/hertz/pkg/route"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/openauth"
|
"github.com/coze-dev/coze-studio/backend/application/openauth"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/template"
|
"github.com/coze-dev/coze-studio/backend/application/template"
|
||||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crosssearch"
|
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crosssearch"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/pkg/logs"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/application/app"
|
"github.com/coze-dev/coze-studio/backend/application/app"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/appinfra"
|
"github.com/coze-dev/coze-studio/backend/application/base/appinfra"
|
||||||
@ -64,9 +66,7 @@ import (
|
|||||||
singleagentImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/singleagent"
|
singleagentImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/singleagent"
|
||||||
variablesImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/variables"
|
variablesImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/variables"
|
||||||
workflowImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/workflow"
|
workflowImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/workflow"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/eventbus"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/checkpoint"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/checkpoint"
|
||||||
implEventbus "github.com/coze-dev/coze-studio/backend/infra/impl/eventbus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type eventbusImpl struct {
|
type eventbusImpl struct {
|
||||||
@ -104,27 +104,33 @@ type complexServices struct {
|
|||||||
conversationSVC *conversation.ConversationApplicationService
|
conversationSVC *conversation.ConversationApplicationService
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init(ctx context.Context) (err error) {
|
func Init(ctx context.Context) (shutdown []route.CtxCallback, err error) {
|
||||||
infra, err := appinfra.Init(ctx)
|
infra, err := appinfra.Init(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shutdown = append(shutdown, func(ctx context.Context) {
|
||||||
|
if e := infra.TracerProvider.Shutdown(ctx); e != nil {
|
||||||
|
logs.CtxErrorf(ctx, "shut down tracer provider failed, trace might loss, err=%v", e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
eventbus := initEventBus(infra)
|
eventbus := initEventBus(infra)
|
||||||
|
|
||||||
basicServices, err := initBasicServices(ctx, infra, eventbus)
|
basicServices, err := initBasicServices(ctx, infra, eventbus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Init - initBasicServices failed, err: %v", err)
|
return nil, fmt.Errorf("Init - initBasicServices failed, err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
primaryServices, err := initPrimaryServices(ctx, basicServices)
|
primaryServices, err := initPrimaryServices(ctx, basicServices)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Init - initPrimaryServices failed, err: %v", err)
|
return nil, fmt.Errorf("Init - initPrimaryServices failed, err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
complexServices, err := initComplexServices(ctx, primaryServices)
|
complexServices, err := initComplexServices(ctx, primaryServices)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Init - initVitalServices failed, err: %v", err)
|
return nil, fmt.Errorf("Init - initVitalServices failed, err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
crossconnector.SetDefaultSVC(connectorImpl.InitDomainService(basicServices.connectorSVC.DomainSVC))
|
crossconnector.SetDefaultSVC(connectorImpl.InitDomainService(basicServices.connectorSVC.DomainSVC))
|
||||||
@ -141,12 +147,11 @@ func Init(ctx context.Context) (err error) {
|
|||||||
crossdatacopy.SetDefaultSVC(dataCopyImpl.InitDomainService(basicServices.infra))
|
crossdatacopy.SetDefaultSVC(dataCopyImpl.InitDomainService(basicServices.infra))
|
||||||
crosssearch.SetDefaultSVC(searchImpl.InitDomainService(complexServices.searchSVC.DomainSVC))
|
crosssearch.SetDefaultSVC(searchImpl.InitDomainService(complexServices.searchSVC.DomainSVC))
|
||||||
|
|
||||||
return nil
|
return shutdown, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func initEventBus(infra *appinfra.AppDependencies) *eventbusImpl {
|
func initEventBus(infra *appinfra.AppDependencies) *eventbusImpl {
|
||||||
e := &eventbusImpl{}
|
e := &eventbusImpl{}
|
||||||
eventbus.SetDefaultSVC(implEventbus.NewConsumerService())
|
|
||||||
e.resourceEventBus = search.NewResourceEventBus(infra.ResourceEventProducer)
|
e.resourceEventBus = search.NewResourceEventBus(infra.ResourceEventProducer)
|
||||||
e.projectEventBus = search.NewProjectEventBus(infra.AppEventProducer)
|
e.projectEventBus = search.NewProjectEventBus(infra.AppEventProducer)
|
||||||
|
|
||||||
|
|||||||
@ -22,10 +22,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/ClickHouse/clickhouse-go/v2"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/infra/contract/telemetry"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/coderunner"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/coderunner"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/imagex"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/imagex"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
||||||
@ -38,12 +40,13 @@ import (
|
|||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/imagex/veimagex"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/imagex/veimagex"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/mysql"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/mysql"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/storage"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/storage"
|
||||||
|
ck "github.com/coze-dev/coze-studio/backend/infra/impl/telemetry/clickhouse"
|
||||||
"github.com/coze-dev/coze-studio/backend/types/consts"
|
"github.com/coze-dev/coze-studio/backend/types/consts"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AppDependencies struct {
|
type AppDependencies struct {
|
||||||
DB *gorm.DB
|
DB *gorm.DB
|
||||||
CacheCli cache.Cmdable
|
CacheCli *redis.Client
|
||||||
IDGenSVC idgen.IDGenerator
|
IDGenSVC idgen.IDGenerator
|
||||||
ESClient es.Client
|
ESClient es.Client
|
||||||
ImageXClient imagex.ImageX
|
ImageXClient imagex.ImageX
|
||||||
@ -52,6 +55,8 @@ type AppDependencies struct {
|
|||||||
AppEventProducer eventbus.Producer
|
AppEventProducer eventbus.Producer
|
||||||
ModelMgr modelmgr.Manager
|
ModelMgr modelmgr.Manager
|
||||||
CodeRunner coderunner.Runner
|
CodeRunner coderunner.Runner
|
||||||
|
TracerProvider telemetry.TracerProvider
|
||||||
|
QueryClient telemetry.QueryClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init(ctx context.Context) (*AppDependencies, error) {
|
func Init(ctx context.Context) (*AppDependencies, error) {
|
||||||
@ -102,6 +107,11 @@ func Init(ctx context.Context) (*AppDependencies, error) {
|
|||||||
|
|
||||||
deps.CodeRunner = initCodeRunner()
|
deps.CodeRunner = initCodeRunner()
|
||||||
|
|
||||||
|
deps.TracerProvider, deps.QueryClient, err = initTelemetry()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return deps, nil
|
return deps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,3 +193,72 @@ func initCodeRunner() coderunner.Runner {
|
|||||||
return direct.NewRunner()
|
return direct.NewRunner()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func initTelemetry() (telemetry.TracerProvider, telemetry.QueryClient, error) {
|
||||||
|
typ := os.Getenv(consts.TelemetryType)
|
||||||
|
switch typ {
|
||||||
|
case "clickhouse":
|
||||||
|
opts := &clickhouse.Options{
|
||||||
|
Addr: strings.Split(os.Getenv(consts.ClickhouseAddr), ";"),
|
||||||
|
Auth: clickhouse.Auth{
|
||||||
|
Database: getEnvOrDefault(os.Getenv(consts.ClickhouseDBName), "default"),
|
||||||
|
Username: getEnvOrDefault(os.Getenv(consts.ClickhouseUserName), "default"),
|
||||||
|
Password: getEnvOrDefault(os.Getenv(consts.ClickhousePassword), "clickhouse123"),
|
||||||
|
},
|
||||||
|
// Debug: true,
|
||||||
|
// Debugf: func(format string, v ...any) {
|
||||||
|
// fmt.Printf(format+"\n", v...)
|
||||||
|
// },
|
||||||
|
Settings: clickhouse.Settings{
|
||||||
|
"max_execution_time": 60,
|
||||||
|
},
|
||||||
|
Compression: &clickhouse.Compression{
|
||||||
|
Method: clickhouse.CompressionZSTD,
|
||||||
|
Level: 1,
|
||||||
|
},
|
||||||
|
DialTimeout: time.Second * 30,
|
||||||
|
MaxOpenConns: 5,
|
||||||
|
MaxIdleConns: 5,
|
||||||
|
ConnMaxLifetime: time.Duration(10) * time.Minute,
|
||||||
|
ConnOpenStrategy: clickhouse.ConnOpenInOrder,
|
||||||
|
BlockBufferSize: 10,
|
||||||
|
MaxCompressionBuffer: 10240,
|
||||||
|
}
|
||||||
|
|
||||||
|
indexRootOnly := os.Getenv(consts.TelemetryIndexRootOnly) == "true"
|
||||||
|
tracerConfig := &ck.TracerConfig{
|
||||||
|
ClickhouseOptions: opts,
|
||||||
|
TracerProviderOptions: nil,
|
||||||
|
IndexRootOnly: indexRootOnly,
|
||||||
|
}
|
||||||
|
tp, err := ck.NewTracerProvider(tracerConfig)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
var emptySpanID *string
|
||||||
|
if v := os.Getenv(consts.ClickhouseEmptySpanID); v != "" {
|
||||||
|
emptySpanID = &v
|
||||||
|
}
|
||||||
|
queryClientConfig := &ck.QueryClientConfig{
|
||||||
|
ClickhouseOptions: opts,
|
||||||
|
EmptySpanID: emptySpanID,
|
||||||
|
}
|
||||||
|
qc, err := ck.NewQueryClient(queryClientConfig)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return tp, qc, nil
|
||||||
|
|
||||||
|
default:
|
||||||
|
// TODO: not return errors to achieve compatible upgrades ?
|
||||||
|
return nil, nil, fmt.Errorf("unknown telemetry type: %s", typ)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func getEnvOrDefault(key, defaultValue string) string {
|
||||||
|
if v := os.Getenv(key); v != "" {
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
return defaultValue
|
||||||
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import (
|
|||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
||||||
"github.com/coze-dev/coze-studio/backend/types/errno"
|
"github.com/coze-dev/coze-studio/backend/types/errno"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -25,10 +25,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
modelCommon "github.com/coze-dev/coze-studio/backend/api/model/common"
|
||||||
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
||||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
||||||
dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset"
|
||||||
modelCommon "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/application/upload"
|
"github.com/coze-dev/coze-studio/backend/application/upload"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/knowledge/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/knowledge/entity"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
|
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
netHTTP "net/http"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -114,10 +113,6 @@ func InitService(c *ServiceComponents) (*KnowledgeApplicationService, error) {
|
|||||||
inst.Client.SetAccessKey(ocrAK)
|
inst.Client.SetAccessKey(ocrAK)
|
||||||
inst.Client.SetSecretKey(ocrSK)
|
inst.Client.SetSecretKey(ocrSK)
|
||||||
ocrImpl = veocr.NewOCR(&veocr.Config{Client: inst})
|
ocrImpl = veocr.NewOCR(&veocr.Config{Client: inst})
|
||||||
case "paddleocr":
|
|
||||||
ppocrURL := os.Getenv("PADDLEOCR_OCR_API_URL")
|
|
||||||
client := &netHTTP.Client{}
|
|
||||||
ocrImpl = veocr.NewPPOCR(&veocr.PPOCRConfig{Client: client, URL: ppocrURL})
|
|
||||||
default:
|
default:
|
||||||
// accept ocr not configured
|
// accept ocr not configured
|
||||||
}
|
}
|
||||||
@ -180,7 +175,7 @@ func InitService(c *ServiceComponents) (*KnowledgeApplicationService, error) {
|
|||||||
ModelFactory: chatmodelImpl.NewDefaultFactory(),
|
ModelFactory: chatmodelImpl.NewDefaultFactory(),
|
||||||
})
|
})
|
||||||
|
|
||||||
if err = eventbus.DefaultSVC().RegisterConsumer(nameServer, consts.RMQTopicKnowledge, consts.RMQConsumeGroupKnowledge, knowledgeEventHandler); err != nil {
|
if err = eventbus.RegisterConsumer(nameServer, consts.RMQTopicKnowledge, consts.RMQConsumeGroupKnowledge, knowledgeEventHandler); err != nil {
|
||||||
return nil, fmt.Errorf("register knowledge consumer failed, err=%w", err)
|
return nil, fmt.Errorf("register knowledge consumer failed, err=%w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,9 +338,8 @@ func getEmbedding(ctx context.Context) (embedding.Embedder, error) {
|
|||||||
arkEmbeddingApiKey = os.Getenv("ARK_EMBEDDING_API_KEY")
|
arkEmbeddingApiKey = os.Getenv("ARK_EMBEDDING_API_KEY")
|
||||||
// deprecated: use ARK_EMBEDDING_API_KEY instead
|
// deprecated: use ARK_EMBEDDING_API_KEY instead
|
||||||
// ARK_EMBEDDING_AK will be removed in the future
|
// ARK_EMBEDDING_AK will be removed in the future
|
||||||
arkEmbeddingAK = os.Getenv("ARK_EMBEDDING_AK")
|
arkEmbeddingAK = os.Getenv("ARK_EMBEDDING_AK")
|
||||||
arkEmbeddingDims = os.Getenv("ARK_EMBEDDING_DIMS")
|
arkEmbeddingDims = os.Getenv("ARK_EMBEDDING_DIMS")
|
||||||
arkEmbeddingAPIType = os.Getenv("ARK_EMBEDDING_API_TYPE")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
dims, err := strconv.ParseInt(arkEmbeddingDims, 10, 64)
|
dims, err := strconv.ParseInt(arkEmbeddingDims, 10, 64)
|
||||||
@ -353,15 +347,6 @@ func getEmbedding(ctx context.Context) (embedding.Embedder, error) {
|
|||||||
return nil, fmt.Errorf("init ark embedding dims failed, err=%w", err)
|
return nil, fmt.Errorf("init ark embedding dims failed, err=%w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
apiType := ark.APITypeText
|
|
||||||
if arkEmbeddingAPIType != "" {
|
|
||||||
if t := ark.APIType(arkEmbeddingAPIType); t != ark.APITypeText && t != ark.APITypeMultiModal {
|
|
||||||
return nil, fmt.Errorf("init ark embedding api_type failed, invalid api_type=%s", t)
|
|
||||||
} else {
|
|
||||||
apiType = t
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
emb, err = arkemb.NewArkEmbedder(ctx, &ark.EmbeddingConfig{
|
emb, err = arkemb.NewArkEmbedder(ctx, &ark.EmbeddingConfig{
|
||||||
APIKey: func() string {
|
APIKey: func() string {
|
||||||
if arkEmbeddingApiKey != "" {
|
if arkEmbeddingApiKey != "" {
|
||||||
@ -371,7 +356,6 @@ func getEmbedding(ctx context.Context) (embedding.Embedder, error) {
|
|||||||
}(),
|
}(),
|
||||||
Model: arkEmbeddingModel,
|
Model: arkEmbeddingModel,
|
||||||
BaseURL: arkEmbeddingBaseURL,
|
BaseURL: arkEmbeddingBaseURL,
|
||||||
APIType: &apiType,
|
|
||||||
}, dims, batchSize)
|
}, dims, batchSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("init ark embedding client failed, err=%w", err)
|
return nil, fmt.Errorf("init ark embedding client failed, err=%w", err)
|
||||||
|
|||||||
@ -26,10 +26,10 @@ import (
|
|||||||
|
|
||||||
"github.com/bytedance/sonic"
|
"github.com/bytedance/sonic"
|
||||||
|
|
||||||
|
modelCommon "github.com/coze-dev/coze-studio/backend/api/model/common"
|
||||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
|
||||||
dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/dataengine/dataset"
|
||||||
document "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
"github.com/coze-dev/coze-studio/backend/api/model/knowledge/document"
|
||||||
modelCommon "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
|
||||||
resource "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
resource "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/search"
|
"github.com/coze-dev/coze-studio/backend/application/search"
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
|
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/memory/database/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/memory/database/entity"
|
||||||
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
|
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
|
||||||
|
|||||||
@ -22,10 +22,9 @@ import (
|
|||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
|
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
"github.com/coze-dev/coze-studio/backend/api/model/knowledge/document"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
|
||||||
document "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
|
|
||||||
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/search"
|
"github.com/coze-dev/coze-studio/backend/application/search"
|
||||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossuser"
|
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossuser"
|
||||||
@ -49,8 +48,8 @@ type DatabaseApplicationService struct {
|
|||||||
|
|
||||||
var DatabaseApplicationSVC = DatabaseApplicationService{}
|
var DatabaseApplicationSVC = DatabaseApplicationService{}
|
||||||
|
|
||||||
func (d *DatabaseApplicationService) GetModeConfig(ctx context.Context, req *knowledge.GetModeConfigRequest) (*knowledge.GetModeConfigResponse, error) {
|
func (d *DatabaseApplicationService) GetModeConfig(ctx context.Context, req *table.GetModeConfigRequest) (*table.GetModeConfigResponse, error) {
|
||||||
return &knowledge.GetModeConfigResponse{
|
return &table.GetModeConfigResponse{
|
||||||
Code: 0,
|
Code: 0,
|
||||||
Msg: "success",
|
Msg: "success",
|
||||||
BotID: req.BotID,
|
BotID: req.BotID,
|
||||||
|
|||||||
@ -19,11 +19,12 @@ package memory
|
|||||||
import (
|
import (
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
|
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/repository"
|
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/repository"
|
||||||
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
|
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
|
||||||
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/idgen"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/idgen"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/rdb"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/rdb"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/storage"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/storage"
|
||||||
@ -42,7 +43,7 @@ type ServiceComponents struct {
|
|||||||
EventBus search.ResourceEventBus
|
EventBus search.ResourceEventBus
|
||||||
TosClient storage.Storage
|
TosClient storage.Storage
|
||||||
ResourceDomainNotifier search.ResourceEventBus
|
ResourceDomainNotifier search.ResourceEventBus
|
||||||
CacheCli cache.Cmdable
|
CacheCli *redis.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitService(c *ServiceComponents) *MemoryApplicationServices {
|
func InitService(c *ServiceComponents) *MemoryApplicationServices {
|
||||||
|
|||||||
@ -24,8 +24,8 @@ import (
|
|||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
"github.com/coze-dev/coze-studio/backend/api/model/base"
|
||||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables"
|
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory"
|
"github.com/coze-dev/coze-studio/backend/api/model/kvmemory"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity"
|
||||||
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
|
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
|
||||||
|
|||||||
@ -19,7 +19,7 @@ package modelmgr
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/storage"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/storage"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/i18n"
|
"github.com/coze-dev/coze-studio/backend/pkg/i18n"
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -33,22 +32,22 @@ import (
|
|||||||
gonanoid "github.com/matoous/go-nanoid"
|
gonanoid "github.com/matoous/go-nanoid"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
|
|
||||||
botOpenAPI "github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api"
|
|
||||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
searchModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
|
searchModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
|
||||||
productCommon "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common"
|
productCommon "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common"
|
||||||
productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
|
productAPI "github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api"
|
||||||
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
|
botOpenAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_open_api"
|
||||||
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/plugin_develop"
|
||||||
|
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/pluginutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/pluginutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crosssearch"
|
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crosssearch"
|
||||||
pluginConf "github.com/coze-dev/coze-studio/backend/domain/plugin/conf"
|
pluginConf "github.com/coze-dev/coze-studio/backend/domain/plugin/conf"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/encrypt"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/repository"
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/repository"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/service"
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/service"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/utils"
|
||||||
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
|
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
|
||||||
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
||||||
user "github.com/coze-dev/coze-studio/backend/domain/user/service"
|
user "github.com/coze-dev/coze-studio/backend/domain/user/service"
|
||||||
@ -1152,16 +1151,6 @@ func (p *PluginApplicationService) DebugAPI(ctx context.Context, req *pluginAPI.
|
|||||||
Resp: "{}",
|
Resp: "{}",
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := []model.ExecuteToolOpt{}
|
|
||||||
switch req.Operation {
|
|
||||||
case common.DebugOperation_Debug:
|
|
||||||
opts = append(opts, model.WithInvalidRespProcessStrategy(model.InvalidResponseProcessStrategyOfReturnErr))
|
|
||||||
case common.DebugOperation_Parse:
|
|
||||||
opts = append(opts, model.WithAutoGenRespSchema(),
|
|
||||||
model.WithInvalidRespProcessStrategy(model.InvalidResponseProcessStrategyOfReturnRaw),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := p.DomainSVC.ExecuteTool(ctx, &service.ExecuteToolRequest{
|
res, err := p.DomainSVC.ExecuteTool(ctx, &service.ExecuteToolRequest{
|
||||||
UserID: conv.Int64ToStr(*userID),
|
UserID: conv.Int64ToStr(*userID),
|
||||||
PluginID: req.PluginID,
|
PluginID: req.PluginID,
|
||||||
@ -1169,7 +1158,7 @@ func (p *PluginApplicationService) DebugAPI(ctx context.Context, req *pluginAPI.
|
|||||||
ExecScene: model.ExecSceneOfToolDebug,
|
ExecScene: model.ExecSceneOfToolDebug,
|
||||||
ExecDraftTool: true,
|
ExecDraftTool: true,
|
||||||
ArgumentsInJson: req.Parameters,
|
ArgumentsInJson: req.Parameters,
|
||||||
}, opts...)
|
}, model.WithAutoGenRespSchema())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var e errorx.StatusError
|
var e errorx.StatusError
|
||||||
if errors.As(err, &e) {
|
if errors.As(err, &e) {
|
||||||
@ -1714,12 +1703,7 @@ func (p *PluginApplicationService) OauthAuthorizationCode(ctx context.Context, r
|
|||||||
return nil, errorx.WrapByCode(err, errno.ErrPluginOAuthFailed, errorx.KV(errno.PluginMsgKey, "invalid state"))
|
return nil, errorx.WrapByCode(err, errno.ErrPluginOAuthFailed, errorx.KV(errno.PluginMsgKey, "invalid state"))
|
||||||
}
|
}
|
||||||
|
|
||||||
secret := os.Getenv(encrypt.StateSecretEnv)
|
stateBytes, err := utils.DecryptByAES(stateStr, utils.StateSecretKey)
|
||||||
if secret == "" {
|
|
||||||
secret = encrypt.DefaultStateSecret
|
|
||||||
}
|
|
||||||
|
|
||||||
stateBytes, err := encrypt.DecryptByAES(stateStr, secret)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errorx.WrapByCode(err, errno.ErrPluginOAuthFailed, errorx.KV(errno.PluginMsgKey, "invalid state"))
|
return nil, errorx.WrapByCode(err, errno.ErrPluginOAuthFailed, errorx.KV(errno.PluginMsgKey, "invalid state"))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ package prompt
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
"github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/search"
|
"github.com/coze-dev/coze-studio/backend/application/search"
|
||||||
|
|||||||
@ -33,9 +33,9 @@ import (
|
|||||||
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
|
||||||
user "github.com/coze-dev/coze-studio/backend/domain/user/service"
|
user "github.com/coze-dev/coze-studio/backend/domain/user/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/workflow"
|
"github.com/coze-dev/coze-studio/backend/domain/workflow"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/es"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/es"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/storage"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/storage"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/infra/impl/cache/redis"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/eventbus"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/eventbus"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/logs"
|
"github.com/coze-dev/coze-studio/backend/pkg/logs"
|
||||||
"github.com/coze-dev/coze-studio/backend/types/consts"
|
"github.com/coze-dev/coze-studio/backend/types/consts"
|
||||||
@ -43,7 +43,7 @@ import (
|
|||||||
|
|
||||||
type ServiceComponents struct {
|
type ServiceComponents struct {
|
||||||
DB *gorm.DB
|
DB *gorm.DB
|
||||||
Cache cache.Cmdable
|
Cache *redis.Client
|
||||||
TOS storage.Storage
|
TOS storage.Storage
|
||||||
ESClient es.Client
|
ESClient es.Client
|
||||||
ProjectEventBus ProjectEventBus
|
ProjectEventBus ProjectEventBus
|
||||||
@ -71,14 +71,14 @@ func InitService(ctx context.Context, s *ServiceComponents) (*SearchApplicationS
|
|||||||
logs.Infof("start search domain consumer...")
|
logs.Infof("start search domain consumer...")
|
||||||
nameServer := os.Getenv(consts.MQServer)
|
nameServer := os.Getenv(consts.MQServer)
|
||||||
|
|
||||||
err := eventbus.DefaultSVC().RegisterConsumer(nameServer, consts.RMQTopicApp, consts.RMQConsumeGroupApp, searchConsumer)
|
err := eventbus.RegisterConsumer(nameServer, consts.RMQTopicApp, consts.RMQConsumeGroupApp, searchConsumer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("register search consumer failed, err=%w", err)
|
return nil, fmt.Errorf("register search consumer failed, err=%w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
searchResourceConsumer := search.NewResourceHandler(ctx, s.ESClient)
|
searchResourceConsumer := search.NewResourceHandler(ctx, s.ESClient)
|
||||||
|
|
||||||
err = eventbus.DefaultSVC().RegisterConsumer(nameServer, consts.RMQTopicResource, consts.RMQConsumeGroupResource, searchResourceConsumer)
|
err = eventbus.RegisterConsumer(nameServer, consts.RMQTopicResource, consts.RMQConsumeGroupResource, searchResourceConsumer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("register search consumer failed, err=%w", err)
|
return nil, fmt.Errorf("register search consumer failed, err=%w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,8 +21,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence"
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/app/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/app/entity"
|
||||||
appService "github.com/coze-dev/coze-studio/backend/domain/app/service"
|
appService "github.com/coze-dev/coze-studio/backend/domain/app/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"
|
||||||
|
|||||||
@ -22,12 +22,12 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
search2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
|
search2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/marketplace_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_common"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
|
"github.com/coze-dev/coze-studio/backend/api/model/flow/marketplace/product_public_api"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
|
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
||||||
|
|||||||
@ -21,8 +21,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
"github.com/coze-dev/coze-studio/backend/api/model/resource/common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/table"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
|
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
|
||||||
dbservice "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
|
dbservice "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/playground"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/playground"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/shortcutcmd/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/shortcutcmd/entity"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/shortcutcmd/service"
|
"github.com/coze-dev/coze-studio/backend/domain/shortcutcmd/service"
|
||||||
|
|||||||
@ -20,10 +20,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
|
||||||
intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
|
||||||
|
intelligence "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/bot_common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
|
||||||
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
|
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
|
||||||
|
|||||||
@ -19,9 +19,9 @@ package singleagent
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
|
intelligence "github.com/coze-dev/coze-studio/backend/api/model/intelligence/common"
|
||||||
intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
|
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/developer_api"
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
|
"github.com/coze-dev/coze-studio/backend/api/model/project_memory"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
|
||||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossplugin"
|
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossplugin"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user