Skip to content

Commit

Permalink
auto commit and push by cuilan on 2024-03-12 14:46:39
Browse files Browse the repository at this point in the history
  • Loading branch information
cuilan committed Mar 12, 2024
1 parent f678b1f commit a462046
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 65 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>tom-common</name>
<description>tom common</description>

Expand Down
2 changes: 1 addition & 1 deletion tom-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-all</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tom-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tom-constants/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-constants</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tom-crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-crypto</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tom-mybatis-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-mybatis-base</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.cuilan.tom.mybatisbase.entity;

import io.github.cuilan.tom.mybatisbase.enums.Action;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;

Expand All @@ -9,40 +10,17 @@
/**
* 数据库实体基类
*
* @author zhang.yan
* @since 2021-10-27
* @author zhangyan
* @since 2023/11/9
*/
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class BaseEntity extends BaseIdEntity implements Serializable {
public class BaseEntity extends BaseTimeEntity implements Serializable {

/**
* 记录状态
* 自增主键
*/
private Action action;

/**
* 记录修改时间
*/
private Long actionTime;

/**
* 记录创建时间
*/
private Long createTime;

/**
* 设置action参数
*
* @param action action
*/
public void setAction(Action action) {
long now = System.currentTimeMillis();
if (Action.INIT == action) {
this.createTime = now;
}
this.actionTime = now;
this.action = action;
}
@TableId(type = IdType.AUTO)
private Long id;

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BaseTenantEntity extends BaseEntity {
public class BaseTenantTimeEntity extends BaseEntity {

/**
* 租户id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package io.github.cuilan.tom.mybatisbase.entity;

import io.github.cuilan.tom.mybatisbase.enums.Action;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
* 数据库实体基类
*
* @author zhang.yan
* @since 2021-10-27
*/
@Data
public abstract class BaseTimeEntity implements Serializable {

/**
* 记录状态
*/
private Action action;

/**
* 记录修改时间
*/
private Long actionTime;

/**
* 记录创建时间
*/
private Long createTime;

/**
* 设置action参数
*
* @param action action
*/
public void setAction(Action action) {
long now = System.currentTimeMillis();
if (Action.INIT == action) {
this.createTime = now;
}
this.actionTime = now;
this.action = action;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private EntityHelper() {
* @param item 实体类
* @param action action
*/
public static void setBaseInfo(BaseEntity item, Action action) {
public static void setBaseInfo(BaseTimeEntity item, Action action) {
Long now = System.currentTimeMillis();
if (Action.INIT == action) {
item.setCreateTime(now);
Expand Down
2 changes: 1 addition & 1 deletion tom-network/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-network</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tom-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-redis</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tom-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.github.cuilan</groupId>
<artifactId>tom-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>tom-utils</artifactId>
Expand Down

0 comments on commit a462046

Please sign in to comment.