-
Notifications
You must be signed in to change notification settings - Fork 9
/
AiotTopOpenDeviceDto.go
40 lines (35 loc) · 1.09 KB
/
AiotTopOpenDeviceDto.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package util
import (
"sync"
)
// AiotTopOpenDeviceDto 结构体
type AiotTopOpenDeviceDto struct {
// 设备唯一标识
Uuid string `json:"uuid,omitempty" xml:"uuid,omitempty"`
// 业务自定义参数
ExtendStr string `json:"extend_str,omitempty" xml:"extend_str,omitempty"`
// 组织架构
Organization *AiotOpenDeviceOrganizationDto `json:"organization,omitempty" xml:"organization,omitempty"`
// 基础信息
Base *AiotOpenDeviceBaseDto `json:"base,omitempty" xml:"base,omitempty"`
// 租户号
TenantId int64 `json:"tenant_id,omitempty" xml:"tenant_id,omitempty"`
}
var poolAiotTopOpenDeviceDto = sync.Pool{
New: func() any {
return new(AiotTopOpenDeviceDto)
},
}
// GetAiotTopOpenDeviceDto() 从对象池中获取AiotTopOpenDeviceDto
func GetAiotTopOpenDeviceDto() *AiotTopOpenDeviceDto {
return poolAiotTopOpenDeviceDto.Get().(*AiotTopOpenDeviceDto)
}
// ReleaseAiotTopOpenDeviceDto 释放AiotTopOpenDeviceDto
func ReleaseAiotTopOpenDeviceDto(v *AiotTopOpenDeviceDto) {
v.Uuid = ""
v.ExtendStr = ""
v.Organization = nil
v.Base = nil
v.TenantId = 0
poolAiotTopOpenDeviceDto.Put(v)
}