From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:48:08 +0800 Subject: [PATCH] 修改文件上传类型限制 --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActRaffleApi.java | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 97 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActRaffleApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActRaffleApi.java new file mode 100644 index 0000000..572bca7 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActRaffleApi.java @@ -0,0 +1,97 @@ +package com.panzhihua.applets.api; + + +import com.panzhihua.common.controller.BaseController; +import com.panzhihua.common.model.dtos.property.CommonPage; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO; +import com.panzhihua.common.service.community.CommunityService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * 抽奖活动表(ComActRaffle)表控制层 + * projectName 成都呐喊信息技术有限公司-智慧社区项目 + * description: 抽奖活动表相关功能 + * + * @author zzj + * @since 2022-02-18 14:31:20 + */ +@Slf4j +@Api(tags = {"抽奖活动"}) +@RestController +@RequestMapping("comActRaffle") +public class ComActRaffleApi extends BaseController { + /** + * 服务对象 + */ + @Resource + private CommunityService communityService; + + /** + * 分页查询所有数据 + * + * @param commonPage 查询实体 + * @return 所有数据 + */ + @ApiOperation(value = "分页查询",response = ComActRaffleVO.class) + @PostMapping("queryAll") + public R selectAll(@RequestBody CommonPage commonPage) { + commonPage.setType(1); + return this.communityService.selectAllComActRaffle(commonPage); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @ApiOperation(value = "详情",response = ComActRaffleVO.class) + @GetMapping("{id}") + public R selectOne(@PathVariable("id") Long id) { + return this.communityService.selectOneComActRaffle(id,this.getUserId()); + } + + /** + * 新增数据 + * + * @param comActRaffleVO 实体对象 + * @return 新增结果 + */ + @ApiOperation(value = "新增数据") + @PostMapping + public R insert(@RequestBody ComActRaffleVO comActRaffleVO) { + comActRaffleVO.setCommunityId(this.getCommunityId()); + comActRaffleVO.setCreateBy(this.getUserId()); + return this.communityService.insertComActRaffle(comActRaffleVO); + } + + /** + * 修改数据 + * + * @param comActRaffleVO 实体对象 + * @return 修改结果 + */ + @ApiOperation(value = "修改数据") + @PostMapping("/update") + public R update(@RequestBody ComActRaffleVO comActRaffleVO) { + return this.communityService.updateComActRaffle(comActRaffleVO); + } + + /** + * 删除数据 + * + * @param id 主键结合 + * @return 删除结果 + */ + @ApiOperation(value = "删除数据") + @GetMapping("del") + public R delete(@RequestParam("id") Long id) { + return this.communityService.deleteComActRaffle(id); + } +} -- Gitblit v1.7.1