| | |
| | | |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | |
| | | public class TChargingGunController { |
| | | |
| | | private final TChargingGunService chargingGunService; |
| | | |
| | | @Resource |
| | | private TChargingPileService chargingPileService; |
| | | |
| | | @Autowired |
| | | public TChargingGunController(TChargingGunService chargingGunService) { |
| | |
| | | public void downloadQRCode(@PathVariable Integer id, HttpServletResponse response){ |
| | | // todo 待完善 |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取充电枪完整名称 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/getAllName/{id}") |
| | | public R<String> getAllName(@PathVariable Integer id){ |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | TChargingPile chargingPile = chargingPileService.getById(chargingGun.getChargingPileId()); |
| | | return R.ok(chargingPile.getName() + chargingGun.getName()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取充电枪详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/getChargingGunById/{id}") |
| | | public R<TChargingGun> getChargingGunById(@PathVariable Integer id){ |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | return R.ok(chargingGun); |
| | | } |
| | | } |
| | | |