首页>代码>SpringBoot整合drools极简入门实例 drools规则引擎入门实例>/springboot-drools/src/main/java/com/simon/springbootdrools/controller/RuleController.java
package com.simon.springbootdrools.controller; import com.simon.springbootdrools.domain.Message; import com.simon.springbootdrools.service.DroolsService; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * @author Simon */ @RestController @RequestMapping("/rule") public class RuleController { @Resource private DroolsService droolsService; @RequestMapping("hello") public String hello() { return droolsService.fireRule("Hello World", Message.HELLO); } @RequestMapping("bye") public String bye() { return droolsService.fireRule("Good Bye", Message.GOODBYE); } }