feat:完善项目信息
This commit is contained in:
@ -1,19 +1,29 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"SciencesServer/app/service"
|
||||
"SciencesServer/app/basic/config"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
)
|
||||
|
||||
type Config struct{ *service.Session }
|
||||
type Config struct{ *session.Admin }
|
||||
|
||||
type ConfigHandle func(session *service.Session) *Config
|
||||
type ConfigHandle func(session *session.Admin) *Config
|
||||
|
||||
func (c *Config) Basic() {
|
||||
|
||||
}
|
||||
|
||||
// Area 区域信息
|
||||
func (c *Config) Area(key string) map[string]string {
|
||||
if key == "" {
|
||||
key = config2.DefaultChinaAreaCode
|
||||
}
|
||||
return config.MemoryForAreaInfo[key]
|
||||
}
|
||||
|
||||
func NewConfig() ConfigHandle {
|
||||
return func(session *service.Session) *Config {
|
||||
return &Config{Session: session}
|
||||
return func(session *session.Admin) *Config {
|
||||
return &Config{Admin: session}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user