Package fr.ippon.tatami.web.rest.dto

Examples of fr.ippon.tatami.web.rest.dto.Preferences


    public Preferences getPreferences() {
        this.log.debug("REST request to get account's preferences");
        User currentUser = authenticationService.getCurrentUser();
        User user = userService.getUserByLogin(currentUser.getLogin());

        Preferences preferences = new Preferences(user);
        return preferences;
    }
View Full Code Here


            produces = "application/json")
    @ResponseBody
    @Timed
    public Preferences updatePreferences(@RequestBody Preferences newPreferences, HttpServletResponse response) {
        this.log.debug("REST request to set account's preferences");
        Preferences preferences = null;
        try {
            User currentUser = authenticationService.getCurrentUser();
            currentUser.setPreferencesMentionEmail(newPreferences.getMentionEmail());
            currentUser.setDailyDigestSubscription(newPreferences.getDailyDigest());
            currentUser.setWeeklyDigestSubscription(newPreferences.getWeeklyDigest());

            String rssUid = userService.updateRssTimelinePreferences(newPreferences.getRssUidActive());
            currentUser.setRssUid(rssUid);

            preferences = new Preferences(currentUser);

            userService.updateUser(currentUser);
            userService.updateDailyDigestRegistration(newPreferences.getDailyDigest());
            userService.updateWeeklyDigestRegistration(newPreferences.getWeeklyDigest());
View Full Code Here

                .andExpect(status().isOk())
                .andExpect(content().contentType("application/json"))
                .andExpect(jsonPath("$.rssUidActive").value(true))
                .andReturn().getResponse().getContentAsString();

        Preferences preferences = new ObjectMapper().readValue(preferencesAsJson, Preferences.class);

        String rssId = preferences.getRssUid();

        ModelAndView result = mockMvc.perform(get("/syndic/" + rssId))
                .andExpect(status().isOk())
                .andReturn().getModelAndView();
View Full Code Here

TOP

Related Classes of fr.ippon.tatami.web.rest.dto.Preferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.