package com.bjtdba.thirdPartWares.controller;

import com.bjtdba.thirdPartWares.service.TaobaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.Map;

/**
 * 第三方淘宝接口
 */
@RestController
@RequestMapping("thirdPartyWares_service/taobao_service")
public class TaobaoController {

    @Autowired
    private TaobaoService taobaoService;

    /**
     *列表接口   keyWords等于空就是列表接口      要是传参数就搜索接口
     */
    @PostMapping("/selectTaobaoWaresList")
    public Object selectTaobaoWaresList(@RequestBody Map<String,String> map){
        return taobaoService.selectTaobaoWaresListNew(map.get("pageNum"),map.get("pageSize"),map.get("title"),map.get("cid"));
    }

    @GetMapping("/taobaodingshi")
    public Object taobaodingshi(){
        return taobaoService.saveThirdPartGood();
    }


    /**
     *商品详情页面
     */
    @PostMapping("/taobaoWaresDetail")
    public Object taobaoWaresDetail(@RequestBody Map<String,String> map) throws ParseException {
        return taobaoService.taobaoWaresDetail(map.get("id"));
    }
    /**
     * 高效转链接口
     */
    @PostMapping("/dtkchangeLink")
    public Object dtkchangeLink(@RequestBody Map<String,String> map){
        return taobaoService.dtkchangeLink(map.get("id"),map.get("uid"));
    }







}
