|
@@ -2,7 +2,6 @@ package help_doc
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
- "fmt"
|
|
|
"hongze/hz_crm_api/controllers"
|
|
|
"hongze/hz_crm_api/models"
|
|
|
"hongze/hz_crm_api/models/help_doc"
|
|
@@ -44,12 +43,16 @@ func (this *HelpDocController) Add() {
|
|
|
br.Msg = "请输入内容"
|
|
|
return
|
|
|
}
|
|
|
- anchor,err := json.Marshal(req.AnchorData)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "参数解析异常!"
|
|
|
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
- return
|
|
|
+ var anchor []byte
|
|
|
+ if req.AnchorData != nil{
|
|
|
+ anchor,err = json.Marshal(req.AnchorData)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
item := new(help_doc.HelpDoc)
|
|
|
item.ClassifyId = req.ClassifyId
|
|
|
item.Title = req.Title
|
|
@@ -80,7 +83,7 @@ func (this *HelpDocController) Add() {
|
|
|
br.Success = true
|
|
|
|
|
|
}
|
|
|
-//
|
|
|
+
|
|
|
//// @Title 编辑报告接口
|
|
|
//// @Description 编辑报告
|
|
|
//// @Param request body models.EditEnglishReportReq true "type json string"
|
|
@@ -160,7 +163,7 @@ func (this *HelpDocController) Add() {
|
|
|
// br.Msg = "保存成功"
|
|
|
// br.Data = resp
|
|
|
//}
|
|
|
-//
|
|
|
+
|
|
|
|
|
|
|
|
|
// @Title 获取报告详情接口
|
|
@@ -195,13 +198,15 @@ func (this *HelpDocController) Detail() {
|
|
|
item.Content = html.UnescapeString(item.Content)
|
|
|
|
|
|
var anchor []help_doc.AnchorList
|
|
|
- err = json.Unmarshal([]byte(item.Anchor),&anchor)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "解析失败"
|
|
|
- br.ErrMsg = "解析失败,Err:" + err.Error()
|
|
|
- return
|
|
|
+ if item.Anchor != "" {
|
|
|
+ err = json.Unmarshal([]byte(item.Anchor),&anchor)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "解析失败"
|
|
|
+ br.ErrMsg = "解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
-fmt.Println("anchor",anchor)
|
|
|
+
|
|
|
resp := help_doc.HelpDocResp{
|
|
|
Id: item.Id,
|
|
|
ClassifyId: item.ClassifyId,
|