This commit is contained in:
Liang Ding 2022-07-14 10:39:53 +08:00
parent d1fb78ebb1
commit f825fefa43
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 96 additions and 22 deletions

View file

@ -27,15 +27,33 @@ var (
checkUpdateLock = &sync.Mutex{}
)
func CheckUpdate(showMsg bool) {
if !showMsg {
type Announcement struct {
Id string `json:"id"`
Title string `json:"title"`
URL string `json:"url"`
}
func GetAnnouncements() (ret []*Announcement) {
result, err := util.GetRhyResult(false)
if nil != err {
util.LogErrorf("get ")
return
}
if "ios" == util.Container {
if showMsg {
util.PushMsg(Conf.Language(36), 5000)
}
announcements := result["announcement"].([]interface{})
for _, announcement := range announcements {
ann := announcement.(map[string]interface{})
ret = append(ret, &Announcement{
Id: ann["id"].(string),
Title: ann["title"].(string),
URL: ann["url"].(string),
})
}
return
}
func CheckUpdate(showMsg bool) {
if !showMsg {
return
}