25 lines
472 B
Go
25 lines
472 B
Go
![]() |
package config
|
||
|
|
||
|
import (
|
||
|
"ArmedPolice/app/service"
|
||
|
"ArmedPolice/config"
|
||
|
)
|
||
|
|
||
|
type Instance struct{ *service.Session }
|
||
|
|
||
|
type InstanceHandle func(session *service.Session) *Instance
|
||
|
|
||
|
// Area 区域信息
|
||
|
func (c *Instance) Area(key string) map[string]string {
|
||
|
if key == "" {
|
||
|
key = config.DefaultChinaAreaCode
|
||
|
}
|
||
|
return config.SettingAreaInfo[key]
|
||
|
}
|
||
|
|
||
|
func NewInstance() InstanceHandle {
|
||
|
return func(session *service.Session) *Instance {
|
||
|
return &Instance{session}
|
||
|
}
|
||
|
}
|