package com.panzhihua.service_community.api;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.extension.api.ApiController;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.common.model.dtos.property.CommonPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
|
import com.panzhihua.service_community.entity.ComActRaffle;
|
import com.panzhihua.service_community.service.ComActRaffleService;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.io.Serializable;
|
import java.util.List;
|
|
/**
|
* 抽奖活动表(ComActRaffle)表控制层
|
* projectName 成都呐喊信息技术有限公司-智慧社区项目
|
* description: 抽奖活动表相关功能
|
*
|
* @author zzj
|
* @since 2022-02-18 14:31:20
|
*/
|
@RestController
|
@RequestMapping("comActRaffle")
|
public class ComActRaffleApi {
|
/**
|
* 服务对象
|
*/
|
@Resource
|
private ComActRaffleService comActRaffleService;
|
|
/**
|
* 分页查询所有数据
|
*
|
* @param commonPage 查询实体
|
* @return 所有数据
|
*/
|
@PostMapping("queryAll")
|
public R selectAll(@RequestBody CommonPage commonPage) {
|
return this.comActRaffleService.pageList(commonPage);
|
}
|
|
/**
|
* 通过主键查询单条数据
|
*
|
* @param id 主键
|
* @return 单条数据
|
*/
|
@GetMapping("/detail")
|
public R selectOne(@RequestParam("id") Long id,@RequestParam("userId")Long userId) {
|
return this.comActRaffleService.selectById(id,userId);
|
}
|
|
/**
|
* 新增数据
|
*
|
* @param comActRaffleVO 实体对象
|
* @return 新增结果
|
*/
|
@PostMapping
|
public R insert(@RequestBody ComActRaffleVO comActRaffleVO) {
|
return this.comActRaffleService.insert(comActRaffleVO);
|
}
|
|
/**
|
* 修改数据
|
*
|
* @param comActRaffleVO 实体对象
|
* @return 修改结果
|
*/
|
@PostMapping("/update")
|
public R update(@RequestBody ComActRaffleVO comActRaffleVO) {
|
return this.comActRaffleService.update(comActRaffleVO);
|
}
|
|
/**
|
* 删除数据
|
*
|
* @param id 主键结合
|
* @return 删除结果
|
*/
|
@GetMapping("del")
|
public R delete(@RequestParam("id") Long id) {
|
return this.comActRaffleService.delete(id);
|
}
|
}
|