|
|
|
@ -1,15 +1,12 @@
|
|
|
|
|
package com.dsideal.base.YunXiao.Controller;
|
|
|
|
|
|
|
|
|
|
import com.dsideal.base.Interceptor.IsLoginInterface;
|
|
|
|
|
import com.dsideal.base.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.base.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.base.Util.SqlInjectionUtils;
|
|
|
|
|
import com.dsideal.base.YunXiao.Model.YunXiaoModel;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.core.Controller;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import io.github.yedaxia.apidocs.ApiDoc;
|
|
|
|
@ -22,39 +19,28 @@ public class YunXiaoController extends Controller {
|
|
|
|
|
YunXiaoModel ym = new YunXiaoModel();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 可以维护的数据集名称
|
|
|
|
|
* 获取数据集树
|
|
|
|
|
*/
|
|
|
|
|
// http://10.10.21.20:9000/dsBase/yx/getDataSet
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@Before(GET.class)
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void getDataSet() {
|
|
|
|
|
List<Record> list = ym.getDataSet();
|
|
|
|
|
public void getDatasetTree() {
|
|
|
|
|
List<Record> list = ym.getDatasetTree();
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取数据集下的数据表
|
|
|
|
|
*
|
|
|
|
|
* @param id 数据集id
|
|
|
|
|
* @param pageNumber 第几页
|
|
|
|
|
* @param keyword 关键字
|
|
|
|
|
* @param pageSize 每页多少条数据
|
|
|
|
|
* @param datasetId 数据集id
|
|
|
|
|
* @param page 第几页
|
|
|
|
|
* @param limit 每页显示多少条数据
|
|
|
|
|
*/
|
|
|
|
|
@Before(GET.class)
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"id"})
|
|
|
|
|
public void getDataSetContent(int id, String keyword, int pageNumber, int pageSize) {
|
|
|
|
|
if (StrKit.isBlank(keyword)) keyword = "";
|
|
|
|
|
if (pageNumber == 0) pageNumber = 1;
|
|
|
|
|
if (pageSize == 0) pageSize = 20;
|
|
|
|
|
if (SqlInjectionUtils.hasSqlInjectionRisk(keyword)) {
|
|
|
|
|
renderJson("输入的查询关键字存在SQL注入攻击,无法执行!");
|
|
|
|
|
return;
|
|
|
|
|
public void getDataSetContent(long datasetId, int page, int limit) {
|
|
|
|
|
Page<Record> p = ym.getDataSetContent(datasetId, page, limit);
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(p));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Page<Record> pageList = ym.getDataSetContent(id, keyword, pageNumber, pageSize);
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(pageList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存数据集下的数据表
|
|
|
|
|