com.kasinf.framework.rest.web.controller.BaseTreeController Maven / Gradle / Ivy
package com.kasinf.framework.rest.web.controller;
import com.kasinf.framework.rest.annotation.SearchableDefaults;
import com.kasinf.framework.rest.eneity.AbstractEntity;
import com.kasinf.framework.rest.eneity.projection.TreeProjection;
import com.kasinf.framework.rest.eneity.type.TreeEntity;
import com.kasinf.framework.rest.support.Searchable;
import com.kasinf.framework.core.response.BaseResponse;
import com.kasinf.framework.core.response.HttpCode;
import com.kasinf.framework.rest.web.service.BaseTreeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.io.Serializable;
/**
* @param
* @param
* @author lkhsh
*/
public class BaseTreeController extends BaseCrudController {
protected BaseTreeService getBaseTreeService() {
return (BaseTreeService) baseService;
}
@Override
public BaseResponse batchDelete(@PathVariable ID[] ids) {
return msg(HttpCode.BAD_REQUEST, "不支持批量删除");
}
@GetMapping("tree")
@SearchableDefaults(projection = TreeProjection.class)
public BaseResponse getTree(Searchable searchable) {
return setSuccess(searchable, getBaseService().findAllWithSort(searchable));
}
}