29 lines
690 B
Go
29 lines
690 B
Go
|
|
package agent
|
||
|
|
|
||
|
|
import (
|
||
|
|
"net/http"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||
|
|
"ycc-server/app/main/api/internal/logic/agent"
|
||
|
|
"ycc-server/app/main/api/internal/svc"
|
||
|
|
"ycc-server/app/main/api/internal/types"
|
||
|
|
)
|
||
|
|
|
||
|
|
func GetUpgradeListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
||
|
|
var req types.GetUpgradeListReq
|
||
|
|
if err := httpx.Parse(r, &req); err != nil {
|
||
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
l := agent.NewGetUpgradeListLogic(r.Context(), svcCtx)
|
||
|
|
resp, err := l.GetUpgradeList(&req)
|
||
|
|
if err != nil {
|
||
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
||
|
|
} else {
|
||
|
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|