642 lines
15 KiB
Go
642 lines
15 KiB
Go
package proto
|
|
|
|
import (
|
|
"encoding/json"
|
|
"mime/multipart"
|
|
)
|
|
|
|
type BasePageList struct {
|
|
Page int64 `json:"pageNum,omitempty" form:"page"`
|
|
Size int64 `json:"pageSize,omitempty" form:"pageSize"`
|
|
}
|
|
|
|
type UserLogin struct {
|
|
UserName string `json:"username"`
|
|
UserPass string `json:"password"`
|
|
}
|
|
|
|
func (us UserLogin) ToString() string {
|
|
data, err := json.Marshal(us)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type UserRequest struct {
|
|
RealName string `json:"realName"`
|
|
Phone string `json:"phone"`
|
|
BasePageList
|
|
}
|
|
|
|
func (us UserRequest) ToString() string {
|
|
data, err := json.Marshal(us)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type OwnerRequest struct {
|
|
OwnerName string `json:"ownerName"`
|
|
BasePageList
|
|
}
|
|
|
|
func (r OwnerRequest) ToString() string {
|
|
data, err := json.Marshal(r)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type OwnerItemReq struct {
|
|
OwnerId int64 `json:"ownerId"`
|
|
OwnerName string `json:"ownerName"`
|
|
ChargeUser string `json:"chargeUser"`
|
|
Phone string `json:"phone"`
|
|
Creator int64 `json:"creator"`
|
|
}
|
|
|
|
func (r OwnerItemReq) ToString() string {
|
|
data, err := json.Marshal(r)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ProjectRequest struct {
|
|
LineName string `json:"lineName"`
|
|
ProjectName string `json:"projectName"`
|
|
OwnerId int64 `json:"ownerId,omitempty"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p ProjectRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ProjectItemRequest struct {
|
|
ProjectId int64 `json:"projectId"`
|
|
ProjectName string `json:"projectName"`
|
|
OwnerId int64 `json:"ownerId"`
|
|
LineName string `json:"lineName"`
|
|
StartName string `json:"startName"`
|
|
EndName string `json:"endName"`
|
|
FixedDeviceNum int `json:"fixedDeviceNum"`
|
|
Direction string `json:"direction"`
|
|
LaneNum int `json:"laneNum"`
|
|
Creator int64 `json:"creator"`
|
|
}
|
|
|
|
func (p ProjectItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ProductRequest struct {
|
|
CategoryId int64 `json:"categoryId"`
|
|
ProductName string `json:"productName"`
|
|
Protocol int64 `json:"protocol"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p ProductRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ProductItemRequest struct {
|
|
MatterId int64 `json:"matterId"`
|
|
MatterName string `json:"matterName"`
|
|
CategoryId int64 `json:"categoryId"`
|
|
Protocol int `json:"protocol"`
|
|
Connection int `json:"connection"`
|
|
ModelDesc string `json:"modelDesc"`
|
|
UserVersion int64 `json:"userVersion"`
|
|
Status int `json:"status"`
|
|
}
|
|
|
|
func (p ProductItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ProductCategoryRequest struct {
|
|
CategoryName string `json:"categoryName"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p ProductCategoryRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ProductCategoryItemRequest struct {
|
|
CategoryId int64 `json:"categoryId"`
|
|
CategoryName string `json:"categoryName"`
|
|
CategoryDesc string `json:"categoryDesc"`
|
|
Status int `json:"status"`
|
|
}
|
|
|
|
func (p ProductCategoryItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type AttributeRequest struct {
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p AttributeRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type AttributeItemRequest struct {
|
|
AttributeId int64 `json:"attributeId"`
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
AttributeName string `json:"attributeName"`
|
|
AttributeKey string `json:"attributeKey"`
|
|
AttributeDesc string `json:"attributeDesc"`
|
|
DataType int `json:"dataType"`
|
|
MaxValue string `json:"maxValue"`
|
|
MinValue string `json:"minValue"`
|
|
StepValue string `json:"stepValue"`
|
|
Unit string `json:"unit"`
|
|
IsOnlyRead int `json:"isOnlyRead"`
|
|
}
|
|
|
|
func (p AttributeItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type EventItemRequest struct {
|
|
EventId int64 `json:"eventId"`
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
EventIdentifier string `json:"eventIdentifier"`
|
|
EventType string `json:"eventType"`
|
|
EventDesc string `json:"eventDesc"`
|
|
}
|
|
|
|
func (p EventItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ServiceItemRequest struct {
|
|
ServiceId int64 `json:"serviceId"`
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
ServiceName string `json:"serviceName"`
|
|
ServiceIdentifier string `json:"serviceIdentifier"`
|
|
Calling int `json:"calling"`
|
|
ServiceDesc string `json:"serviceDesc"`
|
|
}
|
|
|
|
func (p ServiceItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type EventParamsRequest struct {
|
|
EventId int64 `json:"eventId"`
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p EventParamsRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type EventParamItem struct {
|
|
ParamsId int64 `json:"paramsId"`
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
EventId int64 `json:"eventId"`
|
|
ParamName string `json:"paramName"`
|
|
ParamIdentifier string `json:"paramIdentifier"`
|
|
ParamDesc string `json:"paramDesc"`
|
|
DataType int `json:"dataType"`
|
|
MaxValue string `json:"maxValue"`
|
|
MinValue string `json:"minValue"`
|
|
StepValue string `json:"stepValue"`
|
|
Unit string `json:"unit"`
|
|
}
|
|
|
|
func (p EventParamItem) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ServiceParamsRequest struct {
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
ServiceId int64 `json:"serviceId"`
|
|
ParamsOwnerType int `json:"paramsOwnerType"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p ServiceParamsRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ServiceParamItem struct {
|
|
ParamsId int64 `json:"paramsId"`
|
|
MatterId int64 `json:"matterId"`
|
|
VersionId int64 `json:"versionId"`
|
|
ServiceId int64 `json:"serviceId"`
|
|
ParamsOwnerType int `json:"paramsOwnerType"`
|
|
ParamName string `json:"paramName"`
|
|
ParamIdentifier string `json:"paramIdentifier"`
|
|
ParamDesc string `json:"paramDesc"`
|
|
DataType int `json:"dataType"`
|
|
MaxValue string `json:"maxValue"`
|
|
MinValue string `json:"minValue"`
|
|
StepValue string `json:"stepValue"`
|
|
Unit string `json:"unit"`
|
|
}
|
|
|
|
func (p ServiceParamItem) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ModelRequest struct {
|
|
ModelName string `json:"modelName,omitempty"`
|
|
BizType int `json:"bizType,omitempty"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p ModelRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ModelItemRequest struct {
|
|
ModelId int64 `json:"modelId"`
|
|
BizType int `json:"bizType"`
|
|
ModelName string `json:"modelName"`
|
|
ModelVersion string `json:"modelVersion"`
|
|
ModelDesc string `json:"modelDesc"`
|
|
ModelFiles string `json:"modelFiles"`
|
|
ModelParamsFiles string `json:"modelParamsFiles"`
|
|
ModelExecScript string `json:"modelExecScript"`
|
|
DockerFile []string `json:"dockerFile"`
|
|
MappedPort int `json:"mappedPort"`
|
|
ModelCommand string `json:"modelCommand"`
|
|
InPath string `json:"inPath"`
|
|
OutPath string `json:"outPath"`
|
|
HttpUrl string `json:"httpUrl"`
|
|
IsLightWeight bool `json:"isLightWeight"`
|
|
Workflow string `json:"workflow"`
|
|
}
|
|
|
|
func (p ModelItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ModelIssueRequest struct {
|
|
NodeId int64 `json:"nodeId"`
|
|
ModelId int64 `json:"modelId"`
|
|
}
|
|
|
|
func (p ModelIssueRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type DeviceRequest struct {
|
|
Key string `json:"key"`
|
|
ProductId int64 `json:"productId"`
|
|
DeviceTypeId int `json:"deviceTypeId"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p DeviceRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type DeviceItemRequest struct {
|
|
DeviceId int64 `json:"deviceId"`
|
|
DeviceName string `json:"deviceName"`
|
|
DeviceBrandId int `json:"deviceBrandId"`
|
|
DeviceImei string `json:"deviceImei"`
|
|
DeviceSn string `json:"deviceSn"`
|
|
DeviceTypeId int `json:"deviceTypeId"`
|
|
ButtMatterId int64 `json:"buttMatterId"`
|
|
ButtType int `json:"buttType"`
|
|
ButtAddress string `json:"buttAddress"`
|
|
ButtPort int `json:"buttPort"`
|
|
Longitude float64 `json:"longitude"`
|
|
Latitude float64 `json:"latitude"`
|
|
DeviceDesc string `json:"deviceDesc"`
|
|
}
|
|
|
|
func (p DeviceItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type UploadFileRequest struct {
|
|
Creator int64 `json:"creator"`
|
|
Scene string `json:"scene"`
|
|
Files []*multipart.FileHeader `json:"files"`
|
|
DatasetId int64 `json:"datasetId"`
|
|
}
|
|
|
|
type BrandRequest struct {
|
|
BrandName string `json:"brandName"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p BrandRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type BrandItemRequest struct {
|
|
BrandId int64 `json:"brandId"`
|
|
BrandName string `json:"brandName"`
|
|
BrandLogo string `json:"brandLogo"`
|
|
BrandWeb string `json:"brandWeb"`
|
|
}
|
|
|
|
func (p BrandItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type DiseaseRequest struct {
|
|
BizType int `json:"bizType"`
|
|
Key string `json:"key"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p DiseaseRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type DiseaseTypeRequest struct {
|
|
CategoryId int `json:"categoryId"`
|
|
Key string `json:"key"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p DiseaseTypeRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type DiseaseTypeItemRequest struct {
|
|
TypeId int64 `json:"typeId"`
|
|
TypeName string `json:"typeName"`
|
|
CategoryId int `json:"categoryId"`
|
|
}
|
|
|
|
func (p DiseaseTypeItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type OwnerProjectRequest struct {
|
|
Key string `json:"key"`
|
|
}
|
|
|
|
func (p OwnerProjectRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type DatasetRequest struct {
|
|
OwnerId int64 `json:"ownerId"`
|
|
ProjectId int64 `json:"projectId"`
|
|
DatasetName string `json:"datasetName"`
|
|
StartTime string `json:"startTime"`
|
|
EndTime string `json:"endTime"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p DatasetRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ImportDatasetRequest struct {
|
|
DatasetId int64 `json:"datasetId"`
|
|
CategoryId int `json:"categoryId"`
|
|
DatasetName string `json:"datasetName"`
|
|
DatasetDesc string `json:"datasetDesc"`
|
|
ProjectId int64 `json:"projectId"`
|
|
StoreName string `json:"storeName"`
|
|
OwnerId int64 `json:"ownerId"`
|
|
Creator int64 `json:"creator"`
|
|
}
|
|
|
|
func (p ImportDatasetRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type NodeRequest struct {
|
|
NodeId int64 `json:"nodeId"`
|
|
NodeName string `json:"nodeName"`
|
|
NodeGuid string `json:"nodeGuid"`
|
|
NodeType int `json:"nodeType"`
|
|
Platform string `json:"platform"`
|
|
PlatformVersion string `json:"platformVersion"`
|
|
CPU string `json:"cpu"`
|
|
MemTotal uint64 `json:"memTotal"`
|
|
DiskTotal uint64 `json:"diskTotal"`
|
|
SwapTotal uint64 `json:"swapTotal"`
|
|
Arch string `json:"arch"`
|
|
Virtualization string `json:"virtualization"`
|
|
BootTime uint64 `json:"bootTime"`
|
|
IP string `json:"ip"`
|
|
CountryCode string `json:"countryCode"`
|
|
Version string `json:"version"`
|
|
CreateAt int64 `json:"createAt"`
|
|
UpdateAt int64 `json:"updateAt"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p NodeRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type NodeItemRequest struct {
|
|
NodeId int64 `json:"nodeId"`
|
|
NodeName string `json:"nodeName"`
|
|
NodeGuid string `json:"nodeGuid"`
|
|
NodeType int `json:"nodeType"`
|
|
Platform string `json:"platform"`
|
|
PlatformVersion string `json:"platformVersion"`
|
|
CPU string `json:"cpu"`
|
|
MemTotal uint64 `json:"memTotal"`
|
|
DiskTotal uint64 `json:"diskTotal"`
|
|
SwapTotal uint64 `json:"swapTotal"`
|
|
Arch string `json:"arch"`
|
|
Virtualization string `json:"virtualization"`
|
|
BootTime uint64 `json:"bootTime"`
|
|
IP string `json:"ip"`
|
|
CountryCode string `json:"countryCode"`
|
|
Version string `json:"version"`
|
|
CreateAt int64 `json:"createAt"`
|
|
UpdateAt int64 `json:"updateAt"`
|
|
}
|
|
|
|
func (p NodeItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type NodeInfoRequest struct {
|
|
NodeGuid string `json:"nodeGuid"`
|
|
Uptime int64 `json:"uptime"`
|
|
}
|
|
|
|
func (p NodeInfoRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type TaskRequest struct {
|
|
BizType int `json:"bizType"`
|
|
TaskName string `json:"taskName"`
|
|
StartTime string `json:"startTime"`
|
|
FinishTime string `json:"finishTime"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p TaskRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type TaskItemRequest struct {
|
|
TaskId int64 `json:"taskId"`
|
|
ModelId int64 `json:"modelId"`
|
|
NodeId int64 `json:"nodeId"`
|
|
TaskName string `json:"taskName"`
|
|
TaskDesc string `json:"taskDesc"`
|
|
DatasetArr int64 `json:"datasetArr"`
|
|
SubDataset string `json:"subDataset"`
|
|
SubDataTag int `json:"subDataTag"`
|
|
AppointmentTime string `json:"appointmentTime"`
|
|
}
|
|
|
|
func (p TaskItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|