Skip to content

Commit

Permalink
refactor: parameterize the executor functions' request types too
Browse files Browse the repository at this point in the history
  • Loading branch information
xen0n committed Jul 6, 2023
1 parent 2048bec commit aab0310
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ func (c *WorkwxApp) composeQyapiURLWithToken(path string, req any, withAccessTok
return url, nil
}

func executeQyapiGet[U tryIntoErr](
func executeQyapiGet[T urlValuer, U tryIntoErr](
c *WorkwxApp,
path string,
req urlValuer,
req T,
respObj U,
withAccessToken bool,
) error {
Expand Down Expand Up @@ -135,10 +135,10 @@ func executeQyapiGet[U tryIntoErr](
return nil
}

func executeQyapiJSONPost[U tryIntoErr](
func executeQyapiJSONPost[T bodyer, U tryIntoErr](
c *WorkwxApp,
path string,
req bodyer,
req T,
respObj U,
withAccessToken bool,
) error {
Expand Down Expand Up @@ -172,10 +172,10 @@ func executeQyapiJSONPost[U tryIntoErr](
return nil
}

func executeQyapiMediaUpload[U tryIntoErr](
func executeQyapiMediaUpload[T mediaUploader, U tryIntoErr](
c *WorkwxApp,
path string,
req mediaUploader,
req T,
respObj U,
withAccessToken bool,
) error {
Expand Down

0 comments on commit aab0310

Please sign in to comment.