Ver código fonte

修改包结构

yjp 1 ano atrás
pai
commit
fbf45e904b
5 arquivos alterados com 10 adições e 9 exclusões
  1. 1 1
      api/request.go
  2. 1 1
      api/sql_parser.go
  3. 1 1
      api/v1.go
  4. 1 1
      test/test_sql.go
  5. 6 5
      test/v1_test.go

+ 1 - 1
request.go → api/request.go

@@ -1,4 +1,4 @@
-package dspsql
+package api
 
 import "git.sxidc.com/go-tools/api_binding/http_binding/binding_context"
 

+ 1 - 1
sql_parser.go → api/sql_parser.go

@@ -1,4 +1,4 @@
-package dspsql
+package api
 
 import (
 	"errors"

+ 1 - 1
v1.go → api/v1.go

@@ -1,4 +1,4 @@
-package dspsql
+package api
 
 import (
 	"errors"

+ 1 - 1
test_sql.go → test/test_sql.go

@@ -1,4 +1,4 @@
-package dspsql
+package test
 
 import (
 	uuid "github.com/satori/go.uuid"

+ 6 - 5
v1_test.go → test/v1_test.go

@@ -1,4 +1,4 @@
-package dspsql
+package test
 
 import (
 	"fmt"
@@ -7,6 +7,7 @@ import (
 	"git.sxidc.com/go-tools/api_binding/http_binding/response"
 	"git.sxidc.com/service-supports/dps-sdk"
 	"git.sxidc.com/service-supports/dps-sdk/client"
+	"git.sxidc.com/service-supports/dps-sql/api"
 	"github.com/go-resty/resty/v2"
 	"math/rand"
 	"testing"
@@ -29,7 +30,7 @@ func TestApiV1OperateParse(t *testing.T) {
 	}
 
 	binding := http_binding.NewBinding("v1")
-	ApiV1(binding, dpsAddress, func(c *binding_context.Context) (string, error) {
+	api.ApiV1(binding, dpsAddress, func(c *binding_context.Context) (string, error) {
 		return operatorID, nil
 	})
 
@@ -213,7 +214,7 @@ func TestApiV1Operate(t *testing.T) {
 	})
 
 	binding := http_binding.NewBinding("v1")
-	ApiV1(binding, dpsAddress, func(c *binding_context.Context) (string, error) {
+	api.ApiV1(binding, dpsAddress, func(c *binding_context.Context) (string, error) {
 		return operatorID, nil
 	})
 
@@ -297,7 +298,7 @@ func operateParse(t *testing.T, sql string) map[string]any {
 	})
 
 	resp, err := resty.New().R().
-		SetBody(&OperateParseRequest{
+		SetBody(&api.OperateParseRequest{
 			SQL: sql,
 		}).
 		SetResult(result).
@@ -324,7 +325,7 @@ func operate(t *testing.T, sql string, keyColumns []string) []map[string]any {
 	})
 
 	resp, err := resty.New().R().
-		SetBody(&OperateRequest{
+		SetBody(&api.OperateRequest{
 			DatabaseID: testDatabaseID,
 			Version:    "v1",
 			KeyColumns: keyColumns,