All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.greennlab.ddul.menu.web.MenuController Maven / Gradle / Ivy

Go to download

DDul means "ground" in korean prounance. It helps to you when concreate a java projects. And support with database access, cache abstraction, system code generation, hierarchical data handling, article management and etc.

There is a newer version: 0.3.0
Show newest version
package io.github.greennlab.ddul.menu.web;

import io.github.greennlab.ddul.menu.Menu;
import io.github.greennlab.ddul.menu.service.MenuService;
import java.util.List;
import javax.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("DDulMenuController")
@RequestMapping("_menu")
@RequiredArgsConstructor
public class MenuController {

  private final MenuService service;


  @GetMapping
  public Menu.Dto getAllMenus(Long id) {
    return service.getAllMenus(id);
  }

  @GetMapping("id")
  public Long getNextSequence() {
    return service.getNextSequence();
  }

  @PostMapping("/add")
  public Menu.Dto save(@Valid @RequestBody Menu.Dto dto) {
    return service.save(dto);
  }

  @PostMapping("/save")
  public void saveAll(@Valid @RequestBody List dtos) {
    service.saveAll(dtos);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy