332 lines
7.7 KiB
Go
332 lines
7.7 KiB
Go
package proto
|
|
|
|
import "encoding/json"
|
|
|
|
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 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 int `json:"projectId"`
|
|
ProjectName string `json:"projectName"`
|
|
OwnerId int `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"`
|
|
Lng float64 `json:"lng"`
|
|
Lat float64 `json:"lat"`
|
|
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"`
|
|
BasePageList
|
|
}
|
|
|
|
func (p ModelRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ModelItemRequest struct {
|
|
ModelId int `json:"modelId"`
|
|
ModelName string `json:"modelName"`
|
|
ModelVersion string `json:"modelVersion"`
|
|
ModelDesc string `json:"modelDesc"`
|
|
ModelFiles string `json:"modelFiles"`
|
|
ModelParamsFiles string `json:"modelParamsFiles"`
|
|
ModelExecScript string `json:"modelExecScript"`
|
|
}
|
|
|
|
func (p ModelItemRequest) ToString() string {
|
|
data, err := json.Marshal(p)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(data)
|
|
}
|