package com.tmerclub.cloud.search.controller.app;

import com.tmerclub.cloud.api.dto.EsPageDTO;
import com.tmerclub.cloud.api.vo.EsPageVO;
import com.tmerclub.cloud.common.local.dto.CueProductSearchDTO;
import com.tmerclub.cloud.common.local.vo.CueProductSearchVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.search.manager.LocalCueProductSearchManager;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 本地生活-球杆商品搜索
 *
 * @author: frank
 * @create: 2025-04-12
 **/
@Tag(name = "本地生活-球杆商品搜索")
@RestController("localCueProductSearchController")
@RequestMapping("/ua/cueProductSearch")
public class LocalCueProductSearchController {

    @Resource
    LocalCueProductSearchManager localCueProductSearchManager;

    /**
     * APP端搜索球杆商品接口
     *
     * @param pageDTO             分页参数
     * @param cueProductSearchDTO 搜索参数
     * @return 分页结果集
     */
    @GetMapping("/searchCueProductPage")
    @Operation(summary = "APP端搜索球杆商品接口", description = "APP端搜索球杆商品接口")
    public ServerResponseEntity<EsPageVO<CueProductSearchVO>> searchCueProductPage(@Valid EsPageDTO pageDTO, @Valid CueProductSearchDTO cueProductSearchDTO) {
        EsPageVO<CueProductSearchVO> page = localCueProductSearchManager.page(pageDTO, cueProductSearchDTO);
        return ServerResponseEntity.success(page);
    }
}