package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.pojo.db_batt.StationPowerRelation; import com.whyc.service.StationPowerRelationService; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @Api(tags = "机房电源关系") @RequestMapping("stationPowerRelation") public class StationPowerRelationController { @Autowired private StationPowerRelationService service; @PostMapping("add") public Response add(@RequestBody StationPowerRelation relation){ service.add(relation.getStationId(),relation.getPowerId()); return new Response().setII(1,"新增完成"); } }