forked from free-lancers/electricity_bill_calc_service
		
	enhance(meter):基本完成表计大部分功能的放置。
This commit is contained in:
		
							
								
								
									
										38
									
								
								vo/meter.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								vo/meter.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| package vo | ||||
|  | ||||
| import "github.com/shopspring/decimal" | ||||
|  | ||||
| type MeterCreationForm struct { | ||||
| 	Code             string              `json:"code"` | ||||
| 	Address          *string             `json:"address"` | ||||
| 	Ratio            decimal.Decimal     `json:"ratio"` | ||||
| 	Seq              int64               `json:"seq"` | ||||
| 	MeterType        int16               `json:"meterType"` | ||||
| 	Building         *string             `json:"building"` | ||||
| 	OnFloor          *string             `json:"onFloor"` | ||||
| 	Area             decimal.NullDecimal `json:"area"` | ||||
| 	Enabled          bool                `json:"enabled"` | ||||
| 	MeterReadingForm `json:"-"` | ||||
| } | ||||
|  | ||||
| type MeterModificationForm struct { | ||||
| 	Address   *string             `json:"address"` | ||||
| 	Seq       int64               `json:"seq"` | ||||
| 	Ratio     decimal.Decimal     `json:"ratio"` | ||||
| 	Enabled   bool                `json:"enabled"` | ||||
| 	MeterType int16               `json:"meterType"` | ||||
| 	Building  *string             `json:"building"` | ||||
| 	OnFloor   *string             `json:"onFloor"` | ||||
| 	Area      decimal.NullDecimal `json:"area"` | ||||
| } | ||||
|  | ||||
| type NewMeterForReplacingForm struct { | ||||
| 	Code    string           `json:"code"` | ||||
| 	Ratio   decimal.Decimal  `json:"ratio"` | ||||
| 	Reading MeterReadingForm `json:"reading"` | ||||
| } | ||||
|  | ||||
| type MeterReplacingForm struct { | ||||
| 	OldReading MeterReadingForm         `json:"oldReading"` | ||||
| 	NewMeter   NewMeterForReplacingForm `json:"newMeter"` | ||||
| } | ||||
							
								
								
									
										16
									
								
								vo/reading.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								vo/reading.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| package vo | ||||
|  | ||||
| import ( | ||||
| 	"electricity_bill_calc/types" | ||||
|  | ||||
| 	"github.com/shopspring/decimal" | ||||
| ) | ||||
|  | ||||
| type MeterReadingForm struct { | ||||
| 	Overall  decimal.Decimal `json:"overall"` | ||||
| 	Critical decimal.Decimal `json:"critical"` | ||||
| 	Peak     decimal.Decimal `json:"peak"` | ||||
| 	Flat     decimal.Decimal `json:"flat"` | ||||
| 	Valley   decimal.Decimal `json:"valley"` | ||||
| 	ReadAt   *types.DateTime `json:"readAt"` | ||||
| } | ||||
		Reference in New Issue
	
	Block a user