feat:完善项目信息
This commit is contained in:
@ -30,16 +30,17 @@ type (
|
||||
}
|
||||
// InnovateParams 服务参数信息
|
||||
InnovateParams struct {
|
||||
ID, KindID uint64
|
||||
Title, Content string
|
||||
Tags []string
|
||||
Sort int
|
||||
ID, TenantID, KindID uint64
|
||||
Title, Content string
|
||||
Tags []string
|
||||
Sort int
|
||||
}
|
||||
// InnovateKindInfo 服务分类信息
|
||||
InnovateKindInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model.ServiceInnovateKindInfo
|
||||
Area string `json:"area"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
Area string `json:"area"`
|
||||
}
|
||||
// InnovateKindSelectInfo 服务分类筛选信息
|
||||
InnovateKindSelectInfo struct {
|
||||
@ -48,9 +49,9 @@ type (
|
||||
}
|
||||
// InnovateKindParams 服务分类参数信息
|
||||
InnovateKindParams struct {
|
||||
ID uint64
|
||||
Title string
|
||||
Sort int
|
||||
ID, TenantID uint64
|
||||
Title string
|
||||
Sort int
|
||||
}
|
||||
)
|
||||
|
||||
@ -134,9 +135,16 @@ func (c *Innovate) Form(params *InnovateParams) error {
|
||||
mServiceInnovate.Sort = params.Sort
|
||||
|
||||
if mServiceInnovate.ID > 0 {
|
||||
if c.TenantID <= 0 {
|
||||
mServiceInnovate.TenantID = params.TenantID
|
||||
}
|
||||
return model2.Updates(mServiceInnovate.ServiceInnovate, mServiceInnovate.ServiceInnovate)
|
||||
}
|
||||
mServiceInnovate.TenantID = c.TenantID
|
||||
mServiceInnovate.TenantID = params.TenantID
|
||||
|
||||
if c.TenantID > 0 {
|
||||
mServiceInnovate.TenantID = c.TenantID
|
||||
}
|
||||
return model2.Create(mServiceInnovate.ServiceInnovate)
|
||||
}
|
||||
|
||||
@ -185,7 +193,7 @@ func (c *Innovate) Kind(tenantID uint64, title string, page, pageSize int) (*con
|
||||
|
||||
for _, v := range out {
|
||||
list = append(list, &InnovateKindInfo{
|
||||
ID: v.GetEncodeID(), ServiceInnovateKindInfo: v, Area: v.FormatBasic(),
|
||||
ID: v.GetEncodeID(), TenantID: v.GetEncodeTenantID(), ServiceInnovateKindInfo: v, Area: v.FormatBasic(),
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
@ -242,9 +250,16 @@ func (c *Innovate) KindForm(params *InnovateKindParams) error {
|
||||
mServiceInnovateKind.Sort = params.Sort
|
||||
|
||||
if mServiceInnovateKind.ID > 0 {
|
||||
if c.TenantID <= 0 {
|
||||
mServiceInnovateKind.TenantID = params.TenantID
|
||||
}
|
||||
return model2.Updates(mServiceInnovateKind.ServiceInnovateKind, mServiceInnovateKind.ServiceInnovateKind)
|
||||
}
|
||||
mServiceInnovateKind.TenantID = c.TenantID
|
||||
mServiceInnovateKind.TenantID = params.TenantID
|
||||
|
||||
if c.TenantID > 0 {
|
||||
mServiceInnovateKind.TenantID = c.TenantID
|
||||
}
|
||||
return model2.Create(mServiceInnovateKind.ServiceInnovateKind)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user