@ -465,25 +465,30 @@ public class PlatformController {
} )
} )
@DeleteMapping ( "/catalog/del" )
@DeleteMapping ( "/catalog/del" )
@ResponseBody
@ResponseBody
public ResponseEntity < WVPResult < List < PlatformCatalog > > > delCatalog ( String id ) {
public ResponseEntity < WVPResult < String > > delCatalog ( String id , String platformI d ) {
if ( logger . isDebugEnabled ( ) ) {
if ( logger . isDebugEnabled ( ) ) {
logger . debug ( "删除目录,{}" , id ) ;
logger . debug ( "删除目录,{}" , id ) ;
}
}
// 如果删除的是默认目录则根目录设置为默认目录
WVPResult < String > result = new WVPResult < > ( ) ;
PlatformCatalog catalog = storager . getCatalog ( id ) ;
if ( catalog ! = null ) {
if ( StringUtils . isEmpty ( id ) | | StringUtils . isEmpty ( platformId ) ) {
ParentPlatform parentPlatform = storager . queryParentPlatByServerGBId ( catalog . getPlatformId ( ) ) ;
result . setCode ( - 1 ) ;
if ( parentPlatform ! = null ) {
result . setMsg ( "param error" ) ;
if ( id . equals ( parentPlatform . getCatalogId ( ) ) ) {
return new ResponseEntity < > ( result , HttpStatus . BAD_REQUEST ) ;
storager . setDefaultCatalog ( parentPlatform . getServerGBId ( ) , parentPlatform . getServerGBId ( ) ) ;
}
}
}
}
result . setCode ( 0 ) ;
int delResult = storager . delCatalog ( id ) ;
int delResult = storager . delCatalog ( id ) ;
WVPResult < List < PlatformCatalog > > result = new WVPResult < > ( ) ;
// 如果删除的是默认目录则根目录设置为默认目录
result . setCode ( 0 ) ;
PlatformCatalog parentPlatform = storager . queryDefaultCatalogInPlatform ( platformId ) ;
// 默认节点被移除
if ( parentPlatform = = null ) {
storager . setDefaultCatalog ( platformId , platformId ) ;
result . setData ( platformId ) ;
}
if ( delResult > 0 ) {
if ( delResult > 0 ) {
result . setMsg ( "success" ) ;
result . setMsg ( "success" ) ;