feat:完善项目信息
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user