feat:完善项目信息

This commit is contained in:
henry
2022-01-11 14:54:20 +08:00
parent 8006d57506
commit 72c2cb091d
15 changed files with 299 additions and 38 deletions

View File

@ -80,6 +80,13 @@ func (m *Model) GetEncodeID() string {
return utils.HASHIDEncode(int(m.ID))
}
func (m *ModelTenant) GetEncodeTenantID() string {
if m.TenantID <= 0 {
return ""
}
return utils.HASHIDEncode(int(m.TenantID))
}
func (m *Model) SetDatabase(database string, key ...string) {
m.Database = database + "_" + strings.Join(key, "_")
}

View File

@ -3,12 +3,13 @@ package model
// ServiceMessage 留言数据模型
type ServiceMessage struct {
Model
Name string `gorm:"column:name;type:varchar(20);default:'';comment:联系人" json:"name"`
Mobile string `gorm:"column:mobile;type:varchar(15);default:'';comment:联系方式" json:"mobile"`
Email string `gorm:"column:email;type:varchar(50);default:'';comment:邮箱" json:"email"`
Company string `gorm:"column:company;type:varchar(100);default:'';comment:公司名称" json:"company"`
Content string `gorm:"column:content;type:varchar(255);default:'';comment:联系内容" json:"content"`
Status int `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
ModelTenant
Name string `gorm:"column:name;type:varchar(20);default:'';comment:联系" json:"name"`
Mobile string `gorm:"column:mobile;type:varchar(15);default:'';comment:联系方式" json:"mobile"`
Email string `gorm:"column:email;type:varchar(50);default:'';comment:邮箱" json:"email"`
Company string `gorm:"column:company;type:varchar(100);default:'';comment:公司名称" json:"company"`
Content string `gorm:"column:content;type:varchar(255);default:'';comment:联系内容" json:"content"`
Status ServiceMessageStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
ModelDeleted
ModelAt
}
@ -18,7 +19,7 @@ type ServiceMessageStatus int
const (
// ServiceMessageStatusForProcessing 处理中
ServiceMessageStatusForProcessing ServiceMessageStatus = iota
ServiceMessageStatusForProcessing ServiceMessageStatus = iota + 1
// ServiceMessageStatusForProcessed 已处理
ServiceMessageStatusForProcessed
)

View File

@ -0,0 +1,19 @@
package model
// ServiceMessageLog 留言数据日志模型
type ServiceMessageLog struct {
Model
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户ID" json:"-"`
MessageID uint64 `gorm:"column:message_id;type:int(11);default:0;comment:信息ID" json:"-"`
Content string `gorm:"column:content;type:varchar(255);default:'';comment:内容信息" json:"-"`
ModelDeleted
ModelAt
}
func (m *ServiceMessageLog) TableName() string {
return "service_message_log"
}
func NewServiceMessageLog() *ServiceMessageLog {
return &ServiceMessageLog{}
}

View File

@ -34,11 +34,11 @@ func (m *ServiceSolutionCaseKind) ModeTitle() string {
if m.Mode == ServiceSolutionCaseModeForSmallCompany {
return "中小型企业"
} else if m.Mode == ServiceSolutionCaseModeForBigCompany {
return "中小型企业"
return "型企业"
} else if m.Mode == ServiceSolutionCaseModeForGovernment {
return "政府单位"
} else if m.Mode == ServiceSolutionCaseModeForResearch {
return "科研机构"
}
return ""
}