feat:完善项目信息

This commit is contained in:
henry
2022-01-19 16:13:40 +08:00
parent 6adf1381d0
commit 94106773f5
3 changed files with 19 additions and 4 deletions

View File

@ -59,6 +59,7 @@ func (c *Research) Launch(params *BasicParams, other *config.IdentityForResearch
mManageResearch.SetIndustryAttribute(params.Industrys) mManageResearch.SetIndustryAttribute(params.Industrys)
mManageResearch.SetKeywordAttribute(params.Keywords) mManageResearch.SetKeywordAttribute(params.Keywords)
mManageResearch.SetResearchAttribute(other.Researchs) mManageResearch.SetResearchAttribute(other.Researchs)
mManageResearch.License = other.FilterLicense()
mManageResearch.Introduce = params.Introduce mManageResearch.Introduce = params.Introduce
return orm.GetDB().Transaction(func(tx *gorm.DB) error { return orm.GetDB().Transaction(func(tx *gorm.DB) error {

View File

@ -1,6 +1,10 @@
package config package config
import "SciencesServer/utils" import (
"SciencesServer/config"
"SciencesServer/utils"
"strings"
)
// Area 区域 // Area 区域
type Area struct { type Area struct {
@ -33,9 +37,10 @@ type (
} }
// IdentityForResearch 研究机构 // IdentityForResearch 研究机构
IdentityForResearch struct { IdentityForResearch struct {
Longitude float64 `json:"longitude" form:"longitude"` // 经度 Longitude float64 `json:"longitude" form:"longitude"` // 经度
Latitude float64 `json:"latitude" form:"latitude"` // 纬度 Latitude float64 `json:"latitude" form:"latitude"` // 纬度
Researchs []string `json:"researchs" form:"researchs"` // 研究方向 License string `json:"license" form:"license" binding:"required"` // 营业执照
Researchs []string `json:"researchs" form:"researchs"` // 研究方向
} }
// IdentityForLaboratory 实验室 // IdentityForLaboratory 实验室
IdentityForLaboratory struct { IdentityForLaboratory struct {
@ -63,6 +68,10 @@ type (
} }
) )
func (this *IdentityForCompany) FilterLicense() string {
return strings.Replace(this.License, config.SystemConfig[config.SysImageDomain], "", -1)
}
func (this *IdentityForExpert) ConvertResearch() uint64 { func (this *IdentityForExpert) ConvertResearch() uint64 {
if this.ResearchID == "" { if this.ResearchID == "" {
return 0 return 0
@ -77,6 +86,10 @@ func (this *IdentityForExpert) ConvertLaboratory() uint64 {
return uint64(utils.HASHIDDecode(this.LaboratoryID)) return uint64(utils.HASHIDDecode(this.LaboratoryID))
} }
func (this *IdentityForResearch) FilterLicense() string {
return strings.Replace(this.License, config.SystemConfig[config.SysImageDomain], "", -1)
}
func (this *IdentityForLaboratory) ConvertResearch() uint64 { func (this *IdentityForLaboratory) ConvertResearch() uint64 {
if this.ResearchID == "" { if this.ResearchID == "" {
return 0 return 0

View File

@ -15,6 +15,7 @@ type ManageResearch struct {
Position string `gorm:"column:position;type:varchar(50);default:'';comment:坐标" json:"-"` Position string `gorm:"column:position;type:varchar(50);default:'';comment:坐标" json:"-"`
Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"` Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"`
Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"keyword"` Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"keyword"`
License string `gorm:"column:license;type:varchar(255);default:'';comment:营业执照" json:"license"`
Research string `gorm:"column:research;type:varchar(255);default:'';comment:研究信息" json:"research"` Research string `gorm:"column:research;type:varchar(255);default:'';comment:研究信息" json:"research"`
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"` Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
Examine Examine