Commit 1a9b1318 by Jason Song Committed by GitHub

Merge pull request #491 from lepdou/commit

bugfix: record empty commit when only modify item comment
parents 0f883313 049c1033
...@@ -90,6 +90,7 @@ public class ItemController { ...@@ -90,6 +90,7 @@ public class ItemController {
builder.updateItem(beforeUpdateItem, entity); builder.updateItem(beforeUpdateItem, entity);
itemDTO = BeanUtils.transfrom(ItemDTO.class, entity); itemDTO = BeanUtils.transfrom(ItemDTO.class, entity);
if (builder.hasContent()) {
Commit commit = new Commit(); Commit commit = new Commit();
commit.setAppId(appId); commit.setAppId(appId);
commit.setClusterName(clusterName); commit.setClusterName(clusterName);
...@@ -98,6 +99,7 @@ public class ItemController { ...@@ -98,6 +99,7 @@ public class ItemController {
commit.setDataChangeCreatedBy(itemDTO.getDataChangeLastModifiedBy()); commit.setDataChangeCreatedBy(itemDTO.getDataChangeLastModifiedBy());
commit.setDataChangeLastModifiedBy(itemDTO.getDataChangeLastModifiedBy()); commit.setDataChangeLastModifiedBy(itemDTO.getDataChangeLastModifiedBy());
commitService.save(commit); commitService.save(commit);
}
return itemDTO; return itemDTO;
} }
......
...@@ -7,6 +7,7 @@ import org.hibernate.annotations.Where; ...@@ -7,6 +7,7 @@ import org.hibernate.annotations.Where;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table; import javax.persistence.Table;
@Entity @Entity
...@@ -15,7 +16,8 @@ import javax.persistence.Table; ...@@ -15,7 +16,8 @@ import javax.persistence.Table;
@Where(clause = "isDeleted = 0") @Where(clause = "isDeleted = 0")
public class Commit extends BaseEntity { public class Commit extends BaseEntity {
@Column(name = "ChangeSets", length = 4048, nullable = false) @Lob
@Column(name = "ChangeSets", nullable = false)
private String changeSets; private String changeSets;
@Column(name = "AppId", nullable = false) @Column(name = "AppId", nullable = false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment