本文整理汇总了Java中org.lpw.tephra.ctrl.execute.Execute类的典型用法代码示例。如果您正苦于以下问题:Java Execute类的具体用法?Java Execute怎么用?Java Execute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Execute类属于org.lpw.tephra.ctrl.execute包,在下文中一共展示了Execute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: service
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的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: save
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "save", validates = {
@Validate(validator = Validators.ID, emptyable = true, parameter = "id", failureCode = 1),
@Validate(validator = Validators.ID, emptyable = true, parameter = "group", failureCode = 2),
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 3),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "key", failureCode = 4),
@Validate(validator = SchemaService.VALIDATOR_TYPE, parameter = "type", failureCode = 5),
@Validate(validator = Validators.NOT_EMPTY, parameter = "ip", failureCode = 6),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "ip", failureCode = 7),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "name", failureCode = 8),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "username", failureCode = 9),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "password", failureCode = 10),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "memo", failureCode = 11),
@Validate(validator = Validators.SIGN),
@Validate(validator = SchemaService.VALIDATOR_EXISTS, emptyable = true, parameter = "id", failureCode = 12),
@Validate(validator = SchemaService.VALIDATOR_KEY_NOT_EXISTS, parameters = {"id", "key"}, failureCode = 13)
})
public Object save() {
return schemaService.save(request.setToModel(new SchemaModel()));
}
示例3: save
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "save", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 2),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "key", failureCode = 3),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "name", failureCode = 4),
@Validate(validator = Validators.NOT_EMPTY, parameter = "appId", failureCode = 5),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "appId", failureCode = 6),
@Validate(validator = Validators.NOT_EMPTY, parameter = "secret", failureCode = 7),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "secret", failureCode = 8),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "token", failureCode = 9),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "mchId", failureCode = 10),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "mchKey", failureCode = 11),
@Validate(validator = Validators.SIGN, string = {"ranch-weixin"}),
@Validate(validator = WeixinService.VALIDATOR_NOT_EXISTS, parameters = {"key", "appId"}, failureCode = 12)
})
public Object save() {
return weixinService.save(request.setToModel(new WeixinModel()));
}
示例4: read
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的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;
}
示例5: save
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "save", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 2),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "key", failureCode = 3),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "name", failureCode = 4),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "width", failureCode = 5),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "height", failureCode = 6),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "fontMin", failureCode = 7),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "fontMax", failureCode = 8),
@Validate(validator = Validators.NOT_EMPTY, parameter = "chars", failureCode = 9),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "chars", failureCode = 10),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "length", failureCode = 11),
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "background", failureCode = 12),
@Validate(validator = Validators.SIGN)
})
public Object save() {
return captchaService.save(request.setToModel(new CaptchaModel()));
}
示例6: find
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "find", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "code", failureCode = 2),
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 4)
})
public Object find() {
return templates.get().success(classifyService.find(request.get("code"), request.get("key")), null);
}
示例7: signIn
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "sign-in", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "uid", failureCode = 1),
@Validate(validator = UserService.VALIDATOR_PASSWORD, parameter = "password", failureCode = 3),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "macId", failureCode = 5),
@Validate(validator = Validators.BETWEEN, number = {0, 2}, parameter = "type", failureCode = 27),
@Validate(validator = UserService.VALIDATOR_SIGN_IN, parameters = {"uid", "password", "macId", "type"}, failureCode = 6)
})
public Object signIn() {
return sign();
}
示例8: debugScript
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的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('/')));
}
示例9: find
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "find", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "user", failureCode = 1),
@Validate(validator = UserHelper.VALIDATOR_SIGN_IN),
@Validate(validator = UserHelper.VALIDATOR_EXISTS, parameter = "user")
})
public Object find() {
return modelHelper.toJson(friendService.find(request.get("user")));
}
示例10: refund
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "refund", validates = {
@Validate(validator = Validators.MAX_LENGTH, number = {36}, parameter = "owner", failureCode = 1),
@Validate(validator = Validators.BETWEEN, number = {0, 9}, parameter = "type", failureCode = 2),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "channel", failureCode = 3),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "amount", failureCode = 4),
@Validate(validator = UserHelper.VALIDATOR_EXISTS_OR_SIGN_IN, parameter = "user", failureCode = 5)
})
public Object refund() {
return execute(accountService.refund(request.get("user"), request.get("owner"), request.getAsInt("type"),
request.get("channel"), request.getAsLong("amount")), 18, "refund");
}
示例11: auth
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
/**
* 认证用户信息。
* appId 微信App ID。
* code 微信认证码。
*
* @return 微信用户信息,如果认证失败则返回空JSON。
*/
@Execute(name = "auth", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "appId", failureCode = 1),
@Validate(validator = Validators.NOT_EMPTY, parameter = "code", failureCode = 2)
})
public Object auth() {
return templates.get().success(weixinService.auth(request.get("appId"), request.get("code")), null);
}
示例12: prepay
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
/**
* 生成预支付参数。
* type 充值类型,[JSAPI]。
* appId 微信公众号AppID。
* orderNo 订单号。
* body 订单内容。
* amount 金额,单位:分。
*
* @return 预支付参数。
*/
@Execute(name = "prepay", validates = {
@Validate(validator = WeixinService.VALIDATOR_EXISTS_PAY_GATEWAY, parameter = "type", failureCode = 11)
})
public Object prepay() {
String string = weixinService.prepay(request.get("type"), request.get("appId"), request.get("orderNo"), request.get("body"), request.getAsInt("amount"));
if (string == null)
return templates.get().failure(1302, message.get("tephra.weixin.prepay.failure"), null, null);
return string;
}
示例13: find
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "find-by-code", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "code", failureCode = 26),
@Validate(validator = Validators.SIGN)
})
public Object find() {
return templates.get().success(userService.findByCode(request.get("code")), null);
}
示例14: state
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "state", validates = {
@Validate(validator = Validators.SIGN)
})
public Object state() {
loggerService.state(request.get("id"), request.getAsInt("state"));
return "";
}
示例15: notice
import org.lpw.tephra.ctrl.execute.Execute; //导入依赖的package包/类
@Execute(name = "notice", validates = {
@Validate(validator = Validators.ID, parameter = "id", failureCode = 1),
@Validate(validator = Validators.SIGN),
@Validate(validator = TransferService.VALIDATOR_EXISTS, parameter = "id", failureCode = 2)
})
public Object notice() {
return transferService.notice(request.get("id"));
}