fix: Controller编译错误(private mapper+import缺失+字段位置)
This commit is contained in:
@@ -14,4 +14,8 @@ public interface RiskRuleService {
|
||||
List<Map<String, Object>> listAll();
|
||||
/** 删除风险规则 */
|
||||
void deleteRules(String siteType);
|
||||
/** 获取版本历史列表 */
|
||||
List<Map<String, Object>> listVersions(String siteType);
|
||||
/** 获取指定版本内容 */
|
||||
String getVersionContent(String siteType, int version);
|
||||
}
|
||||
|
||||
@@ -14,4 +14,8 @@ public interface SitePagesService {
|
||||
List<Map<String, Object>> listAll();
|
||||
/** 删除站点页面配置 */
|
||||
void deletePages(String siteId);
|
||||
/** 获取版本历史列表 */
|
||||
List<Map<String, Object>> listVersions(String siteId);
|
||||
/** 获取指定版本内容 */
|
||||
String getVersionContent(String siteId, String version);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,26 @@ public class RiskRuleServiceImpl implements RiskRuleService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listVersions(String siteType) {
|
||||
var list = mapper.selectList(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<RiskRule>()
|
||||
.eq(RiskRule::getSiteType, siteType).eq(RiskRule::getDeleted, 0)
|
||||
.orderByDesc(RiskRule::getId));
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (var r : list) {
|
||||
result.add(Map.of("version", r.getVersion(), "createdAt", r.getCreatedAt() != null ? r.getCreatedAt().toString() : ""));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionContent(String siteType, int version) {
|
||||
var r = mapper.selectOne(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<RiskRule>()
|
||||
.eq(RiskRule::getSiteType, siteType).eq(RiskRule::getVersion, version)
|
||||
.eq(RiskRule::getDeleted, 0));
|
||||
return r != null ? r.getRulesJson() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRules(String siteType) {
|
||||
mapper.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<RiskRule>()
|
||||
|
||||
@@ -76,6 +76,26 @@ public class SitePagesServiceImpl implements SitePagesService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listVersions(String siteId) {
|
||||
var list = mapper.selectList(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<SitePages>()
|
||||
.eq(SitePages::getSiteId, siteId).eq(SitePages::getDeleted, 0)
|
||||
.orderByDesc(SitePages::getId));
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (var p : list) {
|
||||
result.add(Map.of("version", p.getVersion(), "createdAt", p.getCreatedAt() != null ? p.getCreatedAt().toString() : ""));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionContent(String siteId, String version) {
|
||||
var p = mapper.selectOne(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<SitePages>()
|
||||
.eq(SitePages::getSiteId, siteId).eq(SitePages::getVersion, version)
|
||||
.eq(SitePages::getDeleted, 0));
|
||||
return p != null ? p.getEntriesJson() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePages(String siteId) {
|
||||
mapper.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<SitePages>()
|
||||
|
||||
Reference in New Issue
Block a user