当前位置: 首页>>代码示例>>Java>>正文


Java Templates类代码示例

本文整理汇总了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());
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:19,代码来源:WeixinCtrl.java

示例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;
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:17,代码来源:DocCtrl.java

示例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;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:8,代码来源:JsCtrl.java

示例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('/')));
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:10,代码来源:JsCtrl.java

示例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 "";
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:11,代码来源:WeixinCtrl.java

示例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>";
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:9,代码来源:WeixinCtrl.java

示例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;
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:16,代码来源:AlipayCtrl.java

示例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;
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:16,代码来源:AlipayCtrl.java

示例9: getType

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
    return Templates.STREAM;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:TemplateImpl.java

示例10: getType

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
    return Templates.STRING;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:TemplateImpl.java

示例11: getType

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
    return Templates.EXCEL;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:TemplateImpl.java

示例12: getType

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
    return Templates.FREEMARKER;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:TemplateImpl.java

示例13: getType

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
    return Templates.JSON;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:TemplateImpl.java

示例14: getType

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Override
public String getType() {
    return Templates.PPTX;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:TemplateImpl.java

示例15: jsapi

import org.lpw.tephra.ctrl.template.Templates; //导入依赖的package包/类
@Execute(name = "jsapi", type = Templates.STRING)
public Object jsapi() {
    return callback(PayGateway.JSAPI);
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:5,代码来源:WeixinCtrl.java


注:本文中的org.lpw.tephra.ctrl.template.Templates类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。