/
object_controller.go
158 lines (133 loc) · 4.56 KB
/
object_controller.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package metadata
import (
"configcenter/src/common/mapstr"
)
// RspID response id
type RspID struct {
ID int64 `json:"id"`
}
// CreateResult create result
type CreateResult struct {
BaseResp `json:",inline"`
Data []Association `json:"data"`
}
// UpdateResult update result
type UpdateResult struct {
BaseResp `json:",inline"`
}
// DeleteResult delete result
type DeleteResult struct {
BaseResp `json:",inline"`
}
// QueryObjectResult query object result
type QueryObjectResult struct {
BaseResp `json:",inline"`
Data []Object `json:"data"`
}
// CreateObjectResult create object result
type CreateObjectResult struct {
BaseResp `json:",inline"`
Data RspID `json:"data"`
}
// CreateObjectAttributeResult create object attribute result
type CreateObjectAttributeResult struct {
BaseResp `json:",inline"`
Data RspID `json:"data"`
}
// AttributeWrapper wrapper, expansion field
type AttributeWrapper struct {
Attribute `json:",inline"`
AssoType int `json:"bk_asst_type"`
AsstForward string `json:"bk_asst_forward"`
AssociationID string `json:"bk_asst_obj_id"`
PropertyGroupName string `json:"bk_property_group_name"`
}
// UpdateGroupCondition update group condition struct
type UpdateGroupCondition struct {
ModelBizID int64 `json:"bk_biz_id"`
Condition struct {
ID int64 `field:"id" json:"id,omitempty"`
} `json:"condition"`
Data struct {
IsCollapse *bool `field:"is_collapse" json:"is_collapse,omitempty"`
Name *string `field:"bk_group_name" json:"bk_group_name,omitempty"`
Index *int64 `field:"bk_group_index" json:"bk_group_index,omitempty"`
} `json:"data"`
}
// QueryObjectAttributeWrapperResult query object attribute with association info result
type QueryObjectAttributeWrapperResult struct {
BaseResp `json:",inline"`
Data []AttributeWrapper `json:"data"`
}
// QueryObjectAttributeResult query object attribute result
type QueryObjectAttributeResult struct {
BaseResp `json:",inline"`
Data []Attribute `json:"data"`
}
// CreateObjectGroupResult create the object group result
type CreateObjectGroupResult struct {
BaseResp `json:",inline"`
Data RspID `json:"data"`
}
// QueryObjectGroupResult query the object group result
type QueryObjectGroupResult struct {
BaseResp `json:",inline"`
Data []Group `json:"data"`
}
// CreateObjectClassificationResult create the object classification result
type CreateObjectClassificationResult struct {
BaseResp `json:",inline"`
Data RspID `json:"data"`
}
// QueryObjectClassificationResult query the object classification result
type QueryObjectClassificationResult struct {
BaseResp `json:",inline"`
Data []Classification `json:"data"`
}
// ClassificationWithObject classification with object
type ClassificationWithObject struct {
Classification `json:",inline"`
Objects []Object `json:"bk_objects"`
}
// QueryObjectClassificationWithObjectsResult query the object classification with objects result
type QueryObjectClassificationWithObjectsResult struct {
BaseResp `json:",inline"`
Data []ClassificationWithObject `json:"data"`
}
// QueryObjectAssociationResult query object association result
type QueryObjectAssociationResult struct {
BaseResp `json:",inline"`
Data []Association `json:"data"`
}
// InstResult inst item result
type InstResult struct {
Count int `json:"count"`
Info []mapstr.MapStr `json:"info"`
}
// QueryInstResult query inst result
type QueryInstResult struct {
BaseResp `json:",inline"`
Data InstResult `json:"data"`
}
// CreateInstResult create inst result
type CreateInstResult struct {
BaseResp `json:",inline"`
Data mapstr.MapStr `json:"data"`
}
// ObjClassificationObject define the class object class
type ObjClassificationObject struct {
Classification `bson:",inline"`
Objects []Object `json:"bk_objects"`
AsstObjects map[string][]interface{} `json:"bk_asst_objects"`
}