fengxiang
2018-03-19 00d2837b0056d84394df6ebcb4e779698c283c0d
src/main/java/com/moral/controller/MonitorPointController.java
@@ -6,6 +6,8 @@
import com.moral.service.MonitorPointService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.annotation.Resource;
@@ -33,7 +35,7 @@
     */
    @GetMapping("get-by-id")
    public ResultBean getById(Integer id){
        MonitorPoint monitorPoint = monitorPointService.selectWithRelationById(id);
        MonitorPoint monitorPoint = monitorPointService.queryWithRelationById(id);
        ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
        resultBean.setData(monitorPoint);
        return resultBean;
@@ -44,4 +46,11 @@
        ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
        return resultBean;
    }
    @GetMapping("list/{name}")
   public ResultBean<List<MonitorPoint>> getMonitorPointsByName(@PathVariable("name") String name) {
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByName(name);
      return new ResultBean<List<MonitorPoint>>(monitorPoints);
   }
}