feat:完善项目信息

This commit is contained in:
henry
2022-01-12 15:05:14 +08:00
parent 0d49575e06
commit 4ec0953a29
33 changed files with 817 additions and 249 deletions

View File

@ -23,17 +23,18 @@ type (
}
// InnovateDetail 服务详细信息
InnovateDetail struct {
ID string `json:"id"`
ID string `json:"id"`
TenantID string `json:"tenant_id"`
*model2.ServiceInnovate
KindID string `json:"kind_id"`
Tags []string `json:"tags"`
}
// InnovateParams 服务参数信息
InnovateParams struct {
ID, TenantID, KindID uint64
Title, Content string
Tags []string
Sort int
ID, TenantID, KindID uint64
Title, Description, Content string
Tags []string
Sort int
}
// InnovateKindInfo 服务分类信息
InnovateKindInfo struct {
@ -71,7 +72,7 @@ func (c *Innovate) Instance(tenantID uint64, title string, kindID uint64, page,
where = append(where, model2.NewWhereLike("i.title", title))
}
if kindID > 0 {
where = append(where, model2.NewWhere("i.kind_id", kindID))
where = append(where, model2.NewWhere("k.id", kindID))
}
var count int64
@ -104,6 +105,7 @@ func (c *Innovate) Detail(id uint64) (*InnovateDetail, error) {
}
return &InnovateDetail{
ID: mServiceInnovate.GetEncodeID(),
TenantID: mServiceInnovate.GetEncodeTenantID(),
ServiceInnovate: mServiceInnovate.ServiceInnovate,
KindID: (&model2.Model{ID: mServiceInnovate.KindID}).GetEncodeID(),
Tags: mServiceInnovate.GetTagAttribute(),
@ -130,6 +132,7 @@ func (c *Innovate) Form(params *InnovateParams) error {
}
mServiceInnovate.KindID = params.KindID
mServiceInnovate.Title = params.Title
mServiceInnovate.Description = params.Description
mServiceInnovate.Content = params.Content
mServiceInnovate.SetTagAttribute(params.Tags)
mServiceInnovate.Sort = params.Sort

View File

@ -20,7 +20,8 @@ type MessageHandle func(session *session.Admin) *Message
type MessageInfo struct {
ID string `json:"id"`
*model.ServiceMessageInfo
Area string `json:"area"`
Area string `json:"area"`
AreaDomain string `json:"area_domain"`
}
// Instance 列表信息
@ -58,6 +59,7 @@ func (c *Message) Instance(tenantID uint64, name string, status int, content str
ID: v.GetEncodeID(),
ServiceMessageInfo: v,
Area: v.FormatBasic(),
AreaDomain: v.Domain,
})
}
return &controller.ReturnPages{Data: list, Count: count}, err
@ -91,7 +93,7 @@ func (c *Message) Handle(id uint64, content string) error {
mServiceMessageLog.MessageID = id
mServiceMessageLog.Content = content
if err = model2.Create(mServiceMessage.ServiceMessage, tx); err != nil {
if err = model2.Create(mServiceMessageLog.ServiceMessageLog, tx); err != nil {
return err
}
return nil

View File

@ -188,7 +188,7 @@ func (c *SolutionCase) Kind(tenantID uint64, mode int, title string, page, pageS
where = append(where, model2.NewWhere("k.tenant_id", tenantID))
}
if mode > 0 {
where = append(where, model2.NewWhere("k.kind_id", mode))
where = append(where, model2.NewWhere("k.mode", mode))
}
if title != "" {
where = append(where, model2.NewWhereLike("k.title", title))