Quellcode durchsuchen

Merge branch 'master' of http://124.70.149.18:10880/sunsheng/3dshow-supplier

animeic vor 2 Jahren
Ursprung
Commit
fde39b8c31
2 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 1 0
      3dshow-supplier/api/asset.go
  2. 5 1
      3dshow-supplier/bus/tileResult.go

+ 1 - 0
3dshow-supplier/api/asset.go

@@ -51,6 +51,7 @@ func regAssetApi(r *GinRouter) {
 		},
 		JWT:           true,
 		SearchProject: []string{"name", "createTime", "thumbnail", "groups"},
+		DetailProject: []string{"name", "createTime", "thumbnail", "groups"},
 		OnUpdate: func(c *gin.Context, apictx *ApiSession, entity interface{}, id primitive.ObjectID) {
 			asset := entity.(*model.Asset360Fake3d)
 			if asset == nil {

+ 5 - 1
3dshow-supplier/bus/tileResult.go

@@ -7,6 +7,7 @@ import (
 	"3dshow-supplier/db/repo"
 	"context"
 	"fmt"
+	"path"
 	"strings"
 
 	"github.com/nats-io/nats.go"
@@ -73,7 +74,10 @@ func RepoTileConvResult(data *TileConvertorResult) error {
 	if asset.Groups != nil {
 		for _, g := range asset.Groups {
 			if g.Id == data.GroupId {
-
+				strs := strings.Split(data.TilePath, "apath=")
+				if len(strs) == 2 {
+					asset.Thumbnail = path.Join(strs[1], "00_00_cover.png")
+				}
 				g.Url = data.TilePath
 				g.State = model.GROUPSTATE_SUCC
 			}