forked from free-lancers/electricity_bill_calc_service
enhance(meter):完成大部分表计相关的接口。
This commit is contained in:
@@ -2,7 +2,6 @@ package model
|
||||
|
||||
import (
|
||||
"electricity_bill_calc/types"
|
||||
"time"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
@@ -19,31 +18,31 @@ type MeterDetail struct {
|
||||
Ratio decimal.Decimal `json:"ratio" db:"ratio"`
|
||||
Seq int64 `json:"seq" db:"seq"`
|
||||
Enabled bool `json:"enabled" db:"enabled"`
|
||||
AttachedAt *time.Time `json:"attachedAt" db:"attached_at"`
|
||||
DetachedAt *time.Time `json:"detachedAt" db:"detached_at"`
|
||||
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
||||
LastModifiedAt time.Time `json:"lastModifiedAt" db:"last_modified_at"`
|
||||
AttachedAt *types.DateTime `json:"attachedAt" db:"attached_at"`
|
||||
DetachedAt *types.DateTime `json:"detachedAt" db:"detached_at"`
|
||||
CreatedAt types.DateTime `json:"createdAt" db:"created_at"`
|
||||
LastModifiedAt types.DateTime `json:"lastModifiedAt" db:"last_modified_at"`
|
||||
}
|
||||
|
||||
type MeterRelation struct {
|
||||
Id string `json:"id"`
|
||||
Park string `json:"parkId" db:"park_id"`
|
||||
MasterMeter string `json:"masterMeterId" db:"master_meter_id"`
|
||||
SlaveMeter string `json:"slaveMeterId" db:"slave_meter_id"`
|
||||
EstablishedAt time.Time `json:"establishedAt"`
|
||||
SuspendedAt *time.Time `json:"suspendedAt"`
|
||||
RevokeAt *time.Time `json:"revokeAt"`
|
||||
Id string `json:"id"`
|
||||
Park string `json:"parkId" db:"park_id"`
|
||||
MasterMeter string `json:"masterMeterId" db:"master_meter_id"`
|
||||
SlaveMeter string `json:"slaveMeterId" db:"slave_meter_id"`
|
||||
EstablishedAt types.DateTime `json:"establishedAt"`
|
||||
SuspendedAt *types.DateTime `json:"suspendedAt"`
|
||||
RevokeAt *types.DateTime `json:"revokeAt"`
|
||||
}
|
||||
|
||||
type MeterSynchronization struct {
|
||||
Park string `json:"parkId" db:"park_id"`
|
||||
Meter string `json:"meterId" db:"meter_id"`
|
||||
ForeignMeter string `json:"foreignMeter"`
|
||||
SystemType string `json:"systemType"`
|
||||
SystemIdentity string `json:"systemIdentity"`
|
||||
Enabled bool `json:"enabled"`
|
||||
LastSynchronizedAt time.Time `json:"lastSynchronizedAt" db:"last_synchronized_at"`
|
||||
RevokeAt *time.Time `json:"revokeAt" db:"revoke_at"`
|
||||
Park string `json:"parkId" db:"park_id"`
|
||||
Meter string `json:"meterId" db:"meter_id"`
|
||||
ForeignMeter string `json:"foreignMeter"`
|
||||
SystemType string `json:"systemType"`
|
||||
SystemIdentity string `json:"systemIdentity"`
|
||||
Enabled bool `json:"enabled"`
|
||||
LastSynchronizedAt types.DateTime `json:"lastSynchronizedAt" db:"last_synchronized_at"`
|
||||
RevokeAt *types.DateTime `json:"revokeAt" db:"revoke_at"`
|
||||
}
|
||||
|
||||
type SimpleMeterDocument struct {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
"electricity_bill_calc/types"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
@@ -38,7 +38,7 @@ func NewUnitaryReading(ratio, overall decimal.Decimal) *Reading {
|
||||
}
|
||||
|
||||
type MeterReading struct {
|
||||
ReadAt time.Time `json:"readAt"`
|
||||
ReadAt types.DateTime `json:"readAt"`
|
||||
Park string `json:"parkId" db:"park_id"`
|
||||
Meter string `json:"meterId" db:"meter_id"`
|
||||
MeterType int16 `json:"meterType"`
|
||||
|
Reference in New Issue
Block a user