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


Java Validate类代码示例

本文整理汇总了Java中org.lpw.tephra.ctrl.validate.Validate的典型用法代码示例。如果您正苦于以下问题:Java Validate类的具体用法?Java Validate怎么用?Java Validate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Validate类属于org.lpw.tephra.ctrl.validate包,在下文中一共展示了Validate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的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()));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:19,代码来源:WeixinCtrl.java

示例2: read

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的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: debugScript

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的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

示例4: findOrSign

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "find-sign", validates = {
        @Validate(validator = Validators.NOT_EMPTY, parameter = "idUidCode", failureCode = 31),
        @Validate(validator = Validators.SIGN)
})
public Object findOrSign() {
    return userService.findOrSign(request.get("idUidCode"));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:8,代码来源:UserCtrl.java

示例5: query

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "query", validates = {
        @Validate(validator = Validators.MOBILE, emptyable = true, parameter = "mobile", failureCode = 9),
        @Validate(validator = Validators.SIGN)
})
public Object query() {
    return userService.query(request.get("mobile"));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:8,代码来源:UserCtrl.java

示例6: auth

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的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);
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:15,代码来源:WeixinCtrl.java

示例7: jsapiSign

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
/**
 * 获取JS SDK签名。
 * appId 微信公众号AppID。
 * url 请求URL地址。
 *
 * @return {timestamp:"",nonceStr:"",signature:""}。
 */
@Execute(name = "jsapi-sign", validates = {
        @Validate(validator = Validators.NOT_EMPTY, parameter = "appId", failureCode = 1),
        @Validate(validator = Validators.NOT_EMPTY, parameter = "url", failureCode = 3)
})
public Object jsapiSign() {
    return weixinHelper.getJsApiSign(request.get("appId"), request.get("url"));
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:15,代码来源:WeixinCtrl.java

示例8: find

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的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")));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:9,代码来源:FriendCtrl.java

示例9: profit

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "profit", 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 profit() {
    return execute(accountService.profit(request.get("user"), request.get("owner"), request.getAsInt("type"),
            request.get("channel"), request.getAsLong("amount")), 14, "profit");
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:12,代码来源:AccountCtrl.java

示例10: query

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "query", validates = {
        @Validate(validator = Validators.SIGN)
})
public Object query() {
    String state = request.get("state");
    if (validator.isEmpty(state))
        state = "-1";

    return transferService.query(request.get("type"), request.get("appId"), request.get("user"), request.get("orderNo"),
            request.get("billNo"), request.get("tradeNo"), numeric.toInt(state), request.get("start"), request.get("end"));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:12,代码来源:TransferCtrl.java

示例11: send

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "send", validates = {
        @Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 2),
        @Validate(validator = Validators.NOT_EMPTY, parameter = "receiver", failureCode = 10),
        @Validate(validator = Validators.SIGN),
        @Validate(validator = PushService.VALIDATOR_EXISTS_KEY, parameter = "key", failureCode = 11)
})
public Object send() {
    return pushService.send(request.get("key"), request.get("receiver"), request.getAsJsonObject("args"));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:10,代码来源:PushCtrl.java

示例12: remitIn

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "remit-in", 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 remitIn() {
    return execute(accountService.remitIn(request.get("user"), request.get("owner"), request.getAsInt("type"),
            request.get("channel"), request.getAsLong("amount")), 16, "remit-in");
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:12,代码来源:AccountCtrl.java

示例13: reject

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "reject", validates = {
        @Validate(validator = Validators.NOT_EMPTY, parameter = "ids", failureCode = 21),
        @Validate(validator = Validators.SIGN)
})
public Object reject() {
    return logService.reject(request.getAsArray("ids"));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:8,代码来源:LogCtrl.java

示例14: state

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "state", validates = {
        @Validate(validator = Validators.ID, parameter = "id", failureCode = 22),
        @Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "state", failureCode = 24),
        @Validate(validator = Validators.SIGN),
        @Validate(validator = UserService.VALIDATOR_EXISTS, parameter = "id", failureCode = 25)
})
public Object state() {
    userService.state(request.get("id"), request.getAsInt("state"));

    return "";
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:12,代码来源:UserCtrl.java

示例15: get

import org.lpw.tephra.ctrl.validate.Validate; //导入依赖的package包/类
@Execute(name = "get", validates = {
        @Validate(validator = Validators.NOT_EMPTY, parameter = "ids", failureCode = 1),
        @Validate(validator = Validators.SIGN)
})
public Object get() {
    return snapshotService.get(request.getAsArray("ids"));
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:8,代码来源:SnapshotCtrl.java


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