| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | @RestController |
| | | @RequestMapping("profession") |
| | |
| | | @Resource |
| | | ProfessionService professionService; |
| | | @GetMapping(value = "getall") |
| | | public ResultBean<List<Profession>> getALL(){ |
| | | return new ResultBean<>(professionService.getProfessiontList()); |
| | | public ResultBean<List<Profession>> getALL(Optional<String> name){ |
| | | String queryName = name.isPresent()?name.get():null; |
| | | return new ResultBean<>(professionService.queryByName(queryName)); |
| | | } |
| | | } |