Merge branch 'leng_dev' into dev
This commit is contained in:
commit
220ebef1a6
5 files changed
+15
-22
No files matched your search
+4
-1
@@ -21,6 +21,7 @@ import cn.hutool.core.io.IoUtil;
|
|||||||
import com.baomidou.mybatisplus.plugins.Page;
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
||||||
import com.pig4cloud.pigx.codegen.service.SysGeneratorService;
|
import com.pig4cloud.pigx.codegen.service.SysGeneratorService;
|
||||||
|
import com.pig4cloud.pigx.common.core.util.Query;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -48,7 +49,9 @@ public class SysGeneratorController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public Page list(@RequestParam Map<String, Object> params) {
|
public Page list(@RequestParam Map<String, Object> params) {
|
||||||
return sysGeneratorService.queryPage(params);
|
Query query = new Query(params);
|
||||||
|
query.setRecords(sysGeneratorService.queryPage(query));
|
||||||
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+4
-2
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package com.pig4cloud.pigx.codegen.mapper;
|
package com.pig4cloud.pigx.codegen.mapper;
|
||||||
|
|
||||||
|
import com.pig4cloud.pigx.common.core.util.Query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -31,10 +33,10 @@ public interface SysGeneratorMapper {
|
|||||||
/**
|
/**
|
||||||
* 分页查询表格
|
* 分页查询表格
|
||||||
*
|
*
|
||||||
* @param query
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Map<String, Object>> queryList(Map query);
|
List<Map<String, Object>> queryList(Query params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表数量
|
* 查询表数量
|
||||||
|
|||||||
+3
-2
@@ -17,9 +17,10 @@
|
|||||||
|
|
||||||
package com.pig4cloud.pigx.codegen.service;
|
package com.pig4cloud.pigx.codegen.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.plugins.Page;
|
|
||||||
import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
||||||
|
import com.pig4cloud.pigx.common.core.util.Query;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,5 +41,5 @@ public interface SysGeneratorService {
|
|||||||
* @param query 查询条件
|
* @param query 查询条件
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Page queryPage(Map<String,Object> query);
|
List<Map<String,Object>> queryPage(Query query);
|
||||||
}
|
}
|
||||||
+3
-16
@@ -17,13 +17,12 @@
|
|||||||
|
|
||||||
package com.pig4cloud.pigx.codegen.service.impl;
|
package com.pig4cloud.pigx.codegen.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import com.baomidou.mybatisplus.plugins.Page;
|
|
||||||
import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
||||||
import com.pig4cloud.pigx.codegen.mapper.SysGeneratorMapper;
|
import com.pig4cloud.pigx.codegen.mapper.SysGeneratorMapper;
|
||||||
import com.pig4cloud.pigx.codegen.service.SysGeneratorService;
|
import com.pig4cloud.pigx.codegen.service.SysGeneratorService;
|
||||||
import com.pig4cloud.pigx.codegen.util.GenUtils;
|
import com.pig4cloud.pigx.codegen.util.GenUtils;
|
||||||
|
import com.pig4cloud.pigx.common.core.util.Query;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -51,20 +50,8 @@ public class SysGeneratorServiceImpl implements SysGeneratorService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page queryPage(Map<String, Object> query) {
|
public List<Map<String,Object>> queryPage(Query query) {
|
||||||
|
return sysGeneratorMapper.queryList(query);
|
||||||
Integer current = Integer.parseInt(query.getOrDefault("page", "1").toString());
|
|
||||||
Integer limit = Integer.parseInt(query.getOrDefault("limit", "1").toString());
|
|
||||||
Page page = new Page(current, limit);
|
|
||||||
|
|
||||||
List<Map<String, Object>> list = sysGeneratorMapper.queryList(query);
|
|
||||||
if (CollUtil.isEmpty(list)) {
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
page.setTotal(sysGeneratorMapper.queryTotal(query));
|
|
||||||
page.setRecords(list);
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<pigx.version>1.4.0</pigx.version>
|
<pigx.version>1.4.1</pigx.version>
|
||||||
<spring-boot.version>2.0.3.RELEASE</spring-boot.version>
|
<spring-boot.version>2.0.3.RELEASE</spring-boot.version>
|
||||||
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
|
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
Reference in new issue
Block a user