|
@@ -68,6 +68,10 @@ func (this *HelpDocController) Add() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ var resp help_doc.HelpDocSaveResp
|
|
|
+ resp.HelpDocId = req.Id
|
|
|
+ resp.ModifyTime = time.Now().Format(utils.FormatDateTime)
|
|
|
+
|
|
|
item := new(help_doc.HelpDoc)
|
|
|
item.ClassifyId = req.ClassifyId
|
|
|
item.Title = req.Title
|
|
@@ -85,13 +89,16 @@ func (this *HelpDocController) Add() {
|
|
|
}
|
|
|
|
|
|
if req.Id == 0 {
|
|
|
- _, err = help_doc.AddHelpDoc(item)
|
|
|
- if err != nil {
|
|
|
+ id, e := help_doc.AddHelpDoc(item)
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
br.Msg = "新增失败"
|
|
|
br.ErrMsg = "保存失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- } else {
|
|
|
+ resp.HelpDocId = id
|
|
|
+ resp.ModifyTime = item.ModifyTime.Format(utils.FormatDateTime)
|
|
|
+ } else if req.IsChange {
|
|
|
err = help_doc.EditHelpDoc(item, req.Id)
|
|
|
if err != nil {
|
|
|
br.Msg = "保存失败"
|
|
@@ -107,7 +114,7 @@ func (this *HelpDocController) Add() {
|
|
|
}
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
-
|
|
|
+ br.Data = resp
|
|
|
}
|
|
|
|
|
|
// @Title 获取报告详情接口
|