centerResources

Former-commit-id: efde0d5a96faf3ee0a05a614671079f05d222a1e
This commit is contained in:
zhangwei 2024-03-11 16:52:09 +08:00
parent 4a7e646e0e
commit 074c9175cb
3 changed files with 21 additions and 16 deletions

View File

@ -163,6 +163,7 @@ type (
cpu float32 `json:"cpu"` cpu float32 `json:"cpu"`
memory float32 `json:"memory"` memory float32 `json:"memory"`
storage float32 `json:"storage"` storage float32 `json:"storage"`
centerType string `json:"centerType"`
} }
) )
type ( type (

View File

@ -26,22 +26,25 @@ func NewCenterResourcesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *C
func (l *CenterResourcesLogic) CenterResources() (resp *types.CenterResourcesResp, err error) { func (l *CenterResourcesLogic) CenterResources() (resp *types.CenterResourcesResp, err error) {
// todo: add your logic here and delete this line // todo: add your logic here and delete this line
centerIndex1 := types.CenterIndex{ centerIndex1 := types.CenterIndex{
Name: "阿里云", Name: "阿里云",
Cpu: float32(12.33), Cpu: float32(12.33),
Memory: float32(64.55), Memory: float32(64.55),
Storage: float32(33.90), Storage: float32(33.90),
CenterType: "cloud",
} }
centerIndex2 := types.CenterIndex{ centerIndex2 := types.CenterIndex{
Name: "A超算中心", Name: "A超算中心",
Cpu: float32(42.36), Cpu: float32(42.36),
Memory: float32(66.55), Memory: float32(66.55),
Storage: float32(23.231), Storage: float32(23.231),
CenterType: "hpc",
} }
centerIndex3 := types.CenterIndex{ centerIndex3 := types.CenterIndex{
Name: "智算中心", Name: "智算中心",
Cpu: float32(78.33), Cpu: float32(78.33),
Memory: float32(36.55), Memory: float32(36.55),
Storage: float32(88.93), Storage: float32(88.93),
CenterType: "ai",
} }
resp = &types.CenterResourcesResp{} resp = &types.CenterResourcesResp{}
resp.CentersIndex = append(resp.CentersIndex, centerIndex1) resp.CentersIndex = append(resp.CentersIndex, centerIndex1)

View File

@ -143,10 +143,11 @@ type CenterResourcesResp struct {
} }
type CenterIndex struct { type CenterIndex struct {
Name string `json:"name"` Name string `json:"name"`
Cpu float32 `json:"cpu"` Cpu float32 `json:"cpu"`
Memory float32 `json:"memory"` Memory float32 `json:"memory"`
Storage float32 `json:"storage"` Storage float32 `json:"storage"`
CenterType string `json:"centerType"`
} }
type GetClusterListReq struct { type GetClusterListReq struct {