220 lines
4.9 KiB
Go
220 lines
4.9 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"`
|
||
|
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"`
|
||
|
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)
|
||
|
}
|