23 lines
447 B
Plaintext
23 lines
447 B
Plaintext
|
|
package managecenterModel
|
|||
|
|
|
|||
|
|
// 服务器(组)Id区间类型
|
|||
|
|
type ServerIdRange struct {
|
|||
|
|
Min int32 // 最小值
|
|||
|
|
Max int32 // 最大值
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 是否包含指定的值
|
|||
|
|
// value:指定值
|
|||
|
|
// 返回值:
|
|||
|
|
// 是否包含指定的值
|
|||
|
|
func (this *ServerIdRange) Contains(value int32) bool {
|
|||
|
|
return this.Min <= value && value <= this.Max
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func NewServerIdRange(min, max int32) *ServerIdRange {
|
|||
|
|
return &ServerIdRange{
|
|||
|
|
Min: min,
|
|||
|
|
Max: max,
|
|||
|
|
}
|
|||
|
|
}
|