package com.fdkankan.scene.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fdkankan.common.controller.BaseController;
import com.fdkankan.scene.service.IUserSceneService;
import com.fdkankan.scene.service.impl.UserSceneService;
import com.fdkankan.scene.vo.SceneParamVO;
import com.fdkankan.scene.vo.SceneVO;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 个人中心-我的场景
 */
@Log4j2
@RestController
@RequestMapping("/api/user/scene")
public class UserSceneController extends BaseController {

    @Autowired
    private IUserSceneService userSceneService;
    /**
     * 获取用户场景记录
     * pageNum          分页
     * searchKey        搜索条件
     * pageSize         每页大小
     */
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public Page<SceneVO> getScenes(@RequestBody SceneParamVO param) throws Exception {
        return userSceneService.getScenes(getToken(), param);

    }

}
