package com.mcwl.web.controller.resource;

import com.mcwl.common.core.domain.R;
import com.mcwl.resource.domain.Collect;
import com.mcwl.resource.domain.vo.PageVo;
import com.mcwl.resource.service.impl.CollectServiceImpl;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 收藏
 * @author DaiZibo
 * @date 2025/3/5
 * @apiNote
 */

@Slf4j
@Api(tags = "收藏")
@RestController
@RequestMapping("/collect")
public class CollectController {

    @Autowired
    private CollectServiceImpl collectService;

    /**
     * 添加收藏
     * @param collect
     * @return
     */
    @ApiOperation(value = "添加收藏")
    @PostMapping("/addCollect")
    public R addCollect(@RequestBody Collect collect){

        return collectService.addCollect(collect);
    }


    /**
     * 查询收藏列表
     * @param pageVo
     * @return
     */
    @ApiOperation(value = "查询收藏列表")
    @PostMapping("/selectCollect")
    public R selectCollect(@RequestBody PageVo pageVo){


        return collectService.selectCollect(pageVo);
    }

}
