本文整理汇总了Java中org.lpw.tephra.ctrl.template.Templates类的典型用法代码示例。如果您正苦于以下问题:Java Templates类的具体用法?Java Templates怎么用?Java Templates使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Templates类属于org.lpw.tephra.ctrl.template包,在下文中一共展示了Templates类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: service
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "wx.+", type = Templates.STRING)
public Object service() {
String uri = request.getUri();
String appId = uri.substring(uri.lastIndexOf('/') + 1);
String echo = request.get("echostr");
if (!validator.isEmpty(echo))
return weixinService.echo(appId, request.get("signature"), request.get("timestamp"), request.get("nonce")) ? echo : "failure";
String redirect = request.get("redirect");
if (!validator.isEmpty(redirect)) {
weixinService.auth(appId, request.get("code"));
forward.redirectTo(redirect);
return null;
}
return weixinService.xml(appId, request.getFromInputStream());
}
示例2: read
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "read", type = Templates.FREEMARKER, template = "read", validates = {
@Validate(validator = Validators.ID, parameter = "id", failureCode = 11),
@Validate(validator = DocService.VALIDATOR_EXISTS, parameter = "id", failureCode = 12)
})
public Object read() {
Map<String, Object> map = new HashMap<>();
boolean html = "true".equals(request.get("html"));
map.put("html", html);
if (html) {
map.put("model", docService.findById(request.get("id")));
map.put("css", request.getAsArray("css"));
}
map.put("content", docService.read(request.get("id")));
return map;
}
示例3: debug
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "debug", type = Templates.FREEMARKER, template = "debug")
public Object debug() {
Map<String, Object> map = new HashMap<>();
map.put("names", engine.names());
return map;
}
示例4: debugScript
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "debug/.+", type = Templates.STRING, validates = {
@Validate(validator = ScriptValidator.NAME, parameter = "parameter", string = {"validator1", "validator2"})
})
public Object debugScript() {
response.setContentType("text/javascript");
String uri = request.getUri();
return engine.read(uri.substring(uri.lastIndexOf('/')));
}
示例5: service
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "wx.+", type = Templates.STRING)
public Object service() {
String uri = request.getUri();
String appId = uri.substring(uri.lastIndexOf('/') + 1);
String echostr = request.get("echostr");
if (!validator.isEmpty(echostr))
return weixinService.echo(appId, request.get("signature"), request.get("timestamp"), request.get("nonce"), echostr);
return "";
}
示例6: notice
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "notice", type = Templates.STRING)
public Object notice() {
Map<String, String> map = xml.toMap(request.getFromInputStream(), false);
String code = weixinService.notice(map.get("appid"), map.get("out_trade_no"), map.get("transaction_id"),
map.get("total_fee"), map.get("return_code"), map.get("result_code"), map) ? "SUCCESS" : "FAIL";
return "<xml><return_code><![CDATA[" + code + "]]></return_code></xml>";
}
示例7: quickWapPay
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "quick-wap-pay", type = Templates.FREEMARKER, template = "prepay", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
@Validate(validator = Validators.NOT_EMPTY, parameter = "subject", failureCode = 11),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "amount", failureCode = 12),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "billNo", failureCode = 16),
@Validate(validator = UserHelper.VALIDATOR_EXISTS_OR_SIGN_IN, parameter = "user", failureCode = 13),
@Validate(validator = AlipayService.VALIDATOR_EXISTS, parameter = "key", failureCode = 14)
})
public Object quickWapPay() {
Map<String, String> map = new HashMap<>();
map.put("html", alipayService.quickWapPay(request.get("key"), request.get("user"), request.get("subject"),
request.getAsInt("amount"), request.get("billNo"), request.get("notice"), request.get("returnUrl")));
return map;
}
示例8: fastInstantTradePay
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "fast-instant-trade-pay", type = Templates.FREEMARKER, template = "prepay", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
@Validate(validator = Validators.NOT_EMPTY, parameter = "subject", failureCode = 11),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "amount", failureCode = 12),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "billNo", failureCode = 16),
@Validate(validator = UserHelper.VALIDATOR_EXISTS_OR_SIGN_IN, parameter = "user", failureCode = 13),
@Validate(validator = AlipayService.VALIDATOR_EXISTS, parameter = "key", failureCode = 14)
})
public Object fastInstantTradePay() {
Map<String, String> map = new HashMap<>();
map.put("html", alipayService.fastInstantTradePay(request.get("key"), request.get("user"), request.get("subject"),
request.getAsInt("amount"), request.get("billNo"), request.get("notice"), request.get("returnUrl")));
return map;
}
示例9: getType
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
return Templates.STREAM;
}
示例10: getType
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
return Templates.STRING;
}
示例11: getType
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
return Templates.EXCEL;
}
示例12: getType
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
return Templates.FREEMARKER;
}
示例13: getType
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
return Templates.JSON;
}
示例14: getType
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
return Templates.PPTX;
}
示例15: jsapi
import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "jsapi", type = Templates.STRING)
public Object jsapi() {
return callback(PayGateway.JSAPI);
}