|
|
|
|
|
package com.platform.controller;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import oracle.sql.DATE;
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
|
import com.base.BaseController;
|
|
|
import com.base.CustomException;
|
|
|
import com.platform.entities.GfsFolderEntity;
|
|
|
import com.platform.entities.VolumeEntity;
|
|
|
import com.platform.glusterfs.VolumeInfo;
|
|
|
import com.platform.service.IGfsService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* <一句话功能简述>
|
|
|
* <功能详细描述>
|
|
|
* @author chen
|
|
|
* @version [版本号,2016年9月8日]
|
|
|
* @see [相关类/方法]
|
|
|
* @since [产品/模块版本]
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping("")
|
|
|
public class FolderController extends BaseController {
|
|
|
|
|
|
@Resource(name = "gfsService")
|
|
|
private IGfsService gfsService;
|
|
|
|
|
|
@RequestMapping(value="/getAllSubPathByPath", method= RequestMethod.POST)
|
|
|
public Object getAllSubPathByPath(String path) throws Exception {
|
|
|
System.out.println(path);
|
|
|
Object result = null;
|
|
|
if (null != path && !"".equals(path)) {
|
|
|
System.out.println(path);
|
|
|
result = gfsService.getFolder(path);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
// /**
|
|
|
// * <一句话功能简述> 查询集群中所有的 volume 及其 信息
|
|
|
// * <功能详细描述>
|
|
|
// * @return
|
|
|
// * @throws Exception
|
|
|
// * @see [类、类#方法、类#成员]
|
|
|
// */
|
|
|
// @RequestMapping(value="/volume/list", method= RequestMethod.POST)
|
|
|
// public Object getVolums() throws Exception{
|
|
|
// System.out.println("----------------------------------");
|
|
|
// long a = new Date().getTime();
|
|
|
// List<VolumeEntity> result = gfsService.getAllVolumes();
|
|
|
// System.out.println("----------------------------------");
|
|
|
// System.out.println(new Date().getTime()-a);
|
|
|
// return result;
|
|
|
// }
|
|
|
//
|
|
|
/**
|
|
|
* <一句话功能简述> 查询集群中所有的 volume 及其 信息
|
|
|
* <功能详细描述>
|
|
|
* @param volumeName "/home/gfs_ftp_point" "/home/v1_point"
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
* @see [类、类#方法、类#成员]
|
|
|
*/
|
|
|
|
|
|
@RequestMapping(value="/volume/findByName", method= RequestMethod.POST)
|
|
|
public Object getVolumByName(String volumeName) throws Exception{
|
|
|
VolumeEntity result = gfsService.getOneVolume(volumeName);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
}
|