Skip to content

Commit

Permalink
v2.3.1 - Added more endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
MickMake committed Oct 10, 2022
1 parent ef55ebc commit fa85548
Show file tree
Hide file tree
Showing 57 changed files with 1,437 additions and 841 deletions.
89 changes: 35 additions & 54 deletions .idea/workspace.xml

Large diffs are not rendered by default.

19 changes: 4 additions & 15 deletions cmd/cmd_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,6 @@ func (ca *Cmds) SunGrowArgs(_ *cobra.Command, _ []string) error {
}

ca.Api.SunGrow.SetOutputType(ca.Api.OutputType)
// switch ca.ApiOutputType {
// case output.StringTypeJson:
// ca.Api.SunGrow.OutputType.SetJson()
// case output.StringTypeCsv:
// ca.Api.SunGrow.OutputType.SetCsv()
// case output.StringTypeRaw:
// ca.Api.SunGrow.OutputType.SetRaw()
// case output.StringTypeGraph:
// ca.Api.SunGrow.OutputType.SetGraph()
// case output.StringTypeTable:
// fallthrough
// default:
// ca.Api.SunGrow.OutputType.SetTable()
// }
ca.Api.SunGrow.SaveAsFile = ca.Api.SaveFile

if ca.Api.AppKey == "" {
Expand Down Expand Up @@ -422,8 +408,11 @@ func (c *CmdApi) CmdApiGet(_ *cobra.Command, args []string) error {
c.Error = c.SunGrow.AllCritical()
break
}

ep := c.SunGrow.GetByJson(args[0], args[1])
if ep.IsError() {
c.Error = ep.GetError()
break
}
if c.SunGrow.Error != nil {
c.Error = c.SunGrow.Error
break
Expand Down
2 changes: 1 addition & 1 deletion iSolarCloud/AppService/findPsType/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Url = "/v1/powerStationService/findPsType"
const Disabled = false

type RequestData struct {
PsId string `json:"ps_id" required:"true"`
PsId api.Integer `json:"ps_id" required:"true"`
}

func (rd RequestData) IsValid() error {
Expand Down
6 changes: 3 additions & 3 deletions iSolarCloud/AppService/getAreaList/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ func (rd RequestData) Help() string {
type ResultData struct {
PageList []struct {
FaultStationCount api.Integer `json:"fault_station_count"`
IsHaveEsPs string `json:"is_have_es_ps"`
IsLeaf api.Integer `json:"is_leaf"`
IsHaveEsPs api.Bool `json:"is_have_es_ps"`
IsLeaf api.Bool `json:"is_leaf"`
OrgID api.Integer `json:"org_id"`
OrgName string `json:"org_name"`
OrgName api.String `json:"org_name"`
P83048 api.UnitValue `json:"p83048"`
P83049 api.UnitValue `json:"p83049"`
P83050 api.UnitValue `json:"p83050"`
Expand Down
34 changes: 17 additions & 17 deletions iSolarCloud/AppService/getDeviceList/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,37 @@ type ResultData struct {
DeviceCode api.Integer `json:"device_code"`
DeviceFactoryDate interface{} `json:"device_factory_date"`
DeviceID api.Integer `json:"device_id"`
DeviceModel string `json:"device_model"`
DeviceModelCode string `json:"device_model_code"`
DeviceModel api.String `json:"device_model"`
DeviceModelCode api.String `json:"device_model_code"`
DeviceModelID api.Integer `json:"device_model_id"`
DeviceName string `json:"device_name"`
DeviceProSn string `json:"device_pro_sn"`
DeviceName api.String `json:"device_name"`
DeviceProSn api.String `json:"device_pro_sn"`
DeviceState string `json:"device_state"`
DeviceSubType interface{} `json:"device_sub_type"`
DeviceSubTypeName interface{} `json:"device_sub_type_name"`
DeviceType api.Integer `json:"device_type"`
FactoryName string `json:"factory_name"`
FactoryName api.String `json:"factory_name"`
InstallerDevFaultStatus string `json:"installer_dev_fault_status"`
InverterModelType api.Integer `json:"inverter_model_type"`
IsCountryCheck api.Integer `json:"is_country_check"`
IsHasFunctionEnum api.Integer `json:"is_has_function_enum"`
IsHasTheAbility api.Integer `json:"is_has_the_ability"`
IsInit api.Integer `json:"is_init"`
IsReadSet api.Integer `json:"is_read_set"`
IsReplacing api.Integer `json:"is_replacing"`
IsReset api.Integer `json:"is_reset"`
IsSecond api.Integer `json:"is_second"`
IsThirdParty api.Integer `json:"is_third_party"`
IsCountryCheck api.Bool `json:"is_country_check"`
IsHasFunctionEnum api.Bool `json:"is_has_function_enum"`
IsHasTheAbility api.Bool `json:"is_has_the_ability"`
IsInit api.Bool `json:"is_init"`
IsReadSet api.Bool `json:"is_read_set"`
IsReplacing api.Bool `json:"is_replacing"`
IsReset api.Bool `json:"is_reset"`
IsSecond api.Bool `json:"is_second"`
IsThirdParty api.Bool `json:"is_third_party"`
ModuleUUID api.Integer `json:"module_uuid"`
OwnerDevFaultStatus string `json:"owner_dev_fault_status"`
P24 interface{} `json:"p24"`
Posx interface{} `json:"posx"`
Posy interface{} `json:"posy"`
PsID api.Integer `json:"ps_id"`
PsKey string `json:"ps_key"`
PsKey api.PsKey `json:"ps_key"`
RelState api.Integer `json:"rel_state"`
Sn string `json:"sn"`
TypeName string `json:"type_name"`
Sn api.String `json:"sn"`
TypeName api.String `json:"type_name"`
UUID api.Integer `json:"uuid"`
} `json:"pageList"`
RowCount api.Integer `json:"rowCount"`
Expand Down
2 changes: 1 addition & 1 deletion iSolarCloud/AppService/getDeviceModelInfoList/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ResultData []struct {
DeviceModelCode string `json:"device_model_code"`
DeviceModelID api.Integer `json:"device_model_id"`
DeviceType api.Integer `json:"device_type"`
IsRemoteUpgrade api.Integer `json:"is_remote_upgrade"`
IsRemoteUpgrade api.Bool `json:"is_remote_upgrade"`
}

func (e *ResultData) IsValid() error {
Expand Down
4 changes: 2 additions & 2 deletions iSolarCloud/AppService/getDeviceTypeInfoList/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ func (rd RequestData) Help() string {

type ResultData []struct {
DeviceType api.Integer `json:"device_type"`
IsRemoteUpgrade api.Integer `json:"is_remote_upgrade"`
IsRemoteUpgrade api.Bool `json:"is_remote_upgrade"`
TypeCode api.Integer `json:"type_code"`
TypeName string `json:"type_name"`
TypeName api.String `json:"type_name"`
}

func (e *ResultData) IsValid() error {
Expand Down
2 changes: 1 addition & 1 deletion iSolarCloud/AppService/getDeviceTypeList/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type ResultData struct {
DeviceTypeList []struct {
DevListOrderID api.Integer `json:"dev_list_order_id"`
DeviceType api.Integer `json:"device_type"`
TypeName string `json:"type_name"`
TypeName api.String `json:"type_name"`
} `json:"deviceTypeList"`
}

Expand Down
6 changes: 3 additions & 3 deletions iSolarCloud/AppService/getFaultMsgListWithYYYYMM/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ func (rd RequestData) Help() string {

type ResultData []struct {
CreateTime api.Integer `json:"create_time"`
FaultCode string `json:"fault_code"`
FaultCode api.String `json:"fault_code"`
FaultLevel api.Integer `json:"fault_level"`
FaultReason string `json:"fault_reason"`
FaultReason api.String `json:"fault_reason"`
FaultType api.Integer `json:"fault_type"`
FaultTypeCode api.Integer `json:"fault_type_code"`
ID api.Integer `json:"id"`
PsID api.Integer `json:"ps_id"`
PsKey string `json:"ps_key"`
PsKey api.PsKey `json:"ps_key"`
UUID api.Integer `json:"uuid"`
}

Expand Down

0 comments on commit fa85548

Please sign in to comment.