Skip to content

Commit c00b8dc

Browse files
committed
refactor: parameterize the executor functions' request types too
1 parent 1b0509f commit c00b8dc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

client.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ func (c *WorkwxApp) composeQyapiURLWithToken(path string, req any, withAccessTok
103103
return url, nil
104104
}
105105

106-
func executeQyapiGet[U tryIntoErr](
106+
func executeQyapiGet[T urlValuer, U tryIntoErr](
107107
c *WorkwxApp,
108108
path string,
109-
req urlValuer,
109+
req T,
110110
respObj U,
111111
withAccessToken bool,
112112
) error {
@@ -135,10 +135,10 @@ func executeQyapiGet[U tryIntoErr](
135135
return nil
136136
}
137137

138-
func executeQyapiJSONPost[U tryIntoErr](
138+
func executeQyapiJSONPost[T bodyer, U tryIntoErr](
139139
c *WorkwxApp,
140140
path string,
141-
req bodyer,
141+
req T,
142142
respObj U,
143143
withAccessToken bool,
144144
) error {
@@ -172,10 +172,10 @@ func executeQyapiJSONPost[U tryIntoErr](
172172
return nil
173173
}
174174

175-
func executeQyapiMediaUpload[U tryIntoErr](
175+
func executeQyapiMediaUpload[T mediaUploader, U tryIntoErr](
176176
c *WorkwxApp,
177177
path string,
178-
req mediaUploader,
178+
req T,
179179
respObj U,
180180
withAccessToken bool,
181181
) error {

0 commit comments

Comments
 (0)