feat: 新增双端安装卸载 安卓清楚缓存

This commit is contained in:
余泓铮
2024-08-06 20:30:18 +08:00
parent 7c1b5ce57e
commit c8a42e951a
11 changed files with 236 additions and 47 deletions

48
hrp/pkg/uixt/install.go Normal file
View File

@@ -0,0 +1,48 @@
package uixt
type InstallOptions struct {
Reinstall bool
GrantPermission bool
Downgrade bool
RetryTime int
}
type InstallOption func(o *InstallOptions)
func NewInstallOptions(options ...InstallOption) *InstallOptions {
installOptions := &InstallOptions{}
for _, option := range options {
option(installOptions)
}
return installOptions
}
func WithReinstall(reinstall bool) InstallOption {
return func(o *InstallOptions) {
o.Reinstall = reinstall
}
}
func WithGrantPermission(grantPermission bool) InstallOption {
return func(o *InstallOptions) {
o.GrantPermission = grantPermission
}
}
func WithDowngrade(downgrade bool) InstallOption {
return func(o *InstallOptions) {
o.Downgrade = downgrade
}
}
func WithRetryTime(retryTime int) InstallOption {
return func(o *InstallOptions) {
o.RetryTime = retryTime
}
}
type InstallResult struct {
Result int `json:"result"`
ErrorCode int `json:"errorCode"`
ErrorMsg string `json:"errorMsg"`
}