Skip to content

Commit

Permalink
v3.0.0-alpha - bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MickMake committed Nov 17, 2022
1 parent 584e262 commit 8d52bac
Show file tree
Hide file tree
Showing 31 changed files with 993 additions and 2,748 deletions.
2,127 changes: 129 additions & 1,998 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions iSolarCloud/AppService/getHistoryInfo/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"GoSungrow/iSolarCloud/api/GoStruct"
"GoSungrow/iSolarCloud/api/GoStruct/valueTypes"
"github.com/MickMake/GoUnify/Only"
"fmt"
)

const Url = "/v1/powerStationService/getHistoryInfo"
Expand All @@ -21,7 +20,7 @@ func (rd RequestData) IsValid() error {
}

func (rd RequestData) Help() string {
ret := fmt.Sprintf("")
ret := api.HelpDateId()
ret += api.HelpDataType()
return ret
}
Expand Down
1 change: 1 addition & 0 deletions iSolarCloud/AppService/getHouseholdStoragePsReport/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func (rd RequestData) IsValid() error {

func (rd RequestData) Help() string {
ret := fmt.Sprintln("ps_id: Can be fetched from getPsList.")
ret += api.HelpDateId()
ret += api.HelpDataType()
return ret
}
Expand Down
48 changes: 11 additions & 37 deletions iSolarCloud/AppService/getInstallerInfoByDealerOrgCodeOrId/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"GoSungrow/iSolarCloud/api"
"GoSungrow/iSolarCloud/api/GoStruct"
"GoSungrow/iSolarCloud/api/GoStruct/valueTypes"
"github.com/MickMake/GoUnify/Only"
"fmt"
"github.com/MickMake/GoUnify/Only"
)

const Url = "/v1/orgService/getInstallerInfoByDealerOrgCodeOrId"
Expand All @@ -25,53 +25,27 @@ func (rd RequestData) Help() string {
return ret
}


type ResultData struct {
UserInfoList []struct {
DealerOrgCode string `json:"dealer_org_code"`
Email string `json:"email"`
Installer string `json:"installer"`
InstallerEmail string `json:"installer_email"`
InstallerPhone string `json:"installer_phone"`
MobleTel interface{} `json:"moble_tel" PointId:"mobile_tel"`
DealerOrgCode valueTypes.String `json:"dealer_org_code"`
Email valueTypes.String `json:"email"`
Installer valueTypes.String `json:"installer"`
InstallerEmail valueTypes.String `json:"installer_email"`
InstallerPhone valueTypes.String `json:"installer_phone"`
MobleTel interface{} `json:"moble_tel" PointId:"mobile_tel"`
OrgId valueTypes.Integer `json:"org_id"`
OrgName string `json:"org_name"`
OrgName valueTypes.String `json:"org_name"`
UserId valueTypes.Integer `json:"user_id"`
UserName string `json:"user_name"`
UserTelNationCode interface{} `json:"user_tel_nation_code"`
} `json:"user_info_list" DataTable:"true"`
UserName valueTypes.String `json:"user_name"`
UserTelNationCode interface{} `json:"user_tel_nation_code"`
} `json:"user_info_list" DataTable:"true" DataTable:"true"`
}

func (e *ResultData) IsValid() error {
var err error
// switch {
// case e.Dummy == "":
// break
// default:
// err = errors.New(fmt.Sprintf("unknown error '%s'", e.Dummy))
// }
return err
}

//type DecodeResultData ResultData
//
//func (e *ResultData) UnmarshalJSON(data []byte) error {
// var err error
//
// for range Only.Once {
// if len(data) == 0 {
// break
// }
// var pd DecodeResultData
//
// // Store ResultData
// _ = json.Unmarshal(data, &pd)
// e.Dummy = pd.Dummy
// }
//
// return err
//}

