Search in sources :

Example 1 with CreateAdvRequest

use of com.zavada.domain.CreateAdvRequest in project Logos_Materials_October_2017 by VolodymyrZavada.

the class UserController method createAdvertisement.

// --- Advertisement
@GetMapping("/{userId}/create")
public String createAdvertisement(@PathVariable("userId") int userId, Model model, Principal principal) {
    UserEntity entity = userService.findUserByEmail(principal.getName());
    CreateAdvRequest advRequest = new CreateAdvRequest();
    advRequest.setEntity(entity);
    model.addAttribute("title", "Create Advertisement");
    // model.addAttribute("userId", userId);
    model.addAttribute("advModel", advRequest);
    model.addAttribute("colors", Color.values());
    model.addAttribute("fuelTypes", FuelType.values());
    model.addAttribute("bodyTypes", BodyType.values());
    return "user/create-adv";
}
Also used : CreateAdvRequest(com.zavada.domain.CreateAdvRequest) UserEntity(com.zavada.entity.UserEntity) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

CreateAdvRequest (com.zavada.domain.CreateAdvRequest)1 UserEntity (com.zavada.entity.UserEntity)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1