diff --git a/dsBaseRpc/Test/GetSysDict_test.go b/dsBaseRpc/Test/GetSysDict_test.go deleted file mode 100644 index 927ebb1b..00000000 --- a/dsBaseRpc/Test/GetSysDict_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package Test - -import ( - "testing" -) - -func TestGetSysDict(t *testing.T) { - -} diff --git a/dsBaseRpc/Test/dm_stage_http_test.go b/dsBaseRpc/Test/dm_stage_http_test.go deleted file mode 100644 index 5da3bb92..00000000 --- a/dsBaseRpc/Test/dm_stage_http_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package Test - -import ( - "flag" - "testing" -) - -var ( - addr = flag.String("addr", "localhost:8972", "server address") -) - -func TestBaseRpcGateWay(t *testing.T) { - //cc := &codec.MsgpackCodec{} - ////提交的参数 - ////准备计算的参数 - //args := &RpcService.DmStageArgs{ - // Limit: 1000, - // Offset: 0, - //} - ////定义返回的变量 - //reply := &RpcService.Reply{} - //data, _ := cc.Encode(args) - //// request - //req, err := http.NewRequest("POST", "http://10.10.6.200:8001/", bytes.NewReader(data)) - //if err != nil { - // fmt.Println("failed to create request: ", err) - // return - //} - // - //// 设置header - //h := req.Header - //h.Set(gateway.XMessageID, "10000") - //h.Set(gateway.XMessageType, "0") - //h.Set(gateway.XSerializeType, "3") - //h.Set(gateway.XServicePath, "Base") - //h.Set(gateway.XServiceMethod, "GetStageList") - // - //// 发送http请求 - //// http请求===>rpcx请求===>rpcx服务===>返回rpcx结果===>转换为http的response===>输出到client - //res, err := http.DefaultClient.Do(req) - //if err != nil { - // fmt.Println("failed to call: ", err) - //} - //defer res.Body.Close() - //// 获取结果 - //replyData, err := ioutil.ReadAll(res.Body) - //if err != nil { - // fmt.Println("failed to read response: ", err) - //} - //// 解码 - //err = cc.Decode(replyData, reply) - //if err != nil { - // fmt.Println("failed to decode reply: ", err) - //} - //fmt.Println(reply.List) -} diff --git a/dsBaseRpc/Test/idCard_test.go b/dsBaseRpc/Test/idCard_test.go deleted file mode 100644 index 7aa36610..00000000 --- a/dsBaseRpc/Test/idCard_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package Test - -import ( - "dsBaseRpc/Utils/IdCardUtil" - "fmt" - "testing" -) - -func TestIdCard(t *testing.T) { - //待验证的身份证号 - idCard:="222301197710110018" - //开始检查 - isValid, birthday, xb := IdCardUtil.GetIdCardNoInfo(idCard) - if !isValid{ - fmt.Println("身份证号不合法!") - } else { - // isMale:true---->男 - fmt.Printf("birthday=%s, xb=%s \n", birthday, xb) - } -} diff --git a/dsBaseRpc/Test/sqlin_test.go b/dsBaseRpc/Test/sqlin_test.go deleted file mode 100644 index 42b42da2..00000000 --- a/dsBaseRpc/Test/sqlin_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package Test - -import ( - "dsBaseRpc/Utils/CommonUtil" - "dsBaseRpc/Utils/DbUtil" - "fmt" - "strings" - "testing" -) - -func TestSqlIn(t *testing.T) { - //方式1:传入字符串数组 - idAry := []string{"1", "2", "3"} - ids := strings.Join(idAry, "','") - sqlRaw := fmt.Sprintf(`SELECT * FROM table WHERE id IN ('%s')`, ids) - fmt.Println(sqlRaw) - - //方式2:传入整数数组 - nums := []int{11, 12, 13} - ids = strings.Join(CommonUtil.ConvertIntegerArrayToStringArray(nums), "','") - sqlRaw = fmt.Sprintf(`select * from t_dm_subject where subject_id in ('%s')`, ids) - fmt.Println(sqlRaw) - - var db = DbUtil.Engine - list, err := db.SQL(sqlRaw).Query().List() - if err != nil { - fmt.Println(err) - } - fmt.Println(list) -}