2023-06-24 12:39:55 +00:00
|
|
|
// SiYuan - Refactor your thinking
|
2022-05-26 07:18:53 +00:00
|
|
|
// Copyright (c) 2020-present, b3log.org
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
2024-01-01 08:48:52 +00:00
|
|
|
"fmt"
|
2022-05-26 07:18:53 +00:00
|
|
|
"net/http"
|
2024-03-25 01:23:43 +00:00
|
|
|
"os"
|
2022-05-26 07:18:53 +00:00
|
|
|
"path/filepath"
|
|
|
|
|
"strings"
|
|
|
|
|
|
2024-04-24 11:51:15 +00:00
|
|
|
"github.com/88250/go-humanize"
|
2022-05-26 07:18:53 +00:00
|
|
|
"github.com/88250/gulu"
|
2024-03-25 01:23:43 +00:00
|
|
|
"github.com/djherbis/times"
|
2022-05-26 07:18:53 +00:00
|
|
|
"github.com/gin-gonic/gin"
|
2022-09-29 13:52:01 +00:00
|
|
|
"github.com/siyuan-note/filelock"
|
2022-05-26 07:18:53 +00:00
|
|
|
"github.com/siyuan-note/siyuan/kernel/model"
|
2024-09-12 14:59:22 +00:00
|
|
|
"github.com/siyuan-note/siyuan/kernel/sql"
|
2022-05-26 07:18:53 +00:00
|
|
|
"github.com/siyuan-note/siyuan/kernel/util"
|
|
|
|
|
)
|
|
|
|
|
|
2024-03-25 01:23:43 +00:00
|
|
|
func statAsset(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
path := arg["path"].(string)
|
2024-03-25 03:30:43 +00:00
|
|
|
var p string
|
|
|
|
|
if strings.HasPrefix(path, "assets/") {
|
|
|
|
|
var err error
|
|
|
|
|
p, err = model.GetAssetAbsPath(path)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2024-03-25 03:30:43 +00:00
|
|
|
ret.Code = 1
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if strings.HasPrefix(path, "file://") {
|
|
|
|
|
p = strings.TrimPrefix(path, "file://")
|
2024-07-04 15:11:56 +00:00
|
|
|
if strings.Contains(p, ":") {
|
|
|
|
|
p = strings.TrimPrefix(p, "/")
|
|
|
|
|
}
|
2024-12-24 08:33:24 +00:00
|
|
|
if strings.Contains(p, "?") {
|
|
|
|
|
p = p[:strings.Index(p, "?")]
|
|
|
|
|
}
|
2024-03-25 03:30:43 +00:00
|
|
|
} else {
|
|
|
|
|
ret.Code = 1
|
2024-03-25 01:23:43 +00:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info, err := os.Stat(p)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2024-03-25 03:30:43 +00:00
|
|
|
ret.Code = 1
|
2024-03-25 01:23:43 +00:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t, err := times.Stat(p)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2024-03-25 03:30:43 +00:00
|
|
|
ret.Code = 1
|
2024-03-25 01:23:43 +00:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-31 01:08:20 +00:00
|
|
|
updated := t.ModTime().UnixMilli()
|
|
|
|
|
hUpdated := t.ModTime().Format("2006-01-02 15:04:05")
|
|
|
|
|
created := updated
|
|
|
|
|
hCreated := hUpdated
|
|
|
|
|
// Check birthtime before use
|
|
|
|
|
if t.HasBirthTime() {
|
|
|
|
|
created = t.BirthTime().UnixMilli()
|
|
|
|
|
hCreated = t.BirthTime().Format("2006-01-02 15:04:05")
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-25 01:23:43 +00:00
|
|
|
ret.Data = map[string]interface{}{
|
2024-03-25 01:27:51 +00:00
|
|
|
"size": info.Size(),
|
2024-12-06 01:35:11 +00:00
|
|
|
"hSize": humanize.IBytesCustomCeil(uint64(info.Size()), 2),
|
2024-03-31 01:08:20 +00:00
|
|
|
"created": created,
|
|
|
|
|
"hCreated": hCreated,
|
|
|
|
|
"updated": updated,
|
|
|
|
|
"hUpdated": hUpdated,
|
2024-03-25 01:23:43 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-12 03:39:36 +00:00
|
|
|
func fullReindexAssetContent(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
model.ReindexAssetContent()
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-14 07:22:15 +00:00
|
|
|
func getImageOCRText(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 15:28:08 +00:00
|
|
|
var path string
|
|
|
|
|
if nil == arg["path"] {
|
|
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"text": "",
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
path = arg["path"].(string)
|
|
|
|
|
}
|
2023-04-14 07:22:15 +00:00
|
|
|
|
|
|
|
|
ret.Data = map[string]interface{}{
|
2024-06-15 09:51:48 +00:00
|
|
|
"text": util.GetAssetText(path),
|
2023-04-14 07:22:15 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func setImageOCRText(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
path := arg["path"].(string)
|
|
|
|
|
text := arg["text"].(string)
|
|
|
|
|
util.SetAssetText(path, text)
|
2024-09-12 14:59:22 +00:00
|
|
|
|
|
|
|
|
// 刷新 OCR 结果到数据库
|
|
|
|
|
util.NodeOCRQueueLock.Lock()
|
|
|
|
|
defer util.NodeOCRQueueLock.Unlock()
|
|
|
|
|
for _, id := range util.NodeOCRQueue {
|
|
|
|
|
sql.IndexNodeQueue(id)
|
|
|
|
|
}
|
|
|
|
|
util.NodeOCRQueue = nil
|
2023-04-14 07:22:15 +00:00
|
|
|
}
|
|
|
|
|
|
2024-06-15 09:51:48 +00:00
|
|
|
func ocr(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
path := arg["path"].(string)
|
|
|
|
|
|
2025-07-25 11:34:35 +00:00
|
|
|
ocrJSON, err := util.OcrAsset(path)
|
|
|
|
|
if nil != err {
|
|
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
ret.Data = map[string]interface{}{"closeTimeout": 7000}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-15 09:51:48 +00:00
|
|
|
ret.Data = map[string]interface{}{
|
2024-06-16 14:55:22 +00:00
|
|
|
"text": util.GetOcrJsonText(ocrJSON),
|
|
|
|
|
"ocrJSON": ocrJSON,
|
2024-06-15 09:51:48 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-15 02:38:01 +00:00
|
|
|
func renameAsset(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-15 02:52:02 +00:00
|
|
|
oldPath := arg["oldPath"].(string)
|
2022-07-15 02:38:01 +00:00
|
|
|
newName := arg["newName"].(string)
|
2024-07-06 01:51:54 +00:00
|
|
|
newPath, err := model.RenameAsset(oldPath, newName)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-07-15 03:15:02 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
|
|
|
|
return
|
|
|
|
|
}
|
2024-07-06 01:51:54 +00:00
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"newPath": newPath,
|
|
|
|
|
}
|
2022-07-15 02:38:01 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-26 07:18:53 +00:00
|
|
|
func getDocImageAssets(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
id := arg["id"].(string)
|
|
|
|
|
assets, err := model.DocImageAssets(id)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ret.Data = assets
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-30 07:06:57 +00:00
|
|
|
func getDocAssets(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
id := arg["id"].(string)
|
|
|
|
|
assets, err := model.DocAssets(id)
|
|
|
|
|
if err != nil {
|
|
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ret.Data = assets
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-26 07:18:53 +00:00
|
|
|
func setFileAnnotation(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p := arg["path"].(string)
|
|
|
|
|
p = strings.ReplaceAll(p, "%23", "#")
|
|
|
|
|
data := arg["data"].(string)
|
|
|
|
|
writePath, err := resolveFileAnnotationAbsPath(p)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
return
|
|
|
|
|
}
|
2024-09-04 01:40:50 +00:00
|
|
|
if err := filelock.WriteFile(writePath, []byte(data)); err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
return
|
|
|
|
|
}
|
2025-03-10 08:36:42 +00:00
|
|
|
|
2022-07-14 13:50:46 +00:00
|
|
|
model.IncSync()
|
2022-05-26 07:18:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getFileAnnotation(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p := arg["path"].(string)
|
|
|
|
|
p = strings.ReplaceAll(p, "%23", "#")
|
|
|
|
|
readPath, err := resolveFileAnnotationAbsPath(p)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
|
|
|
|
return
|
|
|
|
|
}
|
2023-11-06 14:13:04 +00:00
|
|
|
if !filelock.IsExist(readPath) {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = 1
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-06 14:13:04 +00:00
|
|
|
data, err := filelock.ReadFile(readPath)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"data": string(data),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func resolveFileAnnotationAbsPath(assetRelPath string) (ret string, err error) {
|
|
|
|
|
filePath := strings.TrimSuffix(assetRelPath, ".sya")
|
|
|
|
|
absPath, err := model.GetAssetAbsPath(filePath)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
dir := filepath.Dir(absPath)
|
|
|
|
|
base := filepath.Base(assetRelPath)
|
|
|
|
|
ret = filepath.Join(dir, base)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func removeUnusedAsset(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p := arg["path"].(string)
|
|
|
|
|
asset := model.RemoveUnusedAsset(p)
|
|
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"path": asset,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func removeUnusedAssets(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
paths := model.RemoveUnusedAssets()
|
|
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"paths": paths,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getUnusedAssets(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
unusedAssets := model.UnusedAssets()
|
2024-11-08 03:08:11 +00:00
|
|
|
total := len(unusedAssets)
|
2024-11-07 09:03:33 +00:00
|
|
|
|
2024-11-07 09:46:32 +00:00
|
|
|
// List only 512 unreferenced assets https://github.com/siyuan-note/siyuan/issues/13075
|
2024-11-08 03:08:11 +00:00
|
|
|
const maxUnusedAssets = 512
|
|
|
|
|
if total > maxUnusedAssets {
|
|
|
|
|
unusedAssets = unusedAssets[:maxUnusedAssets]
|
|
|
|
|
util.PushMsg(fmt.Sprintf(model.Conf.Language(251), total, maxUnusedAssets), 5000)
|
2024-11-07 09:03:33 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"unusedAssets": unusedAssets,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-04 02:30:19 +00:00
|
|
|
func getMissingAssets(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
missingAssets := model.MissingAssets()
|
|
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"missingAssets": missingAssets,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-26 07:18:53 +00:00
|
|
|
func resolveAssetPath(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
path := arg["path"].(string)
|
|
|
|
|
p, err := model.GetAssetAbsPath(path)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
ret.Data = map[string]interface{}{"closeTimeout": 3000}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ret.Data = p
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func uploadCloud(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-07 03:09:07 +00:00
|
|
|
id := arg["id"].(string)
|
|
|
|
|
count, err := model.UploadAssets2Cloud(id)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
ret.Data = map[string]interface{}{"closeTimeout": 3000}
|
2024-01-01 08:48:52 +00:00
|
|
|
return
|
2022-05-26 07:18:53 +00:00
|
|
|
}
|
2024-01-01 08:48:52 +00:00
|
|
|
|
|
|
|
|
util.PushMsg(fmt.Sprintf(model.Conf.Language(41), count), 3000)
|
2022-05-26 07:18:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func insertLocalAssets(c *gin.Context) {
|
|
|
|
|
ret := gulu.Ret.NewResult()
|
|
|
|
|
defer c.JSON(http.StatusOK, ret)
|
|
|
|
|
|
|
|
|
|
arg, ok := util.JsonArg(c, ret)
|
|
|
|
|
if !ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
assetPathsArg := arg["assetPaths"].([]interface{})
|
|
|
|
|
var assetPaths []string
|
|
|
|
|
for _, pathArg := range assetPathsArg {
|
|
|
|
|
assetPaths = append(assetPaths, pathArg.(string))
|
|
|
|
|
}
|
2022-09-27 06:45:24 +00:00
|
|
|
isUpload := true
|
|
|
|
|
isUploadArg := arg["isUpload"]
|
|
|
|
|
if nil != isUploadArg {
|
|
|
|
|
isUpload = isUploadArg.(bool)
|
|
|
|
|
}
|
2022-05-26 07:18:53 +00:00
|
|
|
id := arg["id"].(string)
|
2022-09-27 06:45:24 +00:00
|
|
|
succMap, err := model.InsertLocalAssets(id, assetPaths, isUpload)
|
2024-09-04 01:40:50 +00:00
|
|
|
if err != nil {
|
2022-05-26 07:18:53 +00:00
|
|
|
ret.Code = -1
|
|
|
|
|
ret.Msg = err.Error()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ret.Data = map[string]interface{}{
|
|
|
|
|
"succMap": succMap,
|
|
|
|
|
}
|
|
|
|
|
}
|