func (e *EndPoint) GetData() api.DataMap {
entries := api.NewDataMap()

Expand Down
4 changes: 2 additions & 2 deletions iSolarCloud/AppService/getKpiInfo/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func (rd RequestData) Help() string {
}

type ResultData struct {
ActualEnergy []valueTypes.Float `json:"actual_energy" PointUnitFrom:"ActualEnergyUnit" DataTable:"true" DataTableMerge:"true" DataTableShowIndex:"true"`
PlanEnergy []valueTypes.Float `json:"plan_energy" PointUnitFrom:"PlanEnergyUnit" DataTable:"true" DataTableMerge:"true" DataTableShowIndex:"true"`
ActualEnergy []valueTypes.Float `json:"actual_energy" PointUnitFrom:"ActualEnergyUnit" DataTable:"true" DataTableMerge:"true" DataTableIndex:"true"`
PlanEnergy []valueTypes.Float `json:"plan_energy" PointUnitFrom:"PlanEnergyUnit" DataTable:"true" DataTableMerge:"true" DataTableIndex:"true"`

ActualEnergyUnit valueTypes.String `json:"actual_energy_unit" PointIgnore:"true"`
ChargeTotalEnergy valueTypes.Float `json:"charge_total_energy" PointUnitFrom:"ChargeTotalEnergyUnit" PointUpdateFreq:"UpdateFreqTotal"`
Expand Down
73 changes: 24 additions & 49 deletions iSolarCloud/AppService/getModuleLogTaskList/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"GoSungrow/iSolarCloud/api"
"GoSungrow/iSolarCloud/api/GoStruct"
"GoSungrow/iSolarCloud/api/GoStruct/valueTypes"
"github.com/MickMake/GoUnify/Only"
"fmt"
"github.com/MickMake/GoUnify/Only"
)

const Url = "/integrationService/getModuleLogTaskList"
Expand All @@ -27,29 +27,29 @@ type ResultData struct {
CurPage valueTypes.Integer `json:"curPage" PointId:"cur_page"`
IsMore valueTypes.Bool `json:"isMore" PointId:"is_more"`
PageList []struct {
BatchId valueTypes.String `json:"batch_id"`
CommandStatus valueTypes.Integer `json:"command_status"`
CommandType valueTypes.Integer `json:"command_type"`
CreateTime valueTypes.DateTime `json:"create_time"`
DeviceCode valueTypes.Integer `json:"device_code"`
DeviceModel valueTypes.String `json:"device_model"`
DeviceModelId valueTypes.String `json:"device_model_id"`
ExpireSecond valueTypes.Integer `json:"expire_second"`
LogType valueTypes.Integer `json:"log_type"`
LoggerCode valueTypes.Integer `json:"logger_code"`
OperateUserId valueTypes.Integer `json:"operate_user_id"`
OverTime valueTypes.DateTime `json:"over_time"`
Remark valueTypes.String `json:"remark"`
SetCancelNum valueTypes.Integer `json:"set_cancel_num"`
SetFailNum valueTypes.Integer `json:"set_fail_num"`
SetFinishNum valueTypes.Integer `json:"set_finish_num"`
SetOvertimeNum valueTypes.Integer `json:"set_overtime_num"`
SetSuccessNum valueTypes.Integer `json:"set_success_num"`
SetTotalNum valueTypes.Integer `json:"set_total_num"`
Sn valueTypes.String `json:"sn"`
TaskId valueTypes.Integer `json:"task_id"`
TaskName valueTypes.Integer `json:"task_name"`
UpdateTime valueTypes.DateTime `json:"update_time"`
BatchId valueTypes.String `json:"batch_id"`
CommandStatus valueTypes.Integer `json:"command_status"`
CommandType valueTypes.Integer `json:"command_type"`
CreateTime valueTypes.DateTime `json:"create_time"`
OverTime valueTypes.DateTime `json:"over_time"`
UpdateTime valueTypes.DateTime `json:"update_time"`
ExpireSecond valueTypes.Integer `json:"expire_second"`
DeviceCode valueTypes.Integer `json:"device_code"`
DeviceModel valueTypes.String `json:"device_model"`
DeviceModelId valueTypes.String `json:"device_model_id"`
LogType valueTypes.Integer `json:"log_type"`
LoggerCode valueTypes.Integer `json:"logger_code"`
OperateUserId valueTypes.Integer `json:"operate_user_id"`
Remark valueTypes.String `json:"remark"`
SetCancelNum valueTypes.Bool `json:"set_cancel_num"`
SetFailNum valueTypes.Bool `json:"set_fail_num"`
SetFinishNum valueTypes.Bool `json:"set_finish_num"`
SetOvertimeNum valueTypes.Bool `json:"set_overtime_num"`
SetSuccessNum valueTypes.Bool `json:"set_success_num"`
SetTotalNum valueTypes.Bool `json:"set_total_num"`
Sn valueTypes.String `json:"sn"`
TaskId valueTypes.Integer `json:"task_id"`
TaskName valueTypes.String `json:"task_name"`
} `json:"pageList" PointId:"page_list" PointIdFromChild:"TaskId" PointIdReplace:"true" DataTable:"true"`
RowCount valueTypes.Integer `json:"rowCount" PointId:"row_count"`
Size valueTypes.Integer `json:"size"`
Expand All @@ -59,34 +59,9 @@ type ResultData struct {

func (e *ResultData) IsValid() error {
var err error
// switch {
// case e.Dummy == "":
// break
// default:
// err = errors.New(fmt.Sprintf("unknown error '%s'", e.Dummy))
// }
return err
}

// type DecodeResultData ResultData
//
// func (e *ResultData) UnmarshalJSON(data []byte) error {
// var err error
//
// for range Only.Once {
// if len(data) == 0 {
// break
// }
// var pd DecodeResultData
//
// // Store ResultData
// _ = json.Unmarshal(data, &pd)
// e.Dummy = pd.Dummy
// }
//
// return err
// }

func (e *EndPoint) GetData() api.DataMap {
entries := api.NewDataMap()

Expand Down
33 changes: 5 additions & 28 deletions iSolarCloud/AppService/getPowerDevicePointNames/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,41 +73,18 @@ func (rd RequestData) Help() string {
}

type ResultData []struct {
PointCalType valueTypes.Integer `json:"point_cal_type"`
PointId valueTypes.Integer `json:"point_id"`
PointName valueTypes.String `json:"point_name"`
GoStructParent GoStruct.GoStructParent `json:"-" DataTable:"true"`

PointId valueTypes.Integer `json:"point_id"`
PointName valueTypes.String `json:"point_name"`
PointCalType valueTypes.Integer `json:"point_cal_type"`
}

func (e *ResultData) IsValid() error {
var err error
//switch {
//case e.Dummy == "":
// break
//default:
// err = errors.New(fmt.Sprintf("unknown error '%s'", e.Dummy))
//}
return err
}

//type DecodeResultData ResultData
//
//func (e *ResultData) UnmarshalJSON(data []byte) error {
// var err error
//
// for range Only.Once {
// if len(data) == 0 {
// break
// }
// var pd DecodeResultData
//
// // Store ResultData
// _ = json.Unmarshal(data, &pd)
// e.Dummy = pd.Dummy
// }
//
// return err
//}

func (e *EndPoint) GetPointDataTable() output.Table {
var table output.Table

Expand Down
10 changes: 1 addition & 9 deletions iSolarCloud/AppService/getPowerStationData/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,7 @@ func (rd RequestData) IsValid() error {

func (rd RequestData) Help() string {
ret := fmt.Sprintln("template_id: Use AppService.getTemplateList for ids.")
ret += fmt.Sprintln("date_type: Day = 1")
ret += fmt.Sprintln("\tstart_time_stamp: Format YYYYmmddHHMM00")
ret += fmt.Sprintln("\tend_time_stamp: Format YYYYmmddHHMM00")
ret += fmt.Sprintln("date_type: Month = 2")
ret += fmt.Sprintln("\tstart_time_stamp: Format YYYYmm")
ret += fmt.Sprintln("\tend_time_stamp: Format YYYYmm")
ret += fmt.Sprintln("date_type: Year = 3")
ret += fmt.Sprintln("\tstart_time_stamp: Format YYYY")
ret += fmt.Sprintln("\tend_time_stamp: Format YYYY")
ret += api.HelpDateId()
ret += api.HelpDataType()
return ret
}
Expand Down
3 changes: 1 addition & 2 deletions iSolarCloud/AppService/getPsReport/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"GoSungrow/iSolarCloud/api"
"GoSungrow/iSolarCloud/api/GoStruct"
"GoSungrow/iSolarCloud/api/GoStruct/valueTypes"
"fmt"
"github.com/MickMake/GoUnify/Only"
)

Expand All @@ -21,7 +20,7 @@ func (rd RequestData) IsValid() error {
}

func (rd RequestData) Help() string {
ret := fmt.Sprintf("report_type: One of 1, 2, 5")
ret := api.HelpReportType()
ret += api.HelpDataType()
return ret
}
Expand Down
47 changes: 11 additions & 36 deletions iSolarCloud/AppService/getRegionalTree/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"GoSungrow/iSolarCloud/api"
"GoSungrow/iSolarCloud/api/GoStruct"
"GoSungrow/iSolarCloud/api/GoStruct/valueTypes"
"github.com/MickMake/GoUnify/Only"
"fmt"
"github.com/MickMake/GoUnify/Only"
)

const Url = "/v1/orgService/getRegionalTree"
Expand All @@ -27,49 +27,24 @@ func (rd RequestData) Help() string {

type ResultData struct {
ResultList []struct {
Checked valueTypes.Bool `json:"checked"`
Id valueTypes.String `json:"id"`
IsFirstOrg valueTypes.Bool `json:"isFirstOrg" PointId:"is_first_org"`
IsParent valueTypes.Bool `json:"isParent" PointId:"is_parent"`
Name valueTypes.String `json:"name"`
Open valueTypes.Bool `json:"open"`
OrgId valueTypes.Integer `json:"org_id"`
PsId valueTypes.PsId `json:"ps_id"`
Id valueTypes.String `json:"id"`
Name valueTypes.String `json:"name"`
OrgId valueTypes.Integer `json:"org_id"`
ParentId valueTypes.Integer `json:"pId" PointId:"pid"`
PsId valueTypes.PsId `json:"ps_id"`
ShareType int64 `json:"share_type"`
} `json:"resultList" PointId:"resulte_list" DataTable:"true"`
Checked valueTypes.Bool `json:"checked"`
IsParent valueTypes.Bool `json:"isParent" PointId:"is_parent"`
IsFirstOrg valueTypes.Bool `json:"isFirstOrg" PointId:"is_first_org"`
Open valueTypes.Bool `json:"open"`
ShareType valueTypes.Integer `json:"share_type"`
} `json:"resultList" PointId:"results_list" DataTable:"true"`
}

func (e *ResultData) IsValid() error {
var err error
// switch {
// case e.Dummy == "":
// break
// default:
// err = errors.New(fmt.Sprintf("unknown error '%s'", e.Dummy))
// }
return err
}

//type DecodeResultData ResultData
//
//func (e *ResultData) UnmarshalJSON(data []byte) error {
// var err error
//
// for range Only.Once {
// if len(data) == 0 {
// break
// }
// var pd DecodeResultData
//
// // Store ResultData
// _ = json.Unmarshal(data, &pd)
// e.Dummy = pd.Dummy
// }
//
// return err
//}

func (e *EndPoint) GetData() api.DataMap {
entries := api.NewDataMap()

Expand Down
3 changes: 1 addition & 2 deletions iSolarCloud/AppService/getReportData/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"GoSungrow/iSolarCloud/api"
"GoSungrow/iSolarCloud/api/GoStruct"
"GoSungrow/iSolarCloud/api/GoStruct/valueTypes"
"fmt"
"github.com/MickMake/GoUnify/Only"
)

Expand All @@ -21,7 +20,7 @@ func (rd RequestData) IsValid() error {
}

func (rd RequestData) Help() string {
ret := fmt.Sprintf("")
ret := api.HelpReportType()
return ret
}

Expand Down

0 comments on commit 8d52bac

Please sign in to comment.