hpds_jkw_web/internal/proto/request.go

436 lines
9.9 KiB
Go
Raw Normal View History

2023-01-06 10:09:23 +08:00
package proto
2023-01-11 18:05:29 +08:00
import (
"encoding/json"
"mime/multipart"
)
2023-01-06 10:09:23 +08:00
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"`
2023-01-10 10:01:42 +08:00
OwnerId int64 `json:"ownerId,omitempty"`
2023-01-06 10:09:23 +08:00
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"`
2023-01-10 10:01:42 +08:00
Connection int `json:"connection"`
ModelDesc string `json:"modelDesc"`
2023-01-06 10:09:23 +08:00
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)
}
2023-01-06 14:38:22 +08:00
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"`
2023-01-10 10:01:42 +08:00
ParamDesc string `json:"paramDesc"`
2023-01-06 14:38:22 +08:00
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"`
2023-01-10 10:01:42 +08:00
ParamDesc string `json:"paramDesc"`
2023-01-06 14:38:22 +08:00
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)
}
2023-01-11 18:05:29 +08:00
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"`
}
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)
}
2023-01-12 10:21:40 +08:00
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)
}