package com.bjtdba.userCenter.controller;

import com.bjtdba.userCenter.service.SharePostersService;
import com.bjtdba.userCenter.service.UserShareProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("userCenter_service/userShareProductService")
public class UserShareProductController {

    @Autowired
    private UserShareProductService userShareProductService;
    @Autowired
    private SharePostersService sharePostersService;

    /**
     * 用户分享产品列表
     */
    @GetMapping("/userShareProductList")
    public Object UserShareProduct(Integer pageNum,Integer pageSize,Integer uid,String start_time,String end_time){
        return userShareProductService.UserShareProductList(pageNum,pageSize,uid,start_time,end_time);
    }
    /**
     * 用户分享背景图分类列表
     */
    @PostMapping("/classifyList")
    public Object classify(){
        return sharePostersService.selectPosters();
    }

    /**
     * 1、分类id   classify
     * 2、是否推荐  type 0 不推荐   1推荐
     * @return
     */
    @PostMapping("/shareImgesList")
    public Object shareImgesList(@RequestBody Map<String,String> map){
        return sharePostersService.selectImgesList(Integer.parseInt(map.get("pageNum")),Integer.parseInt(map.get("pageSize")),map.get("classify"),map.get("type"));
    }

}
