feat: 站点编辑增加状态字段 active/deprecated 切换
This commit is contained in:
@@ -44,7 +44,7 @@ public interface SiteService {
|
||||
* 管理员编辑站点基本信息
|
||||
*/
|
||||
Site updateSite(String siteId, String name, String description, String baseUrl,
|
||||
String siteType, Long operatorId);
|
||||
String siteType, String status, Long operatorId);
|
||||
|
||||
/** 所有站点列表(管理员用) */
|
||||
List<Site> listAllSites();
|
||||
|
||||
@@ -195,7 +195,7 @@ public class SiteServiceImpl implements SiteService {
|
||||
|
||||
@Override
|
||||
public Site updateSite(String siteId, String name, String description, String baseUrl,
|
||||
String siteType, Long operatorId) {
|
||||
String siteType, String status, Long operatorId) {
|
||||
Site site = siteMapper.selectBySiteId(siteId);
|
||||
if (site == null) throw new IllegalArgumentException("站点不存在: " + siteId);
|
||||
|
||||
@@ -215,6 +215,9 @@ public class SiteServiceImpl implements SiteService {
|
||||
if (siteType != null && !siteType.isBlank()) {
|
||||
try { site.setSiteType(SiteType.fromValue(siteType)); } catch (Exception ignored) {}
|
||||
}
|
||||
if (status != null && !status.isBlank()) {
|
||||
try { site.setStatus(SiteStatus.fromValue(status)); } catch (Exception ignored) {}
|
||||
}
|
||||
siteMapper.updateById(site);
|
||||
log.info("站点编辑: siteId={}", siteId);
|
||||
return site;
|
||||
|
||||
Reference in New Issue
Block a user