feat:完善项目
This commit is contained in:
24
app/controller/config/instance.go
Normal file
24
app/controller/config/instance.go
Normal file
@ -0,0 +1,24 @@
|
||||
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}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user