Implémenter page web de scan de présence

Voir diff pour détails
This commit is contained in:
Victor Lacasse-Beaudoin 2023-09-17 16:32:40 -04:00
parent c6f3a52f91
commit c218860e33
10 changed files with 139 additions and 10 deletions
apiclient

View file

@ -17,8 +17,8 @@ type APIClient struct {
Protocol string
}
func New(key, host, protocol string, port int) APIClient {
return APIClient{
func New(key, host, protocol string, port int) *APIClient {
return &APIClient{
Key: key,
Host: host,
Port: port,
@ -83,3 +83,11 @@ func (a *APIClient) Call(method, route string, requestBody io.Reader, useKey boo
return response, nil
}
func (a *APIClient) Scan(membreID string) (response apiresponse.ScanPOST, err error) {
//TODO implement api key
//err = a.CallResponder(http.MethodPost, "/v0/scan", &buf, true, &response)
err = a.CallResponder(http.MethodPost, fmt.Sprintf("/v0/scan/%s", membreID), nil, false, &response)
return
}