@AccessLevel(level = 2) public Result create() { Form<ActivityChoice> choiceForm = Form.form(ActivityChoice.class).bindFromRequest(); if (choiceForm.hasErrors()) { return status( ErrDefinition.E_ACTIVITY_CHOICE_FORM_HASERROR, Messages.get("activitychoice.failure")); } try { ActivityChoice choice = choiceForm.get(); choice.id = CodeGenerator.GenerateUUId(); choice.content = new ActivityContent(); choice.content.id = choice.id; Ebean.save(choice); return ok(Json.toJson(choice)); } catch (Throwable e) { return status( ErrDefinition.E_ACTIVITY_CHOICE_CREATE_FAILED, Messages.get("activitychoice.failure")); } }
public static void ConvertDescription(ActivityChoice choice) { if (choice.type == 1) { int limit = choice.content.max_selection; Date startTime = choice.content.activity.startTime; Date endTime = choice.content.activity.endTime; choice.description = AppProfileGiftController.getGiftStatus( choice.choice, startTime, endTime, limit, Integer.parseInt(choice.description)) .toString(); } }