fix: approveChange 新建站点时设置 name 字段避免 NOT NULL 报错
This commit is contained in:
@@ -262,6 +262,7 @@ public class SiteServiceImpl implements SiteService {
|
||||
Site existing = siteMapper.selectBySiteId(entry.getSiteId());
|
||||
Site site;
|
||||
if (existing != null) {
|
||||
if (names != null && !names.isEmpty()) existing.setName(names.get(0));
|
||||
existing.setNamesJson(toJsonArray(names));
|
||||
existing.setUrlsJson(toJsonArray(urls));
|
||||
if (notes != null && !notes.isBlank()) existing.setNotes(notes);
|
||||
@@ -278,6 +279,7 @@ public class SiteServiceImpl implements SiteService {
|
||||
} else {
|
||||
site = new Site();
|
||||
site.setSiteId(entry.getSiteId());
|
||||
site.setName(names != null && !names.isEmpty() ? names.get(0) : entry.getSiteId());
|
||||
site.setNamesJson(toJsonArray(names));
|
||||
site.setUrlsJson(toJsonArray(urls));
|
||||
site.setNotes(notes);
|
||||
|
||||
Reference in New Issue
Block a user