|
@@ -115,7 +115,20 @@ func (this *YanxuanSpecialController) Detail() {
|
|
item.IsCollect = 1
|
|
item.IsCollect = 1
|
|
}
|
|
}
|
|
|
|
|
|
- br.Data = item
|
|
|
|
|
|
+ var resp models.CygxYanxuanSpecialResp
|
|
|
|
+ resp.CygxYanxuanSpecialItem = *item
|
|
|
|
+ if item.DocUrl != "" {
|
|
|
|
+ var docs []models.Doc
|
|
|
|
+ err := json.Unmarshal([]byte(item.DocUrl), &docs)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ resp.Docs = docs
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ br.Data = resp
|
|
br.Ret = 200
|
|
br.Ret = 200
|
|
br.Success = true
|
|
br.Success = true
|
|
br.Msg = "获取成功"
|
|
br.Msg = "获取成功"
|
|
@@ -847,13 +860,13 @@ func (this *YanxuanSpecialController) AuthorHeadImg() {
|
|
br.Msg = "保存成功"
|
|
br.Msg = "保存成功"
|
|
}
|
|
}
|
|
|
|
|
|
-// ResourceUpload 上传文件
|
|
|
|
-// @Title 上传文件
|
|
|
|
-// @Description 上传文件
|
|
|
|
-// @Param MenuId query int true "目录ID"
|
|
|
|
-// @Param File query file true "文件"
|
|
|
|
-// @Success 200 Ret=200 操作成功
|
|
|
|
-// @router /doc/upload [post]
|
|
|
|
|
|
+//ResourceUpload 上传文件
|
|
|
|
+//@Title 上传文件
|
|
|
|
+//@Description 上传文件
|
|
|
|
+//@Param MenuId query int true "目录ID"
|
|
|
|
+//@Param File query file true "文件"
|
|
|
|
+//@Success 200 Ret=200 操作成功
|
|
|
|
+//@router /doc/upload [post]
|
|
//func (this *YanxuanSpecialController) ResourceUpload() {
|
|
//func (this *YanxuanSpecialController) ResourceUpload() {
|
|
// br := new(models.BaseResponse).Init()
|
|
// br := new(models.BaseResponse).Init()
|
|
// defer func() {
|
|
// defer func() {
|
|
@@ -884,21 +897,6 @@ func (this *YanxuanSpecialController) AuthorHeadImg() {
|
|
// fileName := originName[:extIndex]
|
|
// fileName := originName[:extIndex]
|
|
// ext := path.Ext(h.Filename)
|
|
// ext := path.Ext(h.Filename)
|
|
//
|
|
//
|
|
-// // 重名校验
|
|
|
|
-// existItem := new(models.CloudDiskResource)
|
|
|
|
-// existCond := ` AND resource_name = ? AND menu_id = ? `
|
|
|
|
-// existPars := make([]interface{}, 0)
|
|
|
|
-// existPars = append(existPars, fileName, menuId)
|
|
|
|
-// if e := existItem.GetItemByCondition(existCond, existPars); e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
|
-// br.Msg = "操作失败"
|
|
|
|
-// br.ErrMsg = "获取重名文件失败, Err: " + e.Error()
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-// if existItem != nil && existItem.MenuId > 0 {
|
|
|
|
-// br.Msg = fmt.Sprintf("文件名%s已存在", fileName)
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
// uploadDir := utils.STATIC_DIR + "hongze/" + time.Now().Format("20060102")
|
|
// uploadDir := utils.STATIC_DIR + "hongze/" + time.Now().Format("20060102")
|
|
// if e = os.MkdirAll(uploadDir, 766); e != nil {
|
|
// if e = os.MkdirAll(uploadDir, 766); e != nil {
|
|
// br.Msg = "存储目录创建失败"
|
|
// br.Msg = "存储目录创建失败"
|