mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 13:47:15 +08:00
feat: 下载回调
This commit is contained in:
@@ -64,3 +64,18 @@ func (r *API) AppBySlug(slug string) (*App, error) {
|
||||
|
||||
return app, nil
|
||||
}
|
||||
|
||||
// AppCallback 应用下载回调
|
||||
func (r *API) AppCallback(slug string) error {
|
||||
resp, err := r.client.R().
|
||||
SetResult(&Response{}).
|
||||
Post(fmt.Sprintf("/apps/%s/callback", slug))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !resp.IsSuccess() {
|
||||
return fmt.Errorf("failed to callback app: %s", resp.String())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -60,3 +60,16 @@ func (r *API) TemplateBySlug(slug string) (*Template, error) {
|
||||
|
||||
return template, nil
|
||||
}
|
||||
|
||||
// TemplateCallback 模版下载回调
|
||||
func (r *API) TemplateCallback(slug string) error {
|
||||
resp, err := r.client.R().SetResult(&Response{}).Post(fmt.Sprintf("/templates/%s/callback", slug))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !resp.IsSuccess() {
|
||||
return fmt.Errorf("failed to callback template: %s", resp.String())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user