| package com.mzl.flower.web.supplier; | 
|   | 
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
| import com.mzl.flower.base.BaseController; | 
| import com.mzl.flower.base.R; | 
| import com.mzl.flower.base.ReturnDataDTO; | 
| import com.mzl.flower.dto.response.supplier.StationDTO; | 
| import com.mzl.flower.entity.supplier.Station; | 
| import com.mzl.flower.service.supplier.StationService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.http.ResponseEntity; | 
| import org.springframework.validation.annotation.Validated; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| @RestController | 
| @RequestMapping("/api/station") | 
| @Api(value = "运营-总仓/集货站管理", tags = "运营-总仓/集货站管理") | 
| @Validated | 
| @Slf4j | 
| public class StationController extends BaseController { | 
|   | 
|     private final StationService stationService; | 
|   | 
|     public StationController(StationService stationService) { | 
|         this.stationService = stationService; | 
|     } | 
|   | 
|   | 
|     @PostMapping("/add") | 
|     @ApiOperation(value = "新增", notes = "新增") | 
|     public ResponseEntity<ReturnDataDTO> add(@Validated @RequestBody Station dto) { | 
|         stationService.add(dto); | 
|         return returnData(R.SUCCESS.getCode(),null); | 
|     } | 
|   | 
|     @PostMapping("/update") | 
|     @ApiOperation(value = "修改", notes = "修改") | 
|     public ResponseEntity<ReturnDataDTO> update(@Validated @RequestBody Station dto) { | 
|         stationService.update(dto); | 
|         return returnData(R.SUCCESS.getCode(),null); | 
|     } | 
|   | 
|     @PostMapping("/delete/{id}") | 
|     @ApiOperation(value = "删除", notes = "删除") | 
|     public ResponseEntity<ReturnDataDTO> delete(@PathVariable("id") Long id) { | 
|         stationService.delete(id); | 
|         return returnData(R.SUCCESS.getCode(),null); | 
|     } | 
|   | 
|     @GetMapping("/detail/{id}") | 
|     @ApiOperation(value = "详情", notes = "详情") | 
|     public ResponseEntity<ReturnDataDTO<StationDTO>> detail(@PathVariable("id") Long id) { | 
|         return returnData(R.SUCCESS.getCode(),stationService.detail(id)); | 
|     } | 
|   | 
|     @GetMapping("/page") | 
|     @ApiOperation(value = "查询-分页", notes = "查询-分页") | 
|     public ResponseEntity<ReturnDataDTO<Page<StationDTO>>> queryPage(String name, Page page) { | 
|         return returnData(R.SUCCESS.getCode(), stationService.queryPage(name,page)); | 
|     } | 
|   | 
|     @GetMapping("/list") | 
|     @ApiOperation(value = "查询-全部", notes = "查询-全部") | 
|     public ResponseEntity<ReturnDataDTO<Page<StationDTO>>> queryList(String name) { | 
|         return returnData(R.SUCCESS.getCode(), stationService.queryList(name)); | 
|     } | 
| } |