feat:完善项目

This commit is contained in:
henry
2022-01-15 11:54:05 +08:00
parent 048d116b05
commit c5fb6023f3
18 changed files with 191 additions and 129 deletions

View File

@ -22,12 +22,13 @@ type SolutionCaseHandle func(session *session.Enterprise, tenantID uint64) *Solu
type (
// SolutionCaseInfo 基本信息
SolutionCaseInfo struct {
ID string `json:"id"`
MarkID uint64 `json:"-"`
Mode model2.ServiceSolutionCaseMode `json:"mode"`
Title string `json:"title"`
Image string `json:"image"`
Children []*SolutionCaseBasic `json:"children"`
ID string `json:"id"`
MarkID uint64 `json:"-"`
Mode model2.ServiceSolutionCaseMode `json:"mode"`
Title string `json:"title"`
Image string `json:"image"`
Description string `json:"description"`
Children []*SolutionCaseBasic `json:"children"`
}
// SolutionCaseBasic 基本信息
SolutionCaseBasic struct {
@ -46,9 +47,12 @@ type (
)
// Instance 服务解决方案案例
func (c *SolutionCase) Instance() ([]*SolutionCaseInfo, error) {
func (c *SolutionCase) Instance(mode int) ([]*SolutionCaseInfo, error) {
mServiceSolutionCase := model.NewServiceSolutionCase()
out, err := mServiceSolutionCase.SolutionCase(6)
where := []*model2.ModelWhere{model2.NewWhere("k.mode", mode)} //model2.NewWhere("k.tenant_id", c.tenantID),
out, err := mServiceSolutionCase.SolutionCase(6, where...)
if err != nil {
return nil, err
@ -73,8 +77,9 @@ func (c *SolutionCase) Instance() ([]*SolutionCaseInfo, error) {
if !isExist {
ret = append(ret, &SolutionCaseInfo{
ID: v.GetEncodeID(), MarkID: v.ID, Mode: v.Mode, Title: v.Title,
Image: v.Image.Analysis(config.SettingInfo.Domain),
Children: []*SolutionCaseBasic{detail},
Image: v.Image.Analysis(config.SettingInfo.Domain),
Description: v.Description,
Children: []*SolutionCaseBasic{detail},
})
}
}