forked from free-lancers/electricity_bill_calc_service
		
	feat(park):基本完成园区功能接口的迁移。
This commit is contained in:
		
							
								
								
									
										51
									
								
								model/enums.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								model/enums.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | ||||
| package model | ||||
|  | ||||
| const ( | ||||
| 	ELECTRICITY_CATE_TWO_PART int16 = iota | ||||
| 	ELECTRICITY_CATE_UNITARY_PV | ||||
| 	ELECTRICITY_CATE_FULL_PV | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	METER_TYPE_UNITARY int16 = iota | ||||
| 	METER_TYPE_PV | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	METER_INSTALLATION_TENEMENT int16 = iota | ||||
| 	METER_INSTALLATION_PARK | ||||
| 	METER_INSTALLATION_POOLING | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	PRICING_POLICY_CONSUMPTION int16 = iota | ||||
| 	PRICING_POLICY_ALL | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	POOLING_MODE_NONE int16 = iota | ||||
| 	POOLING_MODE_CONSUMPTION | ||||
| 	POOLING_MODE_AREA | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	PAYMENT_CASH int16 = iota | ||||
| 	PAYMENT_BANK_CARD | ||||
| 	PAYMENT_ALIPAY | ||||
| 	PAYMENT_WECHAT | ||||
| 	PAYMENT_UNION_PAY | ||||
| 	PAYMENT_OTHER int16 = 99 | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	METER_TELEMETER_HYBRID int16 = iota | ||||
| 	METER_TELEMETER_AUTOMATIC | ||||
| 	METER_TELEMETER_MANUAL | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	RETRY_INTERVAL_ALGORITHM_EXPONENTIAL_BACKOFF int16 = iota | ||||
| 	RETRY_INTERVAL_ALGORITHM_DOUBLE_LINEAR_BACKOFF | ||||
| 	RETRY_INTERVAL_ALGORITHM_TRIPLE_LINEAR_BACKOFF | ||||
| 	RETRY_INTERVAL_ALGORITHM_FIXED | ||||
| ) | ||||
							
								
								
									
										32
									
								
								model/park.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								model/park.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| package model | ||||
|  | ||||
| import ( | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/shopspring/decimal" | ||||
| ) | ||||
|  | ||||
| type Park struct { | ||||
| 	Id               string              `json:"id"` | ||||
| 	UserId           string              `json:"userId"` | ||||
| 	Name             string              `json:"name"` | ||||
| 	Area             decimal.NullDecimal `json:"area"` | ||||
| 	TenementQuantity decimal.NullDecimal `json:"tenementQuantity"` | ||||
| 	Capacity         decimal.NullDecimal `json:"capacity"` | ||||
| 	Category         int16               `json:"category"` | ||||
| 	MeterType        int16               `json:"meter04kvType"` | ||||
| 	PricePolicy      int16               `json:"pricePolicy"` | ||||
| 	BasicPooled      int16               `json:"basicPooled"` | ||||
| 	AdjustPooled     int16               `json:"adjustPooled"` | ||||
| 	LossPooled       int16               `json:"lossPooled"` | ||||
| 	PublicPooled     int16               `json:"publicPooled"` | ||||
| 	TaxRate          decimal.NullDecimal `json:"taxRate"` | ||||
| 	Region           *string             `json:"region"` | ||||
| 	Address          *string             `json:"address"` | ||||
| 	Contact          *string             `json:"contact"` | ||||
| 	Phone            *string             `json:"phone"` | ||||
| 	Enabled          bool                `json:"enabled"` | ||||
| 	CreatedAt        time.Time           `json:"createdAt"` | ||||
| 	LastModifiedAt   time.Time           `json:"lastModifiedAt"` | ||||
| 	DeletedAt        *time.Time          `json:"deletedAt"` | ||||
| } | ||||
							
								
								
									
										14
									
								
								model/park_building.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								model/park_building.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| package model | ||||
|  | ||||
| import "time" | ||||
|  | ||||
| type ParkBuilding struct { | ||||
| 	Id             string     `json:"id"` | ||||
| 	Park           string     `json:"parkId" db:"park_id"` | ||||
| 	Name           string     `json:"name"` | ||||
| 	Floors         *string    `json:"floors"` | ||||
| 	Enabled        bool       `json:"enabled"` | ||||
| 	CreatedAt      time.Time  `json:"createdAt"` | ||||
| 	LastModifiedAt time.Time  `json:"lastModifiedAt"` | ||||
| 	DeletedAt      *time.Time `json:"deletedAt"` | ||||
| } | ||||
		Reference in New Issue
	
	Block a user