列表查询
Signed-off-by: devad <cossjie@foxmail.com> Former-commit-id: 1263851a5826fae26020a216c7e7d2fa3447b8a5
This commit is contained in:
parent
4a9b9d3c06
commit
4fda5e80bf
|
@ -595,8 +595,8 @@ type (
|
|||
//apps 详情参数
|
||||
type (
|
||||
AppDetailReq {
|
||||
Name string `path:"name"`
|
||||
NsID string `param:"nsID"`
|
||||
Name string `path:"appName"`
|
||||
NsID string `form:"nsID"`
|
||||
}
|
||||
AppDetailResp {
|
||||
CpuCores float64 `json:"cpuCores"`
|
||||
|
|
|
@ -533,5 +533,5 @@ service pcm {
|
|||
|
||||
@doc "应用详情"
|
||||
@handler AppDetailHandler
|
||||
get /apps/detail (AppDetailReq) returns (AppDetailResp)
|
||||
get /apps/detail/:appName (AppDetailReq) returns (AppDetailResp)
|
||||
}
|
|
@ -4,7 +4,7 @@ NacosConfig:
|
|||
ServerConfigs:
|
||||
# - IpAddr: 127.0.0.1
|
||||
# Port: 8848
|
||||
- IpAddr: 127.0.0.1
|
||||
- IpAddr: nacos.jcce.dev
|
||||
Port: 8848
|
||||
ClientConfig:
|
||||
NamespaceId: test
|
||||
|
|
|
@ -641,7 +641,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/apps/detail",
|
||||
Path: "/apps/detail/:appName",
|
||||
Handler: apps.AppDetailHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -2,6 +2,8 @@ package apps
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes/kubernetes"
|
||||
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||
|
@ -25,6 +27,13 @@ func NewAppDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AppDeta
|
|||
|
||||
func (l *AppDetailLogic) AppDetail(req *types.AppDetailReq) (resp *types.AppDetailResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
fmt.Println(req.Name)
|
||||
//调用p端接口
|
||||
appDetail, err := l.svcCtx.K8sRpc[1727670068428410880].GetAppDetail(context.Background(), &kubernetes.AppDetailReq{
|
||||
Namespace: req.NsID,
|
||||
Name: req.Name,
|
||||
})
|
||||
fmt.Println("应用详情:", appDetail)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -556,8 +556,8 @@ type App struct {
|
|||
}
|
||||
|
||||
type AppDetailReq struct {
|
||||
Name string `path:"name"`
|
||||
NsID string `param:"nsID"`
|
||||
Name string `path:"appName"`
|
||||
NsID string `form:"nsID"`
|
||||
}
|
||||
|
||||
type AppDetailResp struct {
|
||||
|
|
2
go.mod
2
go.mod
|
@ -25,7 +25,7 @@ require (
|
|||
github.com/zeromicro/go-zero v1.6.0
|
||||
gitlink.org.cn/jcce-pcm/pcm-ac v0.0.0-20231108025612-8f0044dd7a95
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231124020230-30f5f95a759b
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231124061825-c57371a25711
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20231101085149-724c7c4cc090
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231101091522-38307e241dfd
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231102023739-81a3d353c10d
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1000,8 +1000,8 @@ gitlink.org.cn/jcce-pcm/pcm-ac v0.0.0-20231108025612-8f0044dd7a95 h1:63M79RcLdA1
|
|||
gitlink.org.cn/jcce-pcm/pcm-ac v0.0.0-20231108025612-8f0044dd7a95/go.mod h1:ySZHK8NpHn4gjbLoOtJbSEUDiYZVwjbnFAcG71gXPgg=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d h1:DHjl/rLuH2gKYtY0MKMGNQDHFT12APg25RlMUQo+tHk=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d/go.mod h1:r/KLzUpupCV5jdxSfgDhc2pVjP0fBi3VhAWRttsBn30=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231124020230-30f5f95a759b h1:+Bb1JRgetdniM/HEqSm45ZU2YZPJx5ZHHeaC+BlaDyo=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231124020230-30f5f95a759b/go.mod h1:nto0MrfeackGWkbwgkRW45+RIRvwHHqvNqs9Yz+O9j0=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231124061825-c57371a25711 h1:+7shcqdsKeuOpU3kanfGJGx6k535cF9WWTX9nmNgk/s=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231124061825-c57371a25711/go.mod h1:nto0MrfeackGWkbwgkRW45+RIRvwHHqvNqs9Yz+O9j0=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20231101085149-724c7c4cc090 h1:jztlHo72bcWM1jUwvG3Hfk2K+AJL0RvlsdIqlktH/MI=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20231101085149-724c7c4cc090/go.mod h1:pisJKAI8FRFFUcBaH3Gob+ENXWRM97rpuYmv9s1raag=
|
||||
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231101091522-38307e241dfd h1:9GIKpN6nel4U5jD91HL/vjzwo+EHTpE13SkT7WKyXtQ=
|
||||
|
|
Loading…
Reference in New Issue