Browse Source

文档格式

ziwen 1 year ago
parent
commit
91317e5004
2 changed files with 18 additions and 0 deletions
  1. 10 0
      controllers/cygx/yanxuan_special.go
  2. 8 0
      models/cygx/cygx_yanxuan_special.go

+ 10 - 0
controllers/cygx/yanxuan_special.go

@@ -202,6 +202,16 @@ func (this *YanxuanSpecialController) List() {
 		if hasImg{
 			v.ContentHasImg = 1
 		}
+		if v.DocUrl != "" {
+			var docs []cygx.Doc
+			err := json.Unmarshal([]byte(v.DocUrl), &docs)
+			if err != nil {
+				br.Msg = "参数解析异常!"
+				br.ErrMsg = "参数解析失败,Err:" + err.Error()
+				return
+			}
+			v.Docs = docs
+		}
 	}
 
 	br.Data = list

+ 8 - 0
models/cygx/cygx_yanxuan_special.go

@@ -44,6 +44,14 @@ type CygxYanxuanSpeciaResplItem struct {
 	Title         string // 标题
 	Type          int    // 类型1:笔记,2:观点
 	ContentHasImg int    //正文是否包含图片 1包含 0不包含
+	Docs          []Doc
+}
+
+type Doc struct {
+	DocName   string
+	DocSuffix string
+	DocUrl    string
+	DocIcon   string
 }
 
 func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpeciaResplItem, err error) {