feat:完善项目信息

This commit is contained in:
henry
2022-01-13 16:50:38 +08:00
parent 0494bbf5d0
commit 4637a5fb4b
10 changed files with 326 additions and 37 deletions

View File

@ -4,7 +4,6 @@ import (
config2 "SciencesServer/app/basic/config"
"SciencesServer/config"
"SciencesServer/utils"
"encoding/json"
"strings"
"time"
)
@ -46,19 +45,13 @@ type Images struct {
}
// AnalysisSlice Slice解析
func (m *Images) AnalysisSlice(domain string) []string {
images := make([]string, 0)
utils.FromJSON(m.Images, &images)
func (m *Images) AnalysisSlice(domain string) string {
images := strings.Split(m.Images, ",")
for k, v := range images {
images[k] = domain + v
}
return images
}
func (m *Images) SetImagesAttribute(value []string) {
_bytes, _ := json.Marshal(value)
m.Images = string(_bytes)
return strings.Join(images, ",")
}
type Local struct {

View File

@ -0,0 +1,30 @@
package model
// SysAgreement 协议数据模型
type SysAgreement struct {
Model
ModelTenant
Title string `gorm:"column:title;type:varchar(50);default:'';comment:协议名称" json:"title"`
Content string `gorm:"column:content;type:varchar(255);default:'';comment:协议内容" json:"content"`
Status SysAgreementStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
ModelDeleted
ModelAt
}
// SysAgreementStatus 协议数据状态
type SysAgreementStatus int
const (
// SysAgreementStatusForShow 显示
SysAgreementStatusForShow SysAgreementStatus = iota + 1
// SysAgreementStatusForHidden 隐藏
SysAgreementStatusForHidden
)
func (m *SysAgreement) TableName() string {
return "sys_agreement"
}
func NewSysAgreement() *SysAgreement {
return &SysAgreement{}
}