package com.fs.qw.controller;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.R;
import com.fs.common.core.page.TableDataInfo;
import com.fs.qw.param.QwFriendWelcomeParam;
import com.fs.qw.service.IQwFriendWelcomeService;
import com.fs.qw.vo.QwFriendWelcomeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/qw/friendWelcome")
public class QwFriendWelcomeController extends BaseController {

    @Autowired
    private IQwFriendWelcomeService qwFriendWelcomeService;

    /**
     * 查询好友欢迎语列表
     */
    @PreAuthorize("@ss.hasPermi('qw:friendWelcome:list')")
    @GetMapping("/list")
    public TableDataInfo list(QwFriendWelcomeParam qwFriendWelcomeParam) {
        startPage();
        List<QwFriendWelcomeVO> list = qwFriendWelcomeService.selectQwFriendWelcomeList(qwFriendWelcomeParam);
        return getDataTable(list);
    }

    /**
     * 获取好友欢迎语详细信息
     */
    @GetMapping(value = "/{id}")
    public R getInfo(@PathVariable("id") Long id) {
        return R.ok().put("row", qwFriendWelcomeService.selectQwFriendWelcomeById(id));
    }
}
