init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.eactive.eai.rms.common.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
public abstract class AbstractTree {
|
||||
|
||||
private Object id;
|
||||
|
||||
private Object parent;
|
||||
|
||||
private int level;
|
||||
|
||||
@JsonProperty("expanded")
|
||||
private boolean expanded;
|
||||
|
||||
@JsonProperty("isLeaf")
|
||||
private boolean leaf;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.eactive.eai.rms.common.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
public class GridResponse<T> {
|
||||
|
||||
private Integer total;
|
||||
private Integer page;
|
||||
private Long records;
|
||||
private List<T> rows;
|
||||
|
||||
public GridResponse() {
|
||||
}
|
||||
|
||||
public GridResponse(Page<T> page) {
|
||||
setPage(page);
|
||||
}
|
||||
|
||||
public Integer getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Integer total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Long getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
public void setRecords(Long records) {
|
||||
this.records = records;
|
||||
}
|
||||
|
||||
public void setRecords(Integer records) {
|
||||
this.records = records.longValue();
|
||||
}
|
||||
|
||||
public List<T> getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<T> rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public GridResponse(List<T> rows) {
|
||||
this.rows = rows;
|
||||
this.total = 1;
|
||||
this.page = 1;
|
||||
this.records = (long) rows.size();
|
||||
}
|
||||
|
||||
public GridResponse<T> setPage(Page<T> page) {
|
||||
setTotal(page.getTotalPages()); // 전체 페이지수
|
||||
setPage(page.getNumber() + 1); // 현재 페이지수
|
||||
setRecords(page.getTotalElements()); // 전체 레코드건수
|
||||
setRows(page.getContent());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.eactive.eai.rms.common.vo;
|
||||
|
||||
/**
|
||||
* {@link GridResponse} 을 사용
|
||||
*/
|
||||
@Deprecated
|
||||
public class JsonPageVo {
|
||||
private int page;
|
||||
private int totalCount;
|
||||
private int rows;
|
||||
|
||||
public int getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(int page) {
|
||||
this.page = page > 0 ? page : 1;
|
||||
}
|
||||
|
||||
public int getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public int getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(int rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public int getStartNum(){
|
||||
return ( page - 1 ) * rows + 1;
|
||||
}
|
||||
public int getEndNum(){
|
||||
return ( page ) * rows;
|
||||
}
|
||||
public int getTotal(){
|
||||
return (totalCount/rows) + ((totalCount%rows)==0?0:1);
|
||||
}
|
||||
|
||||
|
||||
// paramMap.put("endNum", new Integer(Integer.parseInt(currentPageNum)
|
||||
// * CommonConstants.DISPLAY_COUNT));// ³¡ record
|
||||
// paramMap.put("startNum", new Integer(
|
||||
// (Integer.parseInt(currentPageNum) - 1)
|
||||
// * CommonConstants.DISPLAY_COUNT + 1));// ½ÃÀÛ record
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.eactive.eai.rms.common.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SchemaIdVO implements Serializable {
|
||||
|
||||
@JsonIgnore
|
||||
private String schemaId;
|
||||
@JsonIgnore
|
||||
private String loginId;
|
||||
|
||||
public String getSchemaId() {
|
||||
return schemaId;
|
||||
}
|
||||
|
||||
public void setSchemaId(String schemaId) {
|
||||
this.schemaId = schemaId;
|
||||
}
|
||||
|
||||
public String getLoginId() {
|
||||
return loginId;
|
||||
}
|
||||
|
||||
public void setLoginId(String loginId) {
|
||||
this.loginId = loginId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.eactive.eai.rms.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data(staticConstructor = "of")
|
||||
@Accessors(chain = true)
|
||||
public class SimpleResponse {
|
||||
|
||||
@NonNull
|
||||
private String message;
|
||||
}
|
||||
Reference in New Issue
Block a user