本文整理汇总了Java中org.jooby.Results.with方法的典型用法代码示例。如果您正苦于以下问题:Java Results.with方法的具体用法?Java Results.with怎么用?Java Results.with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jooby.Results
的用法示例。
在下文中一共展示了Results.with方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doUpdateEventTypePerAccount
import org.jooby.Results; //导入方法依赖的package包/类
public static Result doUpdateEventTypePerAccount(final ConfigurationDao dao, final UUID kbAccountId,
final UUID kbTenantId, final List<ExtBusEventType> eventTypes,
final DateTime utcNow)
{
logger.debug(String.format("Enters update event types per account %s",kbAccountId));
if (kbTenantId == null)
{
return Results.with("No tenant specified",Status.NOT_FOUND);
}
if (kbAccountId == null)
{
return Results.with("No account specified",Status.NOT_FOUND);
}
try {
dao.updateConfigurationPerAccount(kbAccountId,kbTenantId,eventTypes,utcNow);
} catch (SQLException e) {
logger.error(e.getMessage());
return Results.with(e.getMessage(), Status.SERVER_ERROR);
}
return Results.with(Status.CREATED);
}
示例2: getEventTypes
import org.jooby.Results; //导入方法依赖的package包/类
public static Result getEventTypes(final ConfigurationDao dao, final List<UUID> kbAccountId, final UUID kbTenantId)
{
logger.debug(String.format("Enters get event types for %s accounts - %s",kbAccountId.size(),kbTenantId));
List<EmailNotificationsConfiguration> eventTypes = null;
try {
eventTypes = dao.getEventTypes(kbAccountId, kbTenantId);
} catch (SQLException e) {
logger.error(e.getMessage());
return Results.with(e.getMessage(), Status.SERVER_ERROR);
}
return eventTypes == null || eventTypes.size() == 0? Results.with(Status.NOT_FOUND) : Results.json(eventTypes);
}
示例3: getEventTypesPerAccount
import org.jooby.Results; //导入方法依赖的package包/类
public static Result getEventTypesPerAccount(final ConfigurationDao dao, final UUID kbAccountId, final UUID kbTenantId)
{
logger.debug(String.format("Enters get event types %s - %s",kbAccountId,kbTenantId));
List<EmailNotificationsConfiguration> eventTypes = null;
try {
eventTypes = dao.getEventTypesPerAccount(kbAccountId, kbTenantId);
} catch (SQLException e) {
logger.error(e.getMessage());
return Results.with(e.getMessage(), Status.SERVER_ERROR);
}
return eventTypes == null || eventTypes.size() == 0? Results.with(Status.NOT_FOUND) : Results.json(eventTypes);
}
示例4: getEventTypePerAccount
import org.jooby.Results; //导入方法依赖的package包/类
public static Result getEventTypePerAccount(final ConfigurationDao dao, final UUID kbAccountId, final UUID kbTenantId, final ExtBusEventType eventType )
{
logger.debug(String.format("Enters get event type %s - %s",kbAccountId,kbTenantId));
EmailNotificationsConfiguration eventTypeRsp = null;
try {
eventTypeRsp = dao.getEventTypePerAccount(kbAccountId, kbTenantId, eventType);
} catch (SQLException e) {
logger.error(e.getMessage());
return Results.with(e.getMessage(), Status.SERVER_ERROR);
}
return eventTypeRsp == null ? Results.with(Status.NOT_FOUND) : Results.json(eventTypeRsp);
}
示例5: wrap
import org.jooby.Results; //导入方法依赖的package包/类
private Result wrap(final Object value) {
if (value instanceof Result) {
return (Result) value;
}
return Results.with(value);
}