From 7d1b743b2789fa579a55c12aa5a5650701edd7ca Mon Sep 17 00:00:00 2001 From: Leonardo Domingues Date: Thu, 16 Dec 2021 11:08:10 -0300 Subject: [PATCH] Api_Key correction --- api/dataapi/lib.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/api/dataapi/lib.go b/api/dataapi/lib.go index d1c6bf2..33bdd3c 100644 --- a/api/dataapi/lib.go +++ b/api/dataapi/lib.go @@ -5,7 +5,6 @@ import ( "time" "go.digitalcircle.com.br/open/httpcli" - "go.digitalcircle.com.br/open/replaycli-go/api/replay" ) type DataApiOp string @@ -41,21 +40,16 @@ func (c *Cli) Do(request *DataAPIRequest) (response *DataAPIResponse, err error) return } -func NewCli() *Cli { +func NewCli(apikey string) *Cli { ret := &Cli{Httpcli: httpcli.NewCli()} - rcon := replay.NewCli() - apikey, err := rcon.ConfigGet("API_KEY") - if err != nil { - panic(err) - } ret.Httpcli.AddHeader("X-API-KEY", apikey) ret.Httpcli.SetBasePath("https://dataapi.digitalcircle.com.br") return ret } -func RegistrarExec(table string, check bool) { +func RegistrarExec(table, apikey string, check bool) { //Para robôs, age como contador e registra cada repetição no mês - c := NewCli() + c := NewCli(apikey) var registros int var erro int current := time.Now().Format("2006-01")