Skip to content

Commit e0c6cd1

Browse files
feat(devops): process multi interface struct
1 parent af25dc5 commit e0c6cd1

File tree

9 files changed

+256
-205
lines changed

9 files changed

+256
-205
lines changed

devops/internal/apihandler/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func StreamDebugRun(res http.ResponseWriter, req *http.Request) {
136136
FromNode: rs.FromNode,
137137
}
138138

139-
debugID, stateCh, errCh, err := service.DebugSVC.DebugRun(ctx, m, rs.Input, rs.InputFormat)
139+
debugID, stateCh, errCh, err := service.DebugSVC.DebugRun(ctx, m, rs.Input)
140140
if err != nil {
141141
log.Errorf(err.Error())
142142
return

devops/internal/apihandler/debug_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (d *debugTestSuite) Test_DebugRun() {
158158

159159
stateCh := make(chan *model.NodeDebugState, 100)
160160
errCh := make(chan error, 1)
161-
d.mockDebugSVC.EXPECT().DebugRun(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
161+
d.mockDebugSVC.EXPECT().DebugRun(gomock.Any(), gomock.Any(), gomock.Any()).
162162
Return("mock_debug_id", stateCh, errCh, nil).Times(1)
163163

164164
stateCh <- &model.NodeDebugState{

devops/internal/apihandler/types/debug.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ type CreateDebugThreadResponse struct {
3232
}
3333

3434
type DebugRunRequest struct {
35-
FromNode string `json:"from_node"`
36-
Input string `json:"input"` // mock input data after json marshal
37-
LogID string `json:"log_id"`
38-
InputFormat InputFormat `json:"input_format"`
35+
FromNode string `json:"from_node"`
36+
Input string `json:"input"` // mock input data after json marshal
37+
LogID string `json:"log_id"`
3938
}
4039

4140
type DebugRunEventType string
@@ -115,10 +114,3 @@ func (d DebugRunEventMsg) JsonBytes() []byte {
115114
type ListInputTypesResponse struct {
116115
Types []*devmodel.JsonSchema `json:"types,omitempty"`
117116
}
118-
119-
type InputFormat int
120-
121-
const (
122-
InputFormatOfCode InputFormat = 0
123-
InputFormatOfJson InputFormat = 1
124-
)

devops/internal/mock/debug_run_mock.go

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)