mirror of
https://github.com/MickMake/GoSungrow.git
synced 2025-05-31 01:59:14 +02:00
60 lines
1.1 KiB
Go
60 lines
1.1 KiB
Go
package getOrgListByName
|
|
|
|
import (
|
|
"GoSungrow/iSolarCloud/api"
|
|
"GoSungrow/iSolarCloud/api/apiReflect"
|
|
"fmt"
|
|
)
|
|
|
|
const Url = "/v1/orgService/getOrgListByName"
|
|
const Disabled = false
|
|
|
|
type RequestData struct {
|
|
// DeviceType string `json:"device_type" required:"true"`
|
|
}
|
|
|
|
func (rd RequestData) IsValid() error {
|
|
return apiReflect.VerifyOptionsRequired(rd)
|
|
}
|
|
|
|
func (rd RequestData) Help() string {
|
|
ret := fmt.Sprintf("")
|
|
return ret
|
|
}
|
|
|
|
type ResultData []struct {
|
|
IsLeaf api.Bool `json:"is_leaf"`
|
|
OrgID api.Integer `json:"org_id"`
|
|
OrgName api.String `json:"org_name"`
|
|
}
|
|
|
|
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
|
|
//}
|