package com.fjhx.victoriatourist.controller.blessing;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.blessing.dto.BlessingLanguageDto;
import com.fjhx.victoriatourist.entity.blessing.dto.BlessingLanguageSelectDto;
import com.fjhx.victoriatourist.entity.blessing.vo.BlessingLanguageVo;
import com.fjhx.victoriatourist.service.blessing.BlessingLanguageService;
import com.ruoyi.common.core.domain.BaseSelectDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 祝福语管理 前端控制器
 * </p>
 *
 * @author LQH
 * @since 2023-12-10
 */
@RestController
@RequestMapping("/blessingLanguage")
public class BlessingLanguageController {

    @Autowired
    private BlessingLanguageService blessingLanguageService;

    /**
     * 祝福语管理列表
     */
    @PostMapping("/list")
    public List<BlessingLanguageVo> list(@RequestBody BlessingLanguageSelectDto dto) {
        return blessingLanguageService.getList(dto);
    }

    /**
     * 祝福语管理分页
     */
    @PostMapping("/page")
    public Page<BlessingLanguageVo> page(@RequestBody BlessingLanguageSelectDto dto) {
        return blessingLanguageService.getPage(dto);
    }

    /**
     * 祝福语管理明细
     */
    @PostMapping("/detail")
    public BlessingLanguageVo detail(@RequestBody BaseSelectDto dto) {
        return blessingLanguageService.detail(dto.getId());
    }

    /**
     * 祝福语管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody BlessingLanguageDto blessingLanguageDto) {
        blessingLanguageService.add(blessingLanguageDto);
    }

    /**
     * 祝福语管理编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody BlessingLanguageDto blessingLanguageDto) {
        blessingLanguageService.edit(blessingLanguageDto);
    }

    /**
     * 祝福语管理删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        blessingLanguageService.delete(dto.getId());
    }

}
