Skip to content

Commit

Permalink
Merge pull request #60 from beclab/fix/api_detail_not_check_version
Browse files Browse the repository at this point in the history
fix: make detail api support version
  • Loading branch information
icebergtsn authored Dec 18, 2024
2 parents 1f5e280 + f7dfad8 commit 833c106
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion internal/appmgr/app_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package appmgr

import (
"fmt"
"market/internal/appservice"
"market/internal/constants"
"net/http"
"sync"
Expand Down Expand Up @@ -40,7 +41,12 @@ func callLoop(f func() error) {
}

func getPagesDetailFromAdmin() error {
url := fmt.Sprintf(constants.AppStoreServicePagesDetailURLTempl, getAppStoreServiceHost(), getAppStoreServicePort())
version, err := appservice.TerminusVersionValue()
if err != nil {
return err
}

url := fmt.Sprintf(constants.AppStoreServicePagesDetailURLTempl, getAppStoreServiceHost(), getAppStoreServicePort(), version)
bodyStr, err := sendHttpRequest(http.MethodGet, url, nil)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const (
AppStoreAppVersionURLTempl = "https://%s:%s/app-store-server/v1/applications/version-history/%s"
AppStoreServiceReadMeURLTempl = "https://%s:%s/app-store-server/v1/applications/%s/README.md"

AppStoreServicePagesDetailURLTempl = "https://%s:%s/app-store-server/v1/pages/detail"
AppStoreServicePagesDetailURLTempl = "https://%s:%s/app-store-server/v1/pages/detail?version=%s"

AppServiceHostEnv = "APP_SERVICE_SERVICE_HOST"
AppServicePortEnv = "APP_SERVICE_SERVICE_PORT"
Expand Down

0 comments on commit 833c106

Please sign in to comment.