當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。