feat:完善项目信息
This commit is contained in:
@ -2,15 +2,13 @@ package controller
|
||||
|
||||
import (
|
||||
"SciencesServer/app/api/admin/model"
|
||||
"SciencesServer/app/basic/config"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
)
|
||||
|
||||
type Config struct{ *session.Admin }
|
||||
type Config struct{ *session.Enterprise }
|
||||
|
||||
type ConfigHandle func(session *session.Admin) *Config
|
||||
type ConfigHandle func(session *session.Enterprise) *Config
|
||||
|
||||
type (
|
||||
ConfigInfo struct {
|
||||
@ -33,16 +31,8 @@ func (c *Config) Instance(kind int) ([]*ConfigInfo, error) {
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// 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 *session.Admin) *Config {
|
||||
return &Config{Admin: session}
|
||||
return func(session *session.Enterprise) *Config {
|
||||
return &Config{Enterprise: session}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user