package com.ylx.massage.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylx.common.core.domain.R;
import com.ylx.massage.domain.dto.MassageAllMerchantsDto;
import com.ylx.massage.domain.dto.MassageMerchantRecommendDto;
import com.ylx.massage.domain.dto.MassageProjectRecommendDTO;
import com.ylx.massage.domain.vo.MassageAllMerchantsVo;
import com.ylx.massage.domain.vo.MassageProjectRecommendVo;
import com.ylx.massage.domain.vo.MerchantVo;
import com.ylx.massage.service.IMassageRecommendService;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 类描述：按摩推荐
 *
 * @author Administrator
 * @version 1.0
 * @date 2026/6/2 16:36
 */
@Slf4j
@RestController
@Api(tags = {"首页按摩推荐"})
@RequestMapping("/home/massage")
public class MassageRecommendController {

    @Autowired
    private IMassageRecommendService massageRecommendService;

    @ApiOperation(value = "首页按摩商户推荐", notes = "首页按摩商户推荐")
    @PostMapping(value = "/getMerchantRecommend")
    public R<List<MerchantVo>> getMerchantRecommend(@RequestBody MassageMerchantRecommendDto dto) {
        List<MerchantVo> massageRecommendVos = massageRecommendService.getMerchantRecommend(dto);
        return R.ok(massageRecommendVos);
    }

    @ApiOperation(value = "首页按摩项目推荐", notes = "首页按摩项目推荐")
    @PostMapping(value = "/getMassageProjectRecommend")
    public R<Page<MassageProjectRecommendVo>> getMassageProjectRecommend(@Validated @RequestBody MassageProjectRecommendDTO dto) {
        Page<MassageProjectRecommendVo> page = new Page<>(dto.getCurrent(), dto.getSize());
        return R.ok(massageRecommendService.getMassageProjectRecommend(page, dto.getCityCode()));
    }

    @ApiOperation(value = "首页按摩推荐商户点击全部查询按摩所有商户", notes = "首页按摩推荐商户点击全部查询按摩所有商户")
    @PostMapping(value = "/getMassageAllMerchants")
    public R<Page<MassageAllMerchantsVo>> getMassageAllMerchants(@Validated @RequestBody MassageAllMerchantsDto dto) {
        Page<MassageAllMerchantsVo> page = new Page<>(dto.getCurrent(), dto.getSize());
        return R.ok(massageRecommendService.getMassageAllMerchants(page, dto));
    }


}