AgvStationController.java
1022 Bytes
package com.huaheng.api.acs.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.huaheng.api.acs.domain.AgvStation;
import com.huaheng.api.acs.mapper.AgvStationMapper;
import com.huaheng.framework.web.domain.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/agv")
public class AgvStationController {
@Resource
private AgvStationMapper agvStationMapper;
@PostMapping("/stationList")
public AjaxResult stationList(){
List<AgvStation> agvStations = agvStationMapper.selectList(new LambdaQueryWrapper<>());
List<String> collect = agvStations.stream().map(t -> t.getAgvLineName()).collect(Collectors.toList());
return AjaxResult.success("成功",collect);
}
}