refactor base smartproc
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
@MappedSuperclass
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
@Column(name = "created_by", length = 50)
|
||||
private String createdBy;
|
||||
|
||||
@Column(name = "created_time", nullable = false, updatable=false)
|
||||
@CreationTimestamp
|
||||
private Timestamp createdTime;
|
||||
|
||||
@Column(name = "updated_by", length = 50)
|
||||
private String updatedBy;
|
||||
|
||||
@Column(name = "updated_time")
|
||||
@UpdateTimestamp
|
||||
private Timestamp updatedTime;
|
||||
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public interface BaseInterfaceRequest extends Serializable {
|
||||
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public interface BaseInterfaceResponse extends Serializable {
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class BasePaginationRequest extends BaseRequest{
|
||||
|
||||
|
||||
private Integer pageSize;
|
||||
private Integer pageNumber;
|
||||
private String sortBy;
|
||||
private String sortType;
|
||||
}
|
||||
|
@@ -0,0 +1,14 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import com.iconplus.smartproc.helper.model.Pagination;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class BasePaginationResponse extends BaseResponse{
|
||||
|
||||
private Pagination pagination;
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BaseRequest implements Serializable {
|
||||
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.iconplus.smartproc.helper.base;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BaseResponse implements Serializable {
|
||||
|
||||
}
|
Reference in New Issue
Block a user