package com.sqx.modules.riderStation.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.goods.service.GoodsShopService;
import com.sqx.modules.riderStation.entity.RiderStation;
import com.sqx.modules.riderStation.service.RiderStationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags={"管理端-骑手站点"})
@RestController
@RequestMapping("/admin/riderStation")
public class AdminRiderStationController {

    @Autowired
    private RiderStationService riderStationService;

    @ApiOperation("添加站点")
    @PostMapping(value = "/saveStation")
    public Result saveStation(@RequestBody RiderStation riderStation){
        return riderStationService.saveStation(riderStation);
    }

    @ApiOperation("查询站点")
    @GetMapping(value = "/selectStationList")
    public Result selectStationList(Integer page,Integer size){
        return riderStationService.selectStationList(page,size);
    }

    @ApiOperation("修改站点")
    @PostMapping(value = "/updateStation")
    public Result updateStation(@RequestBody RiderStation riderStation){
        return riderStationService.updateStation(riderStation);
    }

    @ApiOperation("删除站点")
    @GetMapping(value = "/removeStation")
    public Result removeStation(Integer id){
        return riderStationService.removeStation(id);
    }

    @ApiOperation("站点下拉框")
    @GetMapping(value = "/stationList")
    public Result stationList(){
        return riderStationService.stationList();
    }


    @ApiOperation("骑手所在站点")
    @GetMapping(value = "/getRiderStationName")
    public Result getRiderStationName(Integer userId){
        return riderStationService.getRiderStationName(userId);
    }
}
