refactoring
This commit is contained in:
parent
2b20a0a02f
commit
30f0f67b2d
20 changed files with 13 additions and 74 deletions
|
@ -129,11 +129,13 @@ public class EsApiManager extends BaseApiManager {
|
|||
} else {
|
||||
try (InputStream err = con.getErrorStream()) {
|
||||
logger.error(new String(InputStreamUtil.getBytes(err), Constants.CHARSET_UTF_8));
|
||||
} catch (final IOException e1) {}
|
||||
throw new WebApiException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
|
||||
}
|
||||
} catch (final IOException e1) {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
throw new WebApiException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
public void setAcceptedRoles(final String[] acceptedRoles) {
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Collections;
|
|||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -475,7 +476,7 @@ public class JsonApiManager extends BaseApiManager {
|
|||
for (final Map<String, Object> doc : docList) {
|
||||
final String urlObj = DocumentUtil.getValue(doc, fessConfig.getIndexFieldUrl(), String.class);
|
||||
if (urlObj != null) {
|
||||
urlList.add(urlObj.toString());
|
||||
urlList.add(urlObj);
|
||||
}
|
||||
}
|
||||
urlList = favoriteLogService.getUrlList(userCode, urlList);
|
||||
|
@ -587,10 +588,10 @@ public class JsonApiManager extends BaseApiManager {
|
|||
buf.append(escapeJson(entry.getKey())).append(':').append(escapeJson(entry.getValue()));
|
||||
}
|
||||
buf.append('}');
|
||||
} else if (obj instanceof Integer || obj instanceof Long || obj instanceof Float || obj instanceof Double || obj instanceof Short) {
|
||||
} else if (obj instanceof Number) {
|
||||
buf.append(obj);
|
||||
} else if (obj instanceof Date) {
|
||||
final SimpleDateFormat sdf = new SimpleDateFormat(CoreLibConstants.DATE_FORMAT_ISO_8601_EXTEND);
|
||||
final SimpleDateFormat sdf = new SimpleDateFormat(CoreLibConstants.DATE_FORMAT_ISO_8601_EXTEND, Locale.ROOT);
|
||||
buf.append('\"').append(escapeJsonString(sdf.format(obj))).append('\"');
|
||||
} else {
|
||||
buf.append('\"').append(escapeJsonString(obj.toString())).append('\"');
|
||||
|
|
|
@ -56,12 +56,11 @@ public class AccessContextLogic {
|
|||
AppTypeSupplier appTypeSupplier) {
|
||||
final AccessContext context = new AccessContext();
|
||||
context.setAccessLocalDateTimeProvider(() -> timeManager.currentDateTime());
|
||||
context.setAccessUserProvider(() -> buildAccessUserTrace(resource, userTypeSupplier, userBeanSupplier, appTypeSupplier));
|
||||
context.setAccessUserProvider(() -> buildAccessUserTrace(resource, userTypeSupplier, appTypeSupplier));
|
||||
return context;
|
||||
}
|
||||
|
||||
private <ID> String buildAccessUserTrace(AccessContextResource resource, UserTypeSupplier userTypeSupplier,
|
||||
UserBeanSupplier userBeanSupplier, AppTypeSupplier appTypeSupplier) {
|
||||
private String buildAccessUserTrace(AccessContextResource resource, UserTypeSupplier userTypeSupplier, AppTypeSupplier appTypeSupplier) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(userTypeSupplier.supply().orElse("_"));
|
||||
sb.append(",").append(appTypeSupplier.supply()).append(",").append(resource.getModuleName());
|
||||
|
|
|
@ -134,10 +134,6 @@ public class BadWordPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public BadWordPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -48,10 +48,6 @@ public class CrawlingInfoPager implements Serializable {
|
|||
|
||||
public String createdTime;
|
||||
|
||||
public CrawlingInfoPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
allRecordCount = 0;
|
||||
allPageCount = 0;
|
||||
|
|
|
@ -146,10 +146,6 @@ public class DataConfigPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public DataConfigPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -140,10 +140,6 @@ public class DuplicateHostPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public DuplicateHostPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -137,10 +137,6 @@ public class ElevateWordPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public ElevateWordPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -147,10 +147,6 @@ public class FailureUrlPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public FailureUrlPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -140,10 +140,6 @@ public class FileAuthPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public FileAuthPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -152,10 +152,6 @@ public class FileConfigPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public FileConfigPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -137,10 +137,6 @@ public class JobLogPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public JobLogPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -140,10 +140,6 @@ public class LabelTypePager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public LabelTypePager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -143,10 +143,6 @@ public class PathMapPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public PathMapPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -140,10 +140,6 @@ public class ReqHeaderPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public ReqHeaderPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -140,10 +140,6 @@ public class RoleTypePager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public RoleTypePager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -155,10 +155,6 @@ public class SchedulerPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public SchedulerPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ public class UserPager implements Serializable {
|
|||
public String name;
|
||||
|
||||
public String[] roles;
|
||||
|
||||
public String[] groups;
|
||||
|
||||
public String versionNo;
|
||||
|
|
|
@ -140,10 +140,6 @@ public class WebAuthPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public WebAuthPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
|
@ -155,10 +155,6 @@ public class WebConfigPager implements Serializable {
|
|||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
public WebConfigPager() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return Constants.DEFAULT_ADMIN_PAGE_SIZE;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue