improve: 优化 pkg/srun api 抽象层级

This commit is contained in:
Mmx233
2023-06-04 20:31:51 +08:00
parent cc6d4f8da4
commit 92575d812e
3 changed files with 24 additions and 29 deletions

View File

@@ -1,9 +1,5 @@
package srun
import (
"net/http"
)
type LoginForm struct {
Domain string `json:"domain"`
UserName string `json:"username"`
@@ -23,17 +19,3 @@ type LoginInfo struct {
Form LoginForm
Meta LoginMeta
}
type Conf struct {
//调用 API 时直接访问 https URL
Https bool
//登录参数,不可缺省
LoginInfo LoginInfo
Client *http.Client
api Api
}
func (a *Conf) initApi() {
a.api.Init(a.Https, a.LoginInfo.Form.Domain, a.Client)
}