feat: 页面配置增加authType认证方式(NONE/COOKIE/TOKEN/BASIC/API_KEY)
This commit is contained in:
@@ -10,6 +10,8 @@ public interface SitePagesService {
|
||||
String getVersion(String siteId);
|
||||
/** 保存/更新页面配置 */
|
||||
void savePages(String siteId, List<Map<String, Object>> entries);
|
||||
/** 保存/更新页面配置(含认证方式) */
|
||||
void savePages(String siteId, List<Map<String, Object>> entries, String authType, String authValue);
|
||||
/** 获取所有站点页面配置列表(管理员) */
|
||||
List<Map<String, Object>> listAll();
|
||||
/** 删除站点页面配置 */
|
||||
|
||||
@@ -53,8 +53,17 @@ public class SitePagesServiceImpl implements SitePagesService {
|
||||
|
||||
@Override
|
||||
public void savePages(String siteId, List<Map<String, Object>> entries) {
|
||||
savePages(siteId, entries, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePages(String siteId, List<Map<String, Object>> entries, String authType, String authValue) {
|
||||
try {
|
||||
String json = om.writerWithDefaultPrettyPrinter().writeValueAsString(entries);
|
||||
Map<String, Object> full = new LinkedHashMap<>();
|
||||
full.put("entries", entries);
|
||||
if (authType != null && !"NONE".equals(authType)) full.put("authType", authType);
|
||||
if (authValue != null && !authValue.isBlank()) full.put("authValue", authValue);
|
||||
String json = om.writerWithDefaultPrettyPrinter().writeValueAsString(full);
|
||||
// 版本号递增
|
||||
String currentVer = getVersion(siteId);
|
||||
int nextVer = 1;
|
||||
|
||||
Reference in New Issue
Block a user