♻️ refactor: 重构speech接口

This commit is contained in:
Martial BE
2023-11-29 18:11:15 +08:00
parent 1c7c2d40bb
commit 96dc7614e6
6 changed files with 125 additions and 6 deletions

View File

@@ -103,6 +103,15 @@ func (c *Client) SendRequest(req *http.Request, response any) error {
return nil
}
func (c *Client) SendRequestRaw(req *http.Request) (body io.ReadCloser, err error) {
resp, err := HttpClient.Do(req)
if err != nil {
return
}
return resp.Body, nil
}
func IsFailureStatusCode(resp *http.Response) bool {
return resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest
}