package com.bjtdba.wares.controller;

import com.bjtdba.wares.service.WaresDetailService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wares_service/waresServiceDetail")
public class WaresDetailController {

    @Autowired
    private WaresDetailService waresDetailService;

    /**
     * 商品详情页面
     * @param product_id
     * @return
     */
    @GetMapping("/waresDetail")
    public Object waresDetail(@RequestParam(required = false, name = "product_id") Integer product_id){
        return waresDetailService.waresDetail(product_id);
    }

    /**
     *  商品价格
     * @param product_id
     * @param sort_ids
     * @return
     */
    @GetMapping("/productAttrValue")
    public Object productAttrValue(@RequestParam()Integer product_id,String sort_ids){
        return waresDetailService.productAttrValue(product_id,sort_ids);
    }

}
