2021-10-27 13:27:01 +08:00
|
|
|
package controller
|
|
|
|
|
2021-12-16 13:22:14 +08:00
|
|
|
import (
|
2022-01-05 18:40:08 +08:00
|
|
|
"SciencesServer/app/basic/config"
|
|
|
|
"SciencesServer/app/session"
|
|
|
|
config2 "SciencesServer/config"
|
2021-12-16 13:22:14 +08:00
|
|
|
)
|
2021-10-27 13:27:01 +08:00
|
|
|
|
2022-01-05 18:40:08 +08:00
|
|
|
type Config struct{ *session.Admin }
|
2021-10-27 13:27:01 +08:00
|
|
|
|
2022-01-05 18:40:08 +08:00
|
|
|
type ConfigHandle func(session *session.Admin) *Config
|
2021-10-27 13:27:01 +08:00
|
|
|
|
2021-12-16 15:35:44 +08:00
|
|
|
func (c *Config) Basic() {
|
2021-12-16 13:22:14 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-01-05 18:40:08 +08:00
|
|
|
// Area 区域信息
|
|
|
|
func (c *Config) Area(key string) map[string]string {
|
|
|
|
if key == "" {
|
|
|
|
key = config2.DefaultChinaAreaCode
|
|
|
|
}
|
|
|
|
return config.MemoryForAreaInfo[key]
|
|
|
|
}
|
|
|
|
|
2021-10-27 13:27:01 +08:00
|
|
|
func NewConfig() ConfigHandle {
|
2022-01-05 18:40:08 +08:00
|
|
|
return func(session *session.Admin) *Config {
|
|
|
|
return &Config{Admin: session}
|
2021-10-27 13:27:01 +08:00
|
|
|
}
|
|
|
|
}
|