feat:完善网站活动报名信息
This commit is contained in:
@ -72,7 +72,7 @@ func (c *Config) Area(key string) map[string]string {
|
|||||||
if key == "" {
|
if key == "" {
|
||||||
key = config2.DefaultChinaAreaCode
|
key = config2.DefaultChinaAreaCode
|
||||||
}
|
}
|
||||||
return config2.SettingAreaInfo[key]
|
return config.MemoryForAreaInfo[key]
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConfig() *Config {
|
func NewConfig() *Config {
|
||||||
|
@ -8,7 +8,7 @@ type Config struct{ *service.Session }
|
|||||||
|
|
||||||
type ConfigHandle func(session *service.Session) *Config
|
type ConfigHandle func(session *service.Session) *Config
|
||||||
|
|
||||||
func (c *Config) Platform() {
|
func (c *Config) Basic() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"SciencesServer/app/api/website/model"
|
"SciencesServer/app/api/website/model"
|
||||||
|
config2 "SciencesServer/app/basic/config"
|
||||||
model2 "SciencesServer/app/common/model"
|
model2 "SciencesServer/app/common/model"
|
||||||
"SciencesServer/app/service"
|
"SciencesServer/app/service"
|
||||||
"SciencesServer/config"
|
"SciencesServer/config"
|
||||||
@ -82,7 +83,7 @@ func (c *Index) distribution(src []*model.DataAreaDistributionInfo) map[string]*
|
|||||||
if !has {
|
if !has {
|
||||||
out[v.Province] = &InstanceDistributionDetailInfo{
|
out[v.Province] = &InstanceDistributionDetailInfo{
|
||||||
Code: v.Province,
|
Code: v.Province,
|
||||||
Name: config.SettingAreaInfo[config.DefaultChinaAreaCode][v.Province],
|
Name: config2.MemoryForAreaInfo[config.DefaultChinaAreaCode][v.Province],
|
||||||
Industry: nil,
|
Industry: nil,
|
||||||
Count: 1,
|
Count: 1,
|
||||||
Children: make(map[string]*InstanceDistributionDetailInfo, 0),
|
Children: make(map[string]*InstanceDistributionDetailInfo, 0),
|
||||||
@ -95,7 +96,7 @@ func (c *Index) distribution(src []*model.DataAreaDistributionInfo) map[string]*
|
|||||||
out[v.Province].Children[v.City] = &InstanceDistributionDetailInfo{
|
out[v.Province].Children[v.City] = &InstanceDistributionDetailInfo{
|
||||||
Code: v.City,
|
Code: v.City,
|
||||||
Count: 1,
|
Count: 1,
|
||||||
Name: config.SettingAreaInfo[v.Province][v.City],
|
Name: config2.MemoryForAreaInfo[v.Province][v.City],
|
||||||
Industry: industrys,
|
Industry: industrys,
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
@ -12,8 +12,12 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// MemoryForAreaInfo 区域信息
|
||||||
|
MemoryForAreaInfo map[string]map[string]string = make(map[string]map[string]string, 0)
|
||||||
// MemoryForIndustryInfo 行业信息
|
// MemoryForIndustryInfo 行业信息
|
||||||
MemoryForIndustryInfo map[string]string = make(map[string]string, 0)
|
MemoryForIndustryInfo map[string]string = make(map[string]string, 0)
|
||||||
|
// MemoryForPlatformInfo 平台信息
|
||||||
|
MemoryForPlatformInfo map[string]string = make(map[string]string, 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetIndustryInfo 获取行业信息
|
// GetIndustryInfo 获取行业信息
|
||||||
|
@ -123,10 +123,6 @@ func initModel() {
|
|||||||
&synchronized{iModel: model.NewUserCompany()}, &synchronized{iModel: model.NewUserExpert()},
|
&synchronized{iModel: model.NewUserCompany()}, &synchronized{iModel: model.NewUserExpert()},
|
||||||
&synchronized{iModel: model.NewUserLaboratory()}, &synchronized{iModel: model.NewUserResearch()},
|
&synchronized{iModel: model.NewUserLaboratory()}, &synchronized{iModel: model.NewUserResearch()},
|
||||||
&synchronized{iModel: model.NewUserAgent()},
|
&synchronized{iModel: model.NewUserAgent()},
|
||||||
// 入驻管理
|
|
||||||
&synchronized{iModel: model.NewManageCompany()}, &synchronized{iModel: model.NewManageExpert()},
|
|
||||||
&synchronized{iModel: model.NewManageLaboratory()}, &synchronized{iModel: model.NewManageResearch()},
|
|
||||||
&synchronized{iModel: model.NewManageAgent()},
|
|
||||||
// 数据管理
|
// 数据管理
|
||||||
&synchronized{iModel: model.NewManageCompany()}, &synchronized{iModel: model.NewManageExpert()},
|
&synchronized{iModel: model.NewManageCompany()}, &synchronized{iModel: model.NewManageExpert()},
|
||||||
&synchronized{iModel: model.NewManageLaboratory()}, &synchronized{iModel: model.NewManageResearch()},
|
&synchronized{iModel: model.NewManageLaboratory()}, &synchronized{iModel: model.NewManageResearch()},
|
||||||
@ -178,6 +174,21 @@ func initCacheMode() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
)
|
)
|
||||||
|
function(
|
||||||
|
&caches{iModel: model.NewSysPlatform(), iValues: func() interface{} {
|
||||||
|
out := make([]*model.SysPlatform, 0)
|
||||||
|
_ = model.ScanFields(model.NewSysPlatform(), &out, []string{"id", "key", "link"})
|
||||||
|
return out
|
||||||
|
}, toCache: func(values interface{}) {
|
||||||
|
out := values.([]*model.SysPlatform)
|
||||||
|
for _, v := range out {
|
||||||
|
if v.Link == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
config2.MemoryForPlatformInfo[v.Link] = v.Key
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
config2 "SciencesServer/app/basic/config"
|
||||||
"SciencesServer/config"
|
"SciencesServer/config"
|
||||||
"SciencesServer/utils"
|
"SciencesServer/utils"
|
||||||
"strings"
|
"strings"
|
||||||
@ -130,13 +131,13 @@ type Area struct {
|
|||||||
|
|
||||||
func (m *Area) FormatBasic() string {
|
func (m *Area) FormatBasic() string {
|
||||||
address := make([]string, 0)
|
address := make([]string, 0)
|
||||||
address = append(address, config.SettingAreaInfo[config.DefaultChinaAreaCode][m.Province])
|
address = append(address, config2.MemoryForAreaInfo[config.DefaultChinaAreaCode][m.Province])
|
||||||
|
|
||||||
if m.City != "" {
|
if m.City != "" {
|
||||||
address = append(address, config.SettingAreaInfo[m.Province][m.City])
|
address = append(address, config2.MemoryForAreaInfo[m.Province][m.City])
|
||||||
}
|
}
|
||||||
if m.District != "" {
|
if m.District != "" {
|
||||||
address = append(address, config.SettingAreaInfo[m.City][m.District])
|
address = append(address, config2.MemoryForAreaInfo[m.City][m.District])
|
||||||
}
|
}
|
||||||
return strings.Join(address, "-")
|
return strings.Join(address, "-")
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,7 @@ package config
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
SettingInfo = new(Setting)
|
SettingInfo = new(Setting)
|
||||||
RPCServerSettingInfo = new(RPCServerSetting)
|
//RPCServerSettingInfo = new(RPCServerSetting)
|
||||||
SettingAreaInfo = make(map[string]map[string]string, 0)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mysql 配置
|
// Mysql 配置
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package tools
|
package tools
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"SciencesServer/config"
|
"SciencesServer/app/basic/config"
|
||||||
"SciencesServer/tools/ip"
|
"SciencesServer/tools/ip"
|
||||||
"SciencesServer/utils"
|
"SciencesServer/utils"
|
||||||
)
|
)
|
||||||
@ -11,7 +11,7 @@ func initIP() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initJSON() {
|
func initJSON() {
|
||||||
utils.LoadConfig("./file/area.json", &config.SettingAreaInfo)
|
utils.LoadConfig("./file/area.json", &config.MemoryForAreaInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
|
Reference in New Issue
Block a user