working commit

This commit is contained in:
2026-05-30 12:04:50 +02:00
parent c5ed2b2245
commit c964adce89
9 changed files with 37 additions and 28 deletions
+7 -2
View File
@@ -23,7 +23,10 @@ func (util *ServiceUtil) GetHello(cmd *cobra.Command, args []string) {
printResponse(res, err)
}
type GetHelloResult struct{}
type GetHelloResult struct {
Message string `json:"message"`
Alive bool `json:"alive"`
}
func (util *ServiceUtil) getHello(common *CommonServiceParams, params *GetHelloParams) (*GetHelloResult, error) {
var err error
@@ -38,9 +41,11 @@ func (util *ServiceUtil) getHello(common *CommonServiceParams, params *GetHelloP
ref.SetUserinfo(common.Username, common.Password)
mw := servcli.NewBasicAuthMiddleware(ref.Userinfo())
cli := servcli.NewClient(nil, mw)
err = cli.GetHello(ctx, ref.Raw())
operRes, err := cli.GetHello(ctx, ref.Raw())
if err != nil {
return res, err
}
res.Message = operRes.Message
res.Alive = operRes.Alive
return res, err
}