luma create and list api is ready

This commit is contained in:
RockYang
2024-09-02 18:08:50 +08:00
parent dfc6c87250
commit 2e5bd238b7
9 changed files with 311 additions and 115 deletions

View File

@@ -242,6 +242,10 @@ func (s *Service) Upload(task types.SunoTask) (RespVo, error) {
return RespVo{}, fmt.Errorf("请求 API 出错:%v", err)
}
if r.StatusCode != 200 {
return RespVo{}, fmt.Errorf("请求 API 出错:%d, %s", r.StatusCode, r.String())
}
body, _ := io.ReadAll(r.Body)
err = json.Unmarshal(body, &res)
if err != nil {