package com.ylx.companion.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylx.common.core.domain.R;
import com.ylx.companion.domain.dto.CompanionAllMerchantsDTO;
import com.ylx.companion.domain.dto.CompanionRecommendDTO;
import com.ylx.companion.domain.vo.CompanionAllMerchantsVo;
import com.ylx.companion.domain.vo.CompanionRecommendVO;
import com.ylx.companion.service.ICompanionRecommendService;
import com.ylx.massage.service.IMaProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 Administrator
 * @version 1.0
 * @date 2026/6/10 14:12
 */
@Api(tags = "陪玩推荐")
@RestController
@RequestMapping("/companion/recommend")
public class CompanionRecommendController {
    @Autowired
    private ICompanionRecommendService companionRecommendService;

    @Autowired
    private IMaProjectService iMaProjectService;

    @ApiOperation("首页陪玩推荐")
    @PostMapping("/list")
    public R<?> getRecommend(@RequestBody @Validated CompanionRecommendDTO dto) {
        CompanionRecommendVO vo = companionRecommendService.getRecommend(dto);
        return R.ok(vo);
    }

    @ApiOperation("首页获取陪玩全部商户")
    @PostMapping("/getCompanionAllMerchants")
    public R<Page<CompanionAllMerchantsVo>> getCompanionAllMerchants(@RequestBody @Validated CompanionAllMerchantsDTO dto) {
        Page<CompanionAllMerchantsVo> page = new Page<>(dto.getPageNo(),dto.getPageSize());
        return R.ok(companionRecommendService.getCompanionAllMerchants(page,dto));
    }

}