feat:完善网站活动报名信息

This commit is contained in:
henry
2021-12-16 15:35:44 +08:00
parent 8d82caac20
commit c6ba000829
8 changed files with 32 additions and 16 deletions

View File

@ -72,7 +72,7 @@ func (c *Config) Area(key string) map[string]string {
if key == "" {
key = config2.DefaultChinaAreaCode
}
return config2.SettingAreaInfo[key]
return config.MemoryForAreaInfo[key]
}
func NewConfig() *Config {

View File

@ -8,7 +8,7 @@ type Config struct{ *service.Session }
type ConfigHandle func(session *service.Session) *Config
func (c *Config) Platform() {
func (c *Config) Basic() {
}

View File

@ -2,6 +2,7 @@ package controller
import (
"SciencesServer/app/api/website/model"
config2 "SciencesServer/app/basic/config"
model2 "SciencesServer/app/common/model"
"SciencesServer/app/service"
"SciencesServer/config"
@ -82,7 +83,7 @@ func (c *Index) distribution(src []*model.DataAreaDistributionInfo) map[string]*
if !has {
out[v.Province] = &InstanceDistributionDetailInfo{
Code: v.Province,
Name: config.SettingAreaInfo[config.DefaultChinaAreaCode][v.Province],
Name: config2.MemoryForAreaInfo[config.DefaultChinaAreaCode][v.Province],
Industry: nil,
Count: 1,
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{
Code: v.City,
Count: 1,
Name: config.SettingAreaInfo[v.Province][v.City],
Name: config2.MemoryForAreaInfo[v.Province][v.City],
Industry: industrys,
}
continue

View File

@ -12,8 +12,12 @@ type (
)
var (
// MemoryForAreaInfo 区域信息
MemoryForAreaInfo map[string]map[string]string = make(map[string]map[string]string, 0)
// MemoryForIndustryInfo 行业信息
MemoryForIndustryInfo map[string]string = make(map[string]string, 0)
// MemoryForPlatformInfo 平台信息
MemoryForPlatformInfo map[string]string = make(map[string]string, 0)
)
// GetIndustryInfo 获取行业信息

View File

@ -123,10 +123,6 @@ func initModel() {
&synchronized{iModel: model.NewUserCompany()}, &synchronized{iModel: model.NewUserExpert()},
&synchronized{iModel: model.NewUserLaboratory()}, &synchronized{iModel: model.NewUserResearch()},
&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.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() {

View File

@ -1,6 +1,7 @@
package model
import (
config2 "SciencesServer/app/basic/config"
"SciencesServer/config"
"SciencesServer/utils"
"strings"
@ -130,13 +131,13 @@ type Area struct {
func (m *Area) FormatBasic() string {
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 != "" {
address = append(address, config.SettingAreaInfo[m.Province][m.City])
address = append(address, config2.MemoryForAreaInfo[m.Province][m.City])
}
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, "-")
}

View File

@ -1,9 +1,8 @@
package config
var (
SettingInfo = new(Setting)
RPCServerSettingInfo = new(RPCServerSetting)
SettingAreaInfo = make(map[string]map[string]string, 0)
SettingInfo = new(Setting)
//RPCServerSettingInfo = new(RPCServerSetting)
)
// Mysql 配置

View File

@ -1,7 +1,7 @@
package tools
import (
"SciencesServer/config"
"SciencesServer/app/basic/config"
"SciencesServer/tools/ip"
"SciencesServer/utils"
)
@ -11,7 +11,7 @@ func initIP() {
}
func initJSON() {
utils.LoadConfig("./file/area.json", &config.SettingAreaInfo)
utils.LoadConfig("./file/area.json", &config.MemoryForAreaInfo)
}
func Init() {