fengxiang
2018-07-06 ff93ecd1f2cb4c5ae8459430dd3e09fedad0e3ea
src/main/java/com/moral/controller/ProfessionController.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;
@RestController
@RequestMapping("profession")
@@ -16,7 +17,8 @@
      @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));
      }
}