com.github.quartzwebui.service.strategy.BasicServiceStrategy Maven / Gradle / Ivy
The newest version!
/**
* Licensed under the Apache License, Version 2.0 (the "License");
*/
package com.github.quartzwebui.service.strategy;
import com.github.quartzwebui.manager.web.QuartzWebUIManager;
import com.github.quartzwebui.service.JSONResult;
import com.github.quartzwebui.service.QuartzWebUIURL;
import java.util.Map;
/**
* @author quxiucheng [[email protected]]
*/
public class BasicServiceStrategy implements ServiceStrategy {
public JSONResult service(ServiceStrategyURL serviceStrategyURL, BasicServiceStrategyParameter parameter) {
// 列出信息
if (QuartzWebUIURL.BasicURL.BASIC.getURL().equals(serviceStrategyURL.getURL())) {
return getInfo();
}
return JSONResult.build(JSONResult.RESULT_CODE_ERROR, "404 not found");
}
public BasicServiceStrategyParameter newServiceStrategyParameterInstance() {
return new BasicServiceStrategyParameter();
}
public JSONResult getInfo() {
try {
Map resultMap = QuartzWebUIManager.getBasicInfo();
return JSONResult.build(JSONResult.RESULT_CODE_SUCCESS, resultMap);
} catch (Exception e) {
e.printStackTrace();
return JSONResult.build(JSONResult.RESULT_CODE_ERROR, e.getMessage());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy