初始
This commit is contained in:
335
api/hwy/equipment/equipment.go
Normal file
335
api/hwy/equipment/equipment.go
Normal file
@ -0,0 +1,335 @@
|
||||
package equipment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/tiger1103/gfast/v3/api/hwy/client"
|
||||
"github.com/tiger1103/gfast/v3/api/hwy/sign"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/dao"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
)
|
||||
|
||||
type EquipmentApi struct{}
|
||||
|
||||
// 从数据库中获取逆变器列表
|
||||
type EquipmentListQueryReq struct {
|
||||
g.Meta `path:"/equipment/query" method:"get" tags:"禾望云相关" summary:"从数据库中获取逆变器列表【实时数据不一样准确】"`
|
||||
PageNum int `json:"pageNum" dc:"分页数" v:"required"`
|
||||
PageSize int `json:"pageSize" dc:"分页大小" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) GetEquipmentListFromDB(ctx context.Context, req *EquipmentListQueryReq) (res *EquipmentListQueryRes, err error) {
|
||||
res = new(EquipmentListQueryRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 从数据库中查询逆变器列表
|
||||
m := dao.Equipment.Ctx(ctx).WithAll()
|
||||
|
||||
res.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
|
||||
res.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = 10
|
||||
}
|
||||
|
||||
err = m.Page(req.PageNum, req.PageSize).Scan(&res.List)
|
||||
liberr.ErrIsNil(ctx, err, "获取逆变器列表失败")
|
||||
})
|
||||
|
||||
return res, err
|
||||
}
|
||||
|
||||
// 禾望云逆变器列表请求
|
||||
type EquipmentListReq struct {
|
||||
g.Meta `path:"/equipment/list" method:"get" tags:"禾望云相关" summary:"从平台获取逆变器列表【实时数据准确】"`
|
||||
PageNum int `json:"pageNum" dc:"分页数" v:"required"`
|
||||
PageSize int `json:"pageSize" dc:"分页大小" v:"required"`
|
||||
PlantId int `json:"plantId" dc:"电站ID" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) GetEquipmentListAndSave(ctx context.Context, req *EquipmentListReq) (res *EquipmentListRes, err error) {
|
||||
res = new(EquipmentListRes)
|
||||
data := make(map[string]string)
|
||||
data["pageIndex"] = strconv.Itoa(req.PageNum)
|
||||
data["pageSize"] = strconv.Itoa(req.PageSize)
|
||||
data["plantId"] = strconv.Itoa(req.PlantId)
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentListByPlantId", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
// 处理响应并存储数据
|
||||
model := g.Model("equipment")
|
||||
for _, record := range res.Result.Records {
|
||||
_, err = model.Data(map[string]interface{}{
|
||||
"plantId": req.PlantId,
|
||||
"divertorId": record.DivertorId,
|
||||
"divertorName": record.DivertorName,
|
||||
"equipmentName": record.EquipmentName,
|
||||
"equipmentPn": record.EquipmentPn,
|
||||
"equipmentSn": record.EquipmentSn,
|
||||
"id": record.Id,
|
||||
"kwp": record.Kwp,
|
||||
"monKwh": record.MonKwh,
|
||||
"nowKw": record.NowKw,
|
||||
"paramDcacCode": record.ParamDcacCode,
|
||||
"paramDcdcCode": record.ParamDcdcCode,
|
||||
"powerPlantId": record.PowerPlantId, // 确保这个字段已经是字符串,或者在数据库中正确处理类型转换
|
||||
"powerPlantName": record.PowerPlantName,
|
||||
"ratedPower": record.RatedPower,
|
||||
"softDcacCode": record.SoftDcacCode,
|
||||
"softDcdcCode": record.SoftDcdcCode,
|
||||
"status": record.Status,
|
||||
"sumKwh": record.SumKwh,
|
||||
"todayKwh": record.TodayKwh,
|
||||
"updateTime": record.UpdateTime, // 确保转换为适合数据库的日期时间格式
|
||||
"userId": record.UserId,
|
||||
"userName": record.UserName,
|
||||
"yearKwh": record.YearKwh,
|
||||
}).Save()
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器详情
|
||||
type EquipmentDetailReq struct {
|
||||
g.Meta `path:"/equipment/detail" method:"get" tags:"禾望云相关" summary:"获取逆变器详情"`
|
||||
Id string `json:"id" dc:"逆变器ID" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentDetail(ctx context.Context, req *EquipmentDetailReq) (res *EquipmentDetailRes, err error) {
|
||||
res = new(EquipmentDetailRes)
|
||||
data := make(map[string]string)
|
||||
data["id"] = req.Id
|
||||
data["sn"] = req.Sn
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentDetail", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
|
||||
var Address struct {
|
||||
PlantAddress string `json:"plantAddress"`
|
||||
}
|
||||
|
||||
name := res.Result.PowerPlantName
|
||||
g.Model("plant").Fields("address AS plantAddress").Where("name = ?", name).Scan(&Address)
|
||||
|
||||
res.PlantAddress = Address.PlantAddress
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器实时数据
|
||||
type EquipmentRealDataReq struct {
|
||||
g.Meta `path:"/equipment/real/data" method:"get" tags:"禾望云相关" summary:"获取逆变器实时数据"`
|
||||
Id string `json:"id" dc:"逆变器ID" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentRealData(ctx context.Context, req *EquipmentRealDataReq) (res *EquipmentRealDataRes, err error) {
|
||||
res = new(EquipmentRealDataRes)
|
||||
data := make(map[string]string)
|
||||
data["id"] = req.Id
|
||||
data["sn"] = req.Sn
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentData", data)
|
||||
g.Dump(string(bytes))
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器历史数据
|
||||
type EquipmentHistoryReq struct {
|
||||
g.Meta `path:"/equipment/history" method:"get" tags:"禾望云相关" summary:"获取逆变器历史数据"`
|
||||
Time string `json:"time" dc:"日期字符 yyyy-MM-dd" v:"required"`
|
||||
Id string `json:"id" dc:"逆变器ID" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentHistory(ctx context.Context, req *EquipmentHistoryReq) (*EquipmentHistoryRes, error) {
|
||||
res := new(EquipmentHistoryRes)
|
||||
data := map[string]string{
|
||||
"id": req.Id,
|
||||
"sn": req.Sn,
|
||||
"time": req.Time,
|
||||
}
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentHistoryData", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
requiredKeys := map[string]bool{
|
||||
"ACActivePower": true,
|
||||
"ACReactivePower": true,
|
||||
"DCInputPower": true,
|
||||
"internalTemperature": true,
|
||||
"gridFrequency": true,
|
||||
"dayElectricity": true,
|
||||
"inverterEfficiency": true,
|
||||
}
|
||||
|
||||
for i := range res.Result {
|
||||
var filteredParams []struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
Unit string `json:"unit"`
|
||||
Value interface{} `json:"value"`
|
||||
}
|
||||
for _, param := range res.Result[i].ParamList {
|
||||
if _, ok := requiredKeys[param.Key]; ok {
|
||||
filteredParams = append(filteredParams, param)
|
||||
}
|
||||
}
|
||||
res.Result[i].ParamList = filteredParams
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器日统计数据
|
||||
type EquipmentStaticDayReq struct {
|
||||
g.Meta `path:"/equipment/static/day" method:"get" tags:"禾望云相关" summary:"获取逆变器日统计数据"`
|
||||
StartTime string `json:"startTime" dc:"开始日期字符 yyyy-MM-dd" v:"required"`
|
||||
EndTime string `json:"endTime" dc:"开始日期字符 yyyy-MM-dd" v:"required"`
|
||||
Id string `json:"id" dc:"逆变器ID" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentStaticDay(ctx context.Context, req *EquipmentStaticDayReq) (res *EquipmentStaticDayRes, err error) {
|
||||
res = new(EquipmentStaticDayRes)
|
||||
data := make(map[string]string)
|
||||
data["id"] = req.Id
|
||||
data["sn"] = req.Sn
|
||||
data["startTime"] = req.StartTime
|
||||
data["endTime"] = req.EndTime
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentDayStatisticsData", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器月统计数据
|
||||
type EquipmentStaticMonthReq struct {
|
||||
g.Meta `path:"/equipment/static/month" method:"get" tags:"禾望云相关" summary:"获取逆变器月统计数据"`
|
||||
StartTime string `json:"startTime" dc:"开始日期字符 yyyy-MM" v:"required"`
|
||||
EndTime string `json:"endTime" dc:"开始日期字符 yyyy-MM" v:"required"`
|
||||
Id string `json:"id" dc:"逆变器ID" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentStaticMonth(ctx context.Context, req *EquipmentStaticMonthReq) (res *EquipmentStaticMonthRes, err error) {
|
||||
res = new(EquipmentStaticMonthRes)
|
||||
data := make(map[string]string)
|
||||
data["id"] = req.Id
|
||||
data["sn"] = req.Sn
|
||||
data["startTime"] = req.StartTime
|
||||
data["endTime"] = req.EndTime
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentMonthStatisticsData", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器年统计数据
|
||||
type EquipmentStaticYearReq struct {
|
||||
g.Meta `path:"/equipment/static/year" method:"get" tags:"禾望云相关" summary:"获取逆变器年统计数据"`
|
||||
StartTime string `json:"startTime" dc:"开始日期字符 yyyy" v:"required"`
|
||||
EndTime string `json:"endTime" dc:"开始日期字符 yyyy" v:"required"`
|
||||
Id string `json:"id" dc:"逆变器ID" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentStaticYear(ctx context.Context, req *EquipmentStaticYearReq) (res *EquipmentStaticYearRes, err error) {
|
||||
res = new(EquipmentStaticYearRes)
|
||||
data := make(map[string]string)
|
||||
data["id"] = req.Id
|
||||
data["sn"] = req.Sn
|
||||
data["startTime"] = req.StartTime
|
||||
data["endTime"] = req.EndTime
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentYearStatisticsData", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器报警列表数据
|
||||
type EquipmentAlarmListReq struct {
|
||||
g.Meta `path:"/equipment/alarm/list" method:"get" tags:"禾望云相关" summary:"获取逆变器报警数据列表"`
|
||||
StartTime string `json:"startTime" dc:"开始日期字符 yyyy-MM-dd" v:"required"`
|
||||
EndTime string `json:"endTime" dc:"开始日期字符 yyyy-MM-dd" v:"required"`
|
||||
Pn string `json:"pn" dc:"逆变器PN" v:"required"`
|
||||
Sn string `json:"sn" dc:"逆变器SN" v:"required"`
|
||||
}
|
||||
|
||||
func (e EquipmentApi) EquipmentAlarmList(ctx context.Context, req *EquipmentAlarmListReq) (res *EquipmentAlarmListRes, err error) {
|
||||
res = new(EquipmentAlarmListRes)
|
||||
data := make(map[string]string)
|
||||
data["pn"] = req.Pn
|
||||
data["sn"] = req.Sn
|
||||
data["startTime"] = req.StartTime
|
||||
data["endTime"] = req.EndTime
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Get("/openApi/equipment/getEquipmentFaultData", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// 获取逆变器报警相关数据
|
||||
type EquipmentAlarmDetailDataReq struct {
|
||||
g.Meta `path:"/equipment/alarm/detail" method:"get" tags:"禾望云相关" summary:"获取逆变器报警数据详情"`
|
||||
AlarmId string `json:"alarmId" dc:"报警ID" v:"required"`
|
||||
}
|
||||
|
||||
// 获取设备报警详情数据
|
||||
func (e EquipmentApi) EquipmentAlarmDetailData(ctx context.Context, req *EquipmentAlarmDetailDataReq) (res *EquipmentAlarmDetailDataRes, err error) {
|
||||
res = new(EquipmentAlarmDetailDataRes)
|
||||
data := make(map[string]string)
|
||||
data["alarmId"] = req.AlarmId
|
||||
sign.SignByRSA(data)
|
||||
err, bytes := client.Post("openApi/equipment/getAlarmDetailDataById", data)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
err = json.Unmarshal(bytes, &res)
|
||||
return res, nil
|
||||
}
|
||||
296
api/hwy/equipment/res.go
Normal file
296
api/hwy/equipment/res.go
Normal file
@ -0,0 +1,296 @@
|
||||
package equipment
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
|
||||
)
|
||||
|
||||
// 逆变器列表响应
|
||||
type EquipmentListRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Result struct {
|
||||
Page struct {
|
||||
PageIndex int `json:"pageIndex"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Total int `json:"total"`
|
||||
} `json:"page"`
|
||||
Records []struct {
|
||||
DivertorId string `json:"divertorId"`
|
||||
DivertorName string `json:"divertorName"`
|
||||
EquipmentName string `json:"equipmentName"`
|
||||
EquipmentPn string `json:"equipmentPn"`
|
||||
EquipmentSn string `json:"equipmentSn"`
|
||||
Id string `json:"id"`
|
||||
Kwp float64 `json:"kwp"`
|
||||
MonKwh float64 `json:"monKwh"`
|
||||
NowKw float64 `json:"nowKw"`
|
||||
ParamDcacCode string `json:"paramDcacCode"`
|
||||
ParamDcdcCode string `json:"paramDcdcCode"`
|
||||
PowerPlantId string `json:"powerPlantId"`
|
||||
PowerPlantName string `json:"powerPlantName"`
|
||||
RatedPower float64 `json:"ratedPower"`
|
||||
SoftDcacCode string `json:"softDcacCode"`
|
||||
SoftDcdcCode string `json:"softDcdcCode"`
|
||||
Status int `json:"status"`
|
||||
SumKwh float64 `json:"sumKwh"`
|
||||
TodayKwh float64 `json:"todayKwh"`
|
||||
UpdateTime string `json:"updateTime"`
|
||||
UserId string `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
YearKwh float64 `json:"yearKwh"`
|
||||
} `json:"records"`
|
||||
Statistics struct {
|
||||
AlarmNumber int `json:"alarmNumber"`
|
||||
OfflineNumber int `json:"offlineNumber"`
|
||||
OnlineNumber int `json:"onlineNumber"`
|
||||
SumNumber int `json:"sumNumber"`
|
||||
} `json:"statistics"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int `json:"timestamp"`
|
||||
}
|
||||
|
||||
// 逆变器详情响应
|
||||
type EquipmentDetailRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
PlantAddress string `json:"plantAddress"`
|
||||
Result struct {
|
||||
DivertorId string `json:"divertorId"`
|
||||
DivertorName string `json:"divertorName"`
|
||||
EquipmentName string `json:"equipmentName"`
|
||||
EquipmentPn string `json:"equipmentPn"`
|
||||
EquipmentSn string `json:"equipmentSn"`
|
||||
Id string `json:"id"`
|
||||
Kwp float64 `json:"kwp"`
|
||||
MonKwh float64 `json:"monKwh"`
|
||||
NowKw float64 `json:"nowKw"`
|
||||
ParamDcacCode string `json:"paramDcacCode"`
|
||||
ParamDcdcCode string `json:"paramDcdcCode"`
|
||||
PowerPlantId string `json:"powerPlantId"`
|
||||
PowerPlantName string `json:"powerPlantName"`
|
||||
RatedPower float64 `json:"ratedPower"`
|
||||
SoftDcacCode string `json:"softDcacCode"`
|
||||
SoftDcdcCode string `json:"softDcdcCode"`
|
||||
Status int `json:"status"`
|
||||
SumKwh float64 `json:"sumKwh"`
|
||||
TodayKwh float64 `json:"todayKwh"`
|
||||
UpdateTime string `json:"updateTime"`
|
||||
UserId string `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
YearKwh float64 `json:"yearKwh"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int `json:"timestamp"`
|
||||
}
|
||||
|
||||
// 逆变器实时数据
|
||||
type EquipmentRealDataRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Result struct {
|
||||
EquipmentModel string `json:"equipmentModel"`
|
||||
FullHours float64 `json:"fullHours"`
|
||||
InternalTemperature float64 `json:"internalTemperature"`
|
||||
MonKwh float64 `json:"monKwh"`
|
||||
NowKw float64 `json:"nowKw"`
|
||||
ParamData struct {
|
||||
ParamList []struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
Unit string `json:"unit"`
|
||||
Value interface{} `json:"value"`
|
||||
} `json:"paramList"`
|
||||
Time string `json:"time"`
|
||||
} `json:"paramData"`
|
||||
PowerFactor float64 `json:"powerFactor"`
|
||||
PowerPercentage float64 `json:"powerPercentage"`
|
||||
PowerUnit string `json:"powerUnit"`
|
||||
RatedPower float64 `json:"ratedPower"`
|
||||
RatedVoltage float64 `json:"ratedVoltage"`
|
||||
SumKwh float64 `json:"sumKwh"`
|
||||
TodayKwh float64 `json:"todayKwh"`
|
||||
YearKwh float64 `json:"yearKwh"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int `json:"timestamp"`
|
||||
}
|
||||
|
||||
// 逆变器历史数据
|
||||
type EquipmentHistoryRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Result []struct {
|
||||
ParamList []struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
Unit string `json:"unit"`
|
||||
Value interface{} `json:"value"`
|
||||
} `json:"paramList"`
|
||||
Time string `json:"time"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int `json:"timestamp"`
|
||||
}
|
||||
|
||||
// 逆变器日统计数据
|
||||
type EquipmentStaticDayRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Result []struct {
|
||||
Time string `json:"time"`
|
||||
Kwh float64 `json:"kwh"`
|
||||
KwhUnit string `json:"kwhUnit"`
|
||||
Earnings float64 `json:"earnings"`
|
||||
EarningsUnit string `json:"earningsUnit"`
|
||||
} `json:"result"`
|
||||
}
|
||||
|
||||
// 逆变器月统计数据
|
||||
type EquipmentStaticMonthRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Result []struct {
|
||||
Time string `json:"time"`
|
||||
Kwh float64 `json:"kwh"`
|
||||
KwhUnit string `json:"kwhUnit"`
|
||||
Earnings float64 `json:"earnings"`
|
||||
EarningsUnit string `json:"earningsUnit"`
|
||||
} `json:"result"`
|
||||
}
|
||||
|
||||
// 逆变器年统计数据
|
||||
type EquipmentStaticYearRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Result []struct {
|
||||
Time string `json:"time"`
|
||||
Kwh float64 `json:"kwh"`
|
||||
KwhUnit string `json:"kwhUnit"`
|
||||
Earnings float64 `json:"earnings"`
|
||||
EarningsUnit string `json:"earningsUnit"`
|
||||
} `json:"result"`
|
||||
}
|
||||
|
||||
// 逆变器报警列表数据
|
||||
type EquipmentAlarmListRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Result []struct {
|
||||
AlarmCode string `json:"alarmCode"`
|
||||
AlarmContent string `json:"alarmContent"`
|
||||
AlarmGrade string `json:"alarmGrade"`
|
||||
AlarmType string `json:"alarmType"`
|
||||
CausesAnalysis string `json:"causesAnalysis"`
|
||||
DiagnosticAdvice string `json:"diagnosticAdvice"`
|
||||
EquipmentPn string `json:"equipmentPn"`
|
||||
EquipmentSn string `json:"equipmentSn"`
|
||||
Id string `json:"id"`
|
||||
PlantContactPhone string `json:"plantContactPhone"`
|
||||
PowerPlantId string `json:"powerPlantId"`
|
||||
PowerPlantName string `json:"powerPlantName"`
|
||||
ReportedTime string `json:"reportedTime"`
|
||||
UserId string `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int `json:"timestamp"`
|
||||
}
|
||||
|
||||
// 逆变器报警数据
|
||||
type EquipmentAlarmDetailRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Obj struct{} `json:"obj"`
|
||||
Result struct {
|
||||
Page struct {
|
||||
PageIndex int `json:"pageIndex"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Total int `json:"total"`
|
||||
} `json:"page"`
|
||||
Records []struct {
|
||||
AlarmCode string `json:"alarmCode"`
|
||||
AlarmContent string `json:"alarmContent"`
|
||||
AlarmGrade string `json:"alarmGrade"`
|
||||
AlarmType string `json:"alarmType"`
|
||||
CausesAnalysis string `json:"causesAnalysis"`
|
||||
DiagnosticAdvice string `json:"diagnosticAdvice"`
|
||||
EquipmentPn string `json:"equipmentPn"`
|
||||
EquipmentSn string `json:"equipmentSn"`
|
||||
Id string `json:"id"`
|
||||
Phone string `json:"phone"`
|
||||
PowerPlantAddress string `json:"powerPlantAddress"`
|
||||
PowerPlantId string `json:"powerPlantId"`
|
||||
PowerPlantName string `json:"powerPlantName"`
|
||||
ReportedTime string `json:"reportedTime"`
|
||||
RestoreTime string `json:"restoreTime"`
|
||||
Status string `json:"status"`
|
||||
UserId string `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
} `json:"records"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int `json:"timestamp"`
|
||||
}
|
||||
|
||||
// 逆变器报警详情
|
||||
type EquipmentAlarmDetailDataRes struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Result struct {
|
||||
Address string `json:"address"`
|
||||
AlarmCode string `json:"alarmCode"`
|
||||
AlarmContent string `json:"alarmContent"`
|
||||
AlarmGrade int `json:"alarmGrade"`
|
||||
AlarmGradeName string `json:"alarmGradeName"`
|
||||
AlarmSource int `json:"alarmSource"`
|
||||
AlarmSourceName string `json:"alarmSourceName"`
|
||||
CausesAnalysis string `json:"causesAnalysis"`
|
||||
ContactName string `json:"contactName"`
|
||||
DeviceModel string `json:"deviceModel"`
|
||||
DiagnosticAdvice string `json:"diagnosticAdvice"`
|
||||
Email string `json:"email"`
|
||||
Id string `json:"id"`
|
||||
IgnoreStatus int `json:"ignoreStatus"`
|
||||
IgnoreStatusName string `json:"ignoreStatusName"`
|
||||
OrganizationId string `json:"organizationId"`
|
||||
OrganizationName string `json:"organizationName"`
|
||||
Phone string `json:"phone"`
|
||||
Pn string `json:"pn"`
|
||||
PowerPlantId string `json:"powerPlantId"`
|
||||
PowerPlantName string `json:"powerPlantName"`
|
||||
ProductTypeName string `json:"productTypeName"`
|
||||
ReportedTime string `json:"reportedTime"`
|
||||
RestoreTime string `json:"restoreTime"`
|
||||
Sn string `json:"sn"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
UserId string `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
} `json:"result"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp string `json:"timestamp"`
|
||||
}
|
||||
|
||||
// EquipmentListQueryRes 数据库查询返回
|
||||
type EquipmentListQueryRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
common.ListRes
|
||||
List []entity.Equipment `json:"list"`
|
||||
}
|
||||
Reference in New Issue
Block a user