fix:增加大屏数据代码到2.0分支
This commit is contained in:
parent
fdbe177c63
commit
49338393b0
|
@ -1,9 +1,6 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
commonConfig "PCM/common/config"
|
||||
"flag"
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
)
|
||||
|
@ -15,15 +12,15 @@ type Config struct {
|
|||
PcmCoreRpcConf zrpc.RpcClientConf
|
||||
}
|
||||
|
||||
var configFile = flag.String("o", "adaptor/PCM-STORAGE/PCM-CEPH/rpc/etc/pcmceph.yaml", "the config file")
|
||||
/*var configFile = flag.String("o", "adaptor/PCM-STORAGE/PCM-CEPH/rpc/etc/pcmceph.yaml", "the config file")
|
||||
var Cfg = getConfig()
|
||||
|
||||
/*
|
||||
|
||||
func getConfig() Config {
|
||||
var c Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
return c
|
||||
}*/
|
||||
}
|
||||
|
||||
func getConfig() Config {
|
||||
var bootstrapConfig commonConfig.BootstrapConfig
|
||||
|
@ -49,4 +46,4 @@ func getConfig() Config {
|
|||
nacosConfig.Discovery(&c.RpcServerConf)
|
||||
|
||||
return c
|
||||
}
|
||||
}*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package config
|
||||
|
||||
type ScreenConfig struct {
|
||||
ScreenUrl string
|
||||
ScreenUrl string `json:"ScreenUrl"`
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"PCM/adaptor/PCM-STORAGE/PCM-CEPH/rpc/internal/config"
|
||||
"PCM/common/tool"
|
||||
"context"
|
||||
"fmt"
|
||||
|
@ -31,8 +30,7 @@ func NewDailyPowerScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
|
|||
func (l *DailyPowerScreenLogic) DailyPowerScreen(in *ceph.DailyPowerScreenReq) (*ceph.DailyPowerScreenResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
var resp ceph.DailyPowerScreenResp
|
||||
screenConfig := config.Cfg
|
||||
screenUrl := screenConfig.ScreenConfig.ScreenUrl
|
||||
screenUrl := l.svcCtx.Config.ScreenUrl
|
||||
statusCode, body, err := tool.HttpClientWithScreen(tool.GET, screenUrl+"computepower/dailytrend", strings.NewReader(``))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"PCM/adaptor/PCM-STORAGE/PCM-CEPH/rpc/internal/config"
|
||||
"PCM/common/tool"
|
||||
"context"
|
||||
"fmt"
|
||||
|
@ -31,8 +30,7 @@ func NewPerCenterComputerPowerScreenLogic(ctx context.Context, svcCtx *svc.Servi
|
|||
func (l *PerCenterComputerPowerScreenLogic) PerCenterComputerPowerScreen(in *ceph.PerCenterComputerPowersReq) (*ceph.PerCenterComputerPowersResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
var resp ceph.PerCenterComputerPowersResp
|
||||
screenConfig := config.Cfg
|
||||
screenUrl := screenConfig.ScreenConfig.ScreenUrl
|
||||
screenUrl := l.svcCtx.Config.ScreenUrl
|
||||
statusCode, body, err := tool.HttpClientWithScreen(tool.GET, screenUrl+"computepower/percenter", strings.NewReader(``))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"PCM/adaptor/PCM-STORAGE/PCM-CEPH/rpc/internal/config"
|
||||
"PCM/common/tool"
|
||||
"context"
|
||||
"fmt"
|
||||
|
@ -61,9 +60,7 @@ func NewStorageScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sto
|
|||
func (l *StorageScreenLogic) StorageScreen(in *ceph.StorageScreenReq) (*ceph.StorageScreenResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
var resp ceph.StorageScreenResp
|
||||
//var storageArg StorageArg
|
||||
screenConfig := config.Cfg
|
||||
screenUrl := screenConfig.ScreenConfig.ScreenUrl
|
||||
screenUrl := l.svcCtx.Config.ScreenUrl
|
||||
statusCode, body, err := tool.HttpClientWithScreen(tool.GET, screenUrl+"aicenter?sortBy=weight&orderBy=asc", strings.NewReader(``))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue