Created
August 15, 2021 16:29
-
-
Save jianhe-fun/2c8b810662169e1abed44313b63d94b3 to your computer and use it in GitHub Desktop.
Owner Controller Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jian.he.controllers; | |
import jian.he.services.OwnerService; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.ui.Model; | |
import org.springframework.web.bind.annotation.GetMapping; | |
@Controller | |
public class OwnerController { | |
private final OwnerService ownerService; | |
public OwnerController(OwnerService ownerService) { | |
this.ownerService = ownerService; | |
} | |
@GetMapping({"/owners","/owners/index","/owners/index.html"}) | |
public String listOwners(Model model){ | |
model.addAttribute("owners",ownerService.findAll()); | |
return "owners/index"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment