Api_Key correction

master
Leonardo Domingues 2021-12-16 11:08:10 -03:00
parent 2e48c5b2a6
commit 7d1b743b27
1 changed files with 3 additions and 9 deletions

View File

@ -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")