配置充电停车优惠

This commit is contained in:
Guoqs
2025-02-17 16:15:54 +08:00
parent f7057f925f
commit bf673bc5bf
9 changed files with 252 additions and 106 deletions

View File

@@ -0,0 +1,46 @@
package com.jsowell.web.controller.pile;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.pile.domain.ChargeParkingDiscount;
import com.jsowell.pile.service.ChargeParkingDiscountService;
import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 充电停车优惠
*
* @author xxxxx
*/
@RestController
@RequestMapping("/pile/station")
public class ChargeParkingDiscountController extends BaseController {
@Resource
private ChargeParkingDiscountService chargeParkingDiscountService;
/**
* 保存充电停车优惠配置
*/
@PostMapping("/saveChargeParkingDiscount")
public AjaxResult saveChargeParkingDiscount(@RequestBody ChargeParkingDiscount chargeParkingDiscount) {
int result = chargeParkingDiscountService.insertOrUpdateSelective(chargeParkingDiscount);
if (result > 0) {
return success();
} else {
return error();
}
}
/**
* 查询站点充电停车优惠配置
*/
@GetMapping("/getChargeParkingDiscount/{stationId}")
public AjaxResult getChargeParkingDiscount(@PathVariable("stationId") String stationId) {
ChargeParkingDiscountVO chargeParkingDiscountVO = chargeParkingDiscountService.getChargeParkingDiscount(stationId);
return AjaxResult.success(chargeParkingDiscountVO);
}
}