本文整理汇总了Java中org.lpw.tephra.ctrl.validate.Validators.BETWEEN属性的典型用法代码示例。如果您正苦于以下问题:Java Validators.BETWEEN属性的具体用法?Java Validators.BETWEEN怎么用?Java Validators.BETWEEN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.lpw.tephra.ctrl.validate.Validators
的用法示例。
在下文中一共展示了Validators.BETWEEN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: save
@Execute(name = "save", validates = {
@Validate(validator = Validators.ID, parameter = "region", failureCode = 2),
@Validate(validator = Validators.NOT_EMPTY, parameter = "detail", failureCode = 3),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "detail", failureCode = 4),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "postcode", failureCode = 5),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "name", failureCode = 12),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "phone", failureCode = 13),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "latitude", failureCode = 6),
@Validate(validator = Validators.LATITUDE, emptyable = true, parameter = "latitude", failureCode = 7),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "longitude", failureCode = 8),
@Validate(validator = Validators.LONGITUDE, emptyable = true, parameter = "longitude", failureCode = 9),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "label", failureCode = 10),
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "major", failureCode = 11),
@Validate(validator = UserHelper.VALIDATOR_SIGN_IN),
@Validate(validator = AddressService.VALIDATOR_UPDATABLE, emptyable = true, parameter = "id", failureCode = 1)
})
public Object save() {
return addressService.save(request.setToModel(new AddressModel()));
}
示例2: send
@Execute(name = "send", validates = {
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "type", failureCode = 1),
@Validate(validator = Validators.ID, parameter = "receiver", failureCode = 2),
@Validate(validator = Validators.BETWEEN, number = {0, 9}, parameter = "format", failureCode = 3),
@Validate(validator = Validators.NOT_EMPTY, parameter = "content", failureCode = 4),
@Validate(validator = Validators.MATCH_REGEX, string = {"^[a-zA-Z0-9]{1,64}$"}, parameter = "code", failureCode = 5),
@Validate(validator = UserHelper.VALIDATOR_SIGN_IN)
})
public Object send() {
int type = request.getAsInt("type");
String id = messageService.send(type, request.get("receiver"), request.getAsInt("format"), request.get("content"), request.getAsInt("deadline"), request.get("code"));
if (id != null)
return id;
return templates.get().failure(type == 1 ? 1807 : 1806, message.get(MessageModel.NAME + (type == 1 ? ".group" : ".friend") + ".not-exists"), null, null);
}
示例3: notice
@Execute(name = "notice", validates = {
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "type", failureCode = 1),
@Validate(validator = Validators.ID, parameter = "receiver", failureCode = 2),
@Validate(validator = Validators.NOT_EMPTY, parameter = "content", failureCode = 4),
@Validate(validator = Validators.MATCH_REGEX, string = {"^[a-zA-Z0-9]{1,64}$"}, parameter = "code", failureCode = 5),
@Validate(validator = Validators.SIGN)
})
public Object notice() {
return messageService.notice(request.getAsInt("type"), request.get("receiver"), request.get("content"), request.getAsInt("deadline"), request.get("code"));
}
示例4: create
@Execute(name = "create", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "name", failureCode = 1),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "name", failureCode = 2),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "note", failureCode = 3),
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "audit", failureCode = 4),
@Validate(validator = UserHelper.VALIDATOR_SIGN_IN)
})
public Object create() {
return groupService.create(request.get("name"), request.get("note"), request.getAsInt("audit"));
}
示例5: audit
@Execute(name = "audit", validates = {
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "audit", failureCode = 4),
@Validate(validator = GroupService.VALIDATOR_OWNER, parameter = "id", failureCode = 5)
})
public Object audit() {
return groupService.audit(request.get("id"), request.getAsInt("audit"));
}
示例6: query
@Execute(name = "query", validates = {
@Validate(validator = Validators.BETWEEN, number = {0, 2}, parameter = "audit", failureCode = 9),
@Validate(validator = Validators.SIGN)
})
public Object query() {
return commentService.query(request.getAsInt("audit"), request.get("owner"), request.get("author"), dateTime.getStart(request.get("start")), dateTime.getEnd(request.get("end")));
}
示例7: create
@Execute(name = "create", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "key", failureCode = 2),
@Validate(validator = Validators.ID, parameter = "owner", failureCode = 3),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "subject", failureCode = 5),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "label", failureCode = 6),
@Validate(validator = Validators.NOT_EMPTY, parameter = "content", failureCode = 7),
@Validate(validator = Validators.BETWEEN, number = {0, 5}, parameter = "score", failureCode = 8),
@Validate(validator = UserHelper.VALIDATOR_EXISTS_OR_SIGN_IN, parameter = "author", failureCode = 4)
})
public Object create() {
return commentService.create(request.setToModel(new CommentModel()));
}
示例8: complete
@Execute(name = "complete", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "orderNo", failureCode = 6),
@Validate(validator = Validators.GREATER_THAN, number = {0}, parameter = "amount", failureCode = 4),
@Validate(validator = Validators.NOT_EMPTY, parameter = "tradeNo", failureCode = 7),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "tradeNo", failureCode = 8),
@Validate(validator = Validators.BETWEEN, number = {1, 2}, parameter = "state", failureCode = 9),
@Validate(validator = Validators.SIGN),
@Validate(validator = PaymentService.VALIDATOR_EXISTS, parameter = "orderNo", failureCode = 10)
})
public Object complete() {
return paymentService.complete(request.get("orderNo"), request.getAsInt("amount"), request.get("tradeNo"),
request.getAsInt("state"), request.getMap());
}
示例9: query
@Execute(name = "query", validates = {
@Validate(validator = Validators.BETWEEN, number = {0, 3}, parameter = "state", failureCode = 5),
@Validate(validator = UserHelper.VALIDATOR_SIGN_IN)
})
public Object query() {
return friendService.query(request.getAsInt("state"));
}
示例10: signUp
@Execute(name = "sign-up", validates = {
@Validate(validator = Validators.NOT_EMPTY, parameter = "uid", failureCode = 1),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "uid", failureCode = 2),
@Validate(validator = UserService.VALIDATOR_PASSWORD, parameter = "password", failureCode = 3),
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "type", failureCode = 27),
@Validate(validator = AuthService.VALIDATOR_UID_NOT_EXISTS, parameter = "uid", failureCode = 4)
})
public Object signUp() {
userService.signUp(request.get("uid"), request.get("password"), UserService.Type.values()[request.getAsInt("type")]);
return sign();
}
示例11: signIn
@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();
}
示例12: modify
@Execute(name = "modify", validates = {
@Validate(validator = Validators.MAX_LENGTH, number = {100}, emptyable = true, parameter = "idcard", failureCode = 7),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, emptyable = true, parameter = "name", failureCode = 8),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, emptyable = true, parameter = "nick", failureCode = 9),
@Validate(validator = Validators.MOBILE, emptyable = true, parameter = "mobile", failureCode = 10),
@Validate(validator = Validators.EMAIL, emptyable = true, parameter = "email", failureCode = 11),
@Validate(validator = Validators.MAX_LENGTH, number = {100}, emptyable = true, parameter = "email", failureCode = 12),
@Validate(validator = Validators.BETWEEN, number = {0, 2}, emptyable = true, parameter = "gender", failureCode = 13),
@Validate(validator = UserService.VALIDATOR_SIGN)
})
public Object modify() {
userService.modify(request.setToModel(new UserModel()));
return sign();
}
示例13: grade
@Execute(name = "grade", validates = {
@Validate(validator = Validators.ID, parameter = "id", failureCode = 22),
@Validate(validator = Validators.BETWEEN, number = {0, 99}, parameter = "grade", failureCode = 23),
@Validate(validator = Validators.SIGN),
@Validate(validator = UserService.VALIDATOR_EXISTS, parameter = "id", failureCode = 25)
})
public Object grade() {
userService.grade(request.get("id"), request.getAsInt("grade"));
return "";
}
示例14: state
@Execute(name = "state", validates = {
@Validate(validator = Validators.ID, parameter = "id", failureCode = 1),
@Validate(validator = Validators.BETWEEN, number = {0, 1}, parameter = "state", failureCode = 8),
@Validate(validator = Validators.SIGN),
@Validate(validator = PushService.VALIDATOR_EXISTS, parameter = "id", failureCode = 9)
})
public Object state() {
return pushService.state(request.get("id"), request.getAsInt("state"));
}
示例15: withdraw
@Execute(name = "withdraw", 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 withdraw() {
return execute(accountService.withdraw(request.get("user"), request.get("owner"), request.getAsInt("type"),
request.get("channel"), request.getAsLong("amount"), request.getMap()), 12, "withdraw");
}