去掉common依赖
This commit is contained in:
@@ -33,16 +33,25 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yxt.demo</groupId>
|
||||
<artifactId>demo-common-core</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.yxt.demo</groupId>-->
|
||||
<!-- <artifactId>demo-common-core</artifactId>-->
|
||||
<!-- <version>0.0.1</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency><dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>2.0.5</version>
|
||||
</dependency>
|
||||
<!-- mysql驱动 -->
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.yxt.demo.common.core.dto;
|
||||
|
||||
|
||||
import com.yxt.demo.common.core.vo.Vo;
|
||||
|
||||
public interface Dto extends Vo {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.yxt.demo.common.core.query;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/3 16:41
|
||||
* @description
|
||||
*/
|
||||
|
||||
public class PagerQuery<T extends Query> implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "当前页号", example = "1")
|
||||
private long current = 1L;
|
||||
|
||||
@ApiModelProperty(value = "每页记录数", example = "10")
|
||||
private long size = 10L;
|
||||
|
||||
@ApiModelProperty(value = "标识符")
|
||||
private Integer identifier;
|
||||
|
||||
@ApiModelProperty("查询条件的项")
|
||||
private T params;
|
||||
|
||||
public PagerQuery() {
|
||||
}
|
||||
|
||||
public PagerQuery(long current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
public PagerQuery(long current, long size) {
|
||||
this.size = size;
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public PagerQuery setSize(long size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public PagerQuery setCurrent(long current) {
|
||||
this.current = current;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public PagerQuery setParams(T params) {
|
||||
this.params = params;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(Integer identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public void fromPagerQuery(PagerQuery s_query) {
|
||||
this.setCurrent(s_query.getCurrent()).setSize(s_query.getSize()).setParams(params.fromMap(s_query.getParams().toMap()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.yxt.demo.common.core.query;
|
||||
|
||||
import com.yxt.demo.common.core.vo.Vo;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/3 16:41
|
||||
* @description
|
||||
*/
|
||||
|
||||
public interface Query extends Vo {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.yxt.demo.common.core.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/3 16:24
|
||||
* @description
|
||||
*/
|
||||
@ApiModel(description = "返回的分页结果")
|
||||
public class PagerVo<T> implements Serializable {
|
||||
|
||||
@ApiModelProperty("总页数")
|
||||
private long pages = 1L;
|
||||
@ApiModelProperty("总记录数")
|
||||
private long total = 0L;
|
||||
@ApiModelProperty("每页记录数")
|
||||
private long size = 15L;
|
||||
@ApiModelProperty("当前页号")
|
||||
private long current = 1L;
|
||||
@ApiModelProperty(value = "标识符")
|
||||
private Integer identifier;
|
||||
|
||||
@ApiModelProperty("当前页的数据")
|
||||
private List<T> records = Collections.emptyList();
|
||||
|
||||
public PagerVo() {
|
||||
this.pages = 1L;
|
||||
this.total = 0L;
|
||||
this.size = 10L;
|
||||
this.current = 1L;
|
||||
this.records = Collections.emptyList();
|
||||
}
|
||||
|
||||
public PagerVo(long current) {
|
||||
this.pages = 1L;
|
||||
this.total = 0L;
|
||||
this.size = 10L;
|
||||
this.current = current;
|
||||
this.records = Collections.emptyList();
|
||||
}
|
||||
|
||||
public long getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
public PagerVo<T> setPages(long pages) {
|
||||
this.pages = pages;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public PagerVo<T> setTotal(long total) {
|
||||
this.total = total;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public PagerVo<T> setSize(long size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public PagerVo<T> setCurrent(long current) {
|
||||
this.current = current;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<T> getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
public PagerVo<T> setRecords(List<T> records) {
|
||||
this.records = records;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(Integer identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.demo.common.core.vo;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import javax.swing.text.html.parser.Entity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/3 16:21
|
||||
* @description
|
||||
*/
|
||||
|
||||
public interface Vo extends Serializable {
|
||||
|
||||
default Map<String, Object> toMap() {
|
||||
return BeanUtil.beanToMap(this);
|
||||
}
|
||||
|
||||
default <V extends Vo> V fromMap(Map<String, Object> map) {
|
||||
return (V) BeanUtil.fillBeanWithMap(map, this, false);
|
||||
}
|
||||
|
||||
default <E extends Entity> void fromEntity(E e) {
|
||||
BeanUtil.copyProperties(e, this);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.api.sys_user.SysUserDto;
|
||||
import com.yxt.demo.system.api.sys_user.SysUserLoginQuery;
|
||||
import com.yxt.demo.system.biz.sys_info.SysInfoService;
|
||||
import jdk.nashorn.internal.ir.IfNode;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user