package com.sqx.modules.timedtask.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.timedtask.service.RiderLocationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags={"定时任务-定时任务"})
@RestController
@RequestMapping("/timedtask")
public class RiderLocationController {

    @Autowired
    private RiderLocationService riderLocationService;

    @ApiOperation("骑手定时更新经纬度")
    @GetMapping(value = "riderLocation")
    public Result riderLocation(Long userId, Double lng, Double lat, String province, String city, String district){

        return riderLocationService.riderLocation(userId, lng, lat, province, city, district);
    }

    @ApiOperation("查骑手即时位置、距离、预计送达时间")
    @GetMapping(value = "selectRiderLocation")
    public Result selectRiderLocation(Long riderUserId, Double lng, Double lat){

        return riderLocationService.selectRiderLocation(riderUserId, lng, lat);
    }

    @ApiOperation("管理端查看骑手定位骑手")
    @GetMapping(value = "selectAllRiderLocation")
    public Result selectAllRiderLocation(String province, String city, String district){

        return riderLocationService.selectAllRiderLocation(province, city, district);
    }


}
