package com.sqx.modules.fixedStroke.controller.app;

import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.fixedStroke.entity.FixedStroke;
import com.sqx.modules.fixedStroke.service.FixedStrokeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;


@RestController
@Api(value = "一口价行程-用户端", tags = {"一口价行程-用户端"})
@RequestMapping("/app/fixedStroke")
public class AppFixedStrokeController {

    @Autowired
    private FixedStrokeService fixedStrokeService;

    @GetMapping("/selectFixedStrokeList")
    @ApiOperation("查询一口价行程列表")
    public Result selectFixedStrokeList(Integer page,Integer limit,String shipProvince,String shipCity,String shipDistrict,String shipAddress,
                                        String deliveryProvince,String deliveryCity,String deliveryDistrict,String deliveryAddress,Integer status){
        return Result.success().put("data",new PageUtils(fixedStrokeService.selectFixedStrokeList(page, limit, shipProvince, shipCity, shipDistrict,
                shipAddress, deliveryProvince, deliveryCity, deliveryDistrict, deliveryAddress, 1)));
    }

    @GetMapping("/selectShipCityList")
    @ApiOperation("查询所有出发地")
    public Result selectShipCityList(){
        return Result.success().put("data",fixedStrokeService.selectShipCityList());
    }

    @GetMapping("/selectDeliveryCityList")
    @ApiOperation("查询所有目的地")
    public Result selectDeliveryCityList(){
        return Result.success().put("data",fixedStrokeService.selectDeliveryCityList());
    }

}