package bus.controller.biz;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageSerializable;
import bus.model.dto.BUserCourseDto;
import bus.model.dto.BUserCoursePageDto;
import bus.model.vo.BUserCourseVo;
import bus.model.dto.WBusTrackInfoDto;
import bus.service.BUserCourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.qzwisdom.qzframework.core.tool.base.controller.BaseController;

import java.util.List;

/**
 * @Program: bus
 * @Description: 描述
 * @Author: zy
 * @Date: 2025-03-11 18:22:22
 **/
@Slf4j
@CrossOrigin
@RestController
@Api(tags = "收藏接口")
@RequestMapping(value="/bUserCourse")
public class BUserCourseController implements BaseController {

    @Autowired
    private BUserCourseService bUserCourseService;

    @PostMapping("/save")
    @ApiOperation(value = "收藏-取消-路线")
    public void save(@RequestBody BUserCourseDto dto) {
        bUserCourseService.save(dto);
    }

    @PostMapping("/topCourse")
    @ApiOperation(value = "顶置路线")
    public void topCourse(@RequestParam String courseId) {
        bUserCourseService.topCourse(courseId);
    }

    @GetMapping("/getMyCourse")
    @ApiOperation(value = "我的路线列表")
    public List<WBusTrackInfoDto> getMyCourse() {
        return bUserCourseService.getMyCourse();
    }

    @PostMapping("/delete")
    @ApiOperation(value = "取消收藏")
    public void delete(@RequestParam String courseId) {
        bUserCourseService.delete(courseId);
    }
}
