提交 049c1033 编写于 作者: L lepdou

bugfix: record empty commit when only modify item comment

上级 0f883313
......@@ -90,14 +90,16 @@ public class ItemController {
builder.updateItem(beforeUpdateItem, entity);
itemDTO = BeanUtils.transfrom(ItemDTO.class, entity);
Commit commit = new Commit();
commit.setAppId(appId);
commit.setClusterName(clusterName);
commit.setNamespaceName(namespaceName);
commit.setChangeSets(builder.build());
commit.setDataChangeCreatedBy(itemDTO.getDataChangeLastModifiedBy());
commit.setDataChangeLastModifiedBy(itemDTO.getDataChangeLastModifiedBy());
commitService.save(commit);
if (builder.hasContent()) {
Commit commit = new Commit();
commit.setAppId(appId);
commit.setClusterName(clusterName);
commit.setNamespaceName(namespaceName);
commit.setChangeSets(builder.build());
commit.setDataChangeCreatedBy(itemDTO.getDataChangeLastModifiedBy());
commit.setDataChangeLastModifiedBy(itemDTO.getDataChangeLastModifiedBy());
commitService.save(commit);
}
return itemDTO;
}
......
......@@ -7,6 +7,7 @@ import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
@Entity
......@@ -15,7 +16,8 @@ import javax.persistence.Table;
@Where(clause = "isDeleted = 0")
public class Commit extends BaseEntity {
@Column(name = "ChangeSets", length = 4048, nullable = false)
@Lob
@Column(name = "ChangeSets", nullable = false)
private String changeSets;
@Column(name = "AppId", nullable = false)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册