package com.bjtdba.api.controller;

import com.bjtdba.api.apiservice.OrderService;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RequestMapping("/api")
@RestController
@Configurable
public class OrderController {
    @Resource
    private OrderService orderService;

    @RequestMapping("/redisValue")
    public Object redisValue(@RequestBody Map<String,String> map, @RequestHeader Map<String,String> Hmap){
//       String ss=  orderService.getredisvalu().toString();
        String aa=map.get("orde");
        System.out.println("aa"+aa);
        String suid=Hmap.get("suid");
        System.out.println("suid=="+suid);

        String uid=Hmap.get("uid");
        System.out.println("uid=="+uid);
       return orderService.getredisvalu(uid);
    }

    /**
     * 大仓推荐分享
     * @param map
     * @return
     */
    @PostMapping("/recommend/share")
    public Object share(@RequestBody Map<String,String> map){
        return  orderService.share(map);
    }

    /**
     * 大仓推荐微信配置
     * @param map
     * @return
     */
    @PostMapping("recommend/wx_config")
    public Object wx_config(@RequestBody Map<String,String> map){
        return orderService.wx_config(map);
    }

    /**
     * 大仓推荐分类
     * @return
     */
    @GetMapping("/recommend/nologin/classify")
    public Object classify(){
        return orderService.classify();
    }

    /**
     * 大仓商品列表
     */

    @GetMapping("recommend/nologin/da_cang_product_lst")
    public Object seckill(@RequestParam Map<String,String> pmap){
        return orderService.seckill(pmap);
    }

    /**
     * 大仓推荐详情
     * @param map
     * @return
     */
    @PostMapping("recommend/detail")
    public Object Detail(@RequestBody Map<String,String> map){
        return orderService.Detail(map);
    }

    /**
     * 大仓推荐列表
     * @return
     */
    @GetMapping("recommend/lists")
    public Object lsts(){
        return orderService.lsts();
    }

    /**
     * 猜你喜欢查询list
     * @param pmap
     * @return
     */
    @GetMapping("store/product/recommend/lst")
    public Object lst(@RequestParam Map<String,String> pmap){
        return orderService.lst(pmap);
    }


    @GetMapping("store/merchant/category/lst")
    public Object queryCategorylistMerid(@RequestParam Map<String,String> pmap){
        Integer id=Integer.parseInt(pmap.get("id"));
        return  orderService.queryCategorylistMerid(id);
    }

}
