goProject/trunk/framework/managecenterModel/serverIdRange.go
皮蛋13361098506 1b77f62820 初始化项目
2025-01-06 16:01:02 +08:00

23 lines
447 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,
}
}