
package com.tmerclub.cloud.flow.controller.multishop;

import com.tmerclub.cloud.api.product.dto.ProdEffectDTO;
import com.tmerclub.cloud.api.product.vo.ProdEffectRespVO;
import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.common.i18n.I18nMessage;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.common.security.AuthUserContext;
import com.tmerclub.cloud.flow.service.ProductAnalyseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 流量分析—商品分析
 *
 * @author YXF
 * @date 2021-05-21 15:25:19
 */
@RestController("multishopProductAnalyseController")
@RequestMapping("/m/productAnalyse")
@Tag(name = "流量分析—商品分析")
public class ProductAnalyseController {

    @Autowired
    private ProductAnalyseService productAnalyseService;

    @GetMapping("/getProductEffect")
    @Operation(summary = "获取商家端商品洞察数据", description = "获取商品洞察数据")
    public ServerResponseEntity<PageVO<ProdEffectRespVO>> getProductEffect(@Valid PageDTO pageDTO, ProdEffectDTO prodEffectDTO) {
        prodEffectDTO.setShopId(AuthUserContext.get().getTenantId());
        prodEffectDTO.setLang(I18nMessage.getLang());
        return ServerResponseEntity.success(productAnalyseService.getProductEffect(pageDTO,prodEffectDTO));
    }
}
