Correção de bugs

master
Leonardo Domingues 2021-11-29 12:11:14 -03:00
parent ee65505e8f
commit e0f1a0ddd4
2 changed files with 8 additions and 11 deletions

View File

@ -1,10 +1,11 @@
package dataapi package dataapi
import ( import (
"go.digitalcircle.com.br/open/httpcli"
"go.digitalcircle.com.br/open/replaycli-go/api/replay"
"strconv" "strconv"
"time" "time"
"go.digitalcircle.com.br/open/httpcli"
"go.digitalcircle.com.br/open/replaycli-go/api/replay"
) )
type DataApiOp string type DataApiOp string
@ -53,8 +54,6 @@ func NewCli() *Cli {
} }
func RegistrarExec(table string, check bool) { func RegistrarExec(table string, check bool) {
rp := replay.NewCli()
rp.ConfigGet("API_KEY")
//Para robôs, age como contador e registra cada repetição no mês //Para robôs, age como contador e registra cada repetição no mês
c := NewCli() c := NewCli()
var registros int var registros int

View File

@ -2,7 +2,6 @@ package dataapi_test
import ( import (
"log" "log"
"os"
"strconv" "strconv"
"testing" "testing"
"time" "time"
@ -11,8 +10,7 @@ import (
) )
func TestAPIRetrieve(t *testing.T) { func TestAPIRetrieve(t *testing.T) {
apikey := os.Getenv("DATAAPI_APIKEY") c := dataapi.NewCli()
c := dataapi.NewCli(apikey)
res, err := c.Do(&dataapi.DataAPIRequest{ res, err := c.Do(&dataapi.DataAPIRequest{
Col: "teste3", Col: "teste3",
Op: dataapi.RETRIEVE, Op: dataapi.RETRIEVE,
@ -25,7 +23,7 @@ func TestAPIRetrieve(t *testing.T) {
} }
func TestAPIRetrieveWQuery(t *testing.T) { func TestAPIRetrieveWQuery(t *testing.T) {
c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") c := dataapi.NewCli()
res, err := c.Do(&dataapi.DataAPIRequest{ res, err := c.Do(&dataapi.DataAPIRequest{
Col: "C1", Col: "C1",
Op: dataapi.RETRIEVE, Op: dataapi.RETRIEVE,
@ -39,7 +37,7 @@ func TestAPIRetrieveWQuery(t *testing.T) {
} }
func TestAPIUpdate(t *testing.T) { func TestAPIUpdate(t *testing.T) {
c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") c := dataapi.NewCli()
res, err := c.Do(&dataapi.DataAPIRequest{ res, err := c.Do(&dataapi.DataAPIRequest{
Col: "C1", Col: "C1",
Op: dataapi.UPDATE, Op: dataapi.UPDATE,
@ -56,7 +54,7 @@ func TestAPIUpdate(t *testing.T) {
} }
func TestAPIDelete(t *testing.T) { func TestAPIDelete(t *testing.T) {
c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") c := dataapi.NewCli()
res, err := c.Do(&dataapi.DataAPIRequest{ res, err := c.Do(&dataapi.DataAPIRequest{
Col: "C1", Col: "C1",
Op: dataapi.DELETE, Op: dataapi.DELETE,
@ -74,7 +72,7 @@ func TestAPICreate(t *testing.T) {
print("a") print("a")
print("b") print("b")
} }
c := dataapi.NewCli("RnJpIDA1IE5vdiAyMDIxIDExOjE1OjIyIEFNIFVUQwo") c := dataapi.NewCli()
var registros int var registros int
var erro int var erro int
current := time.Now().Format("2006-01") current := time.Now().Format("2006-01")