| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.HandlingWishesDTO; |
| | | import com.ruoyi.system.dto.ReviewWishesDTO; |
| | | import com.ruoyi.system.model.TCourse; |
| | | import com.ruoyi.system.model.TMicroWish; |
| | | import com.ruoyi.system.query.TMicroWishQuery; |
| | | import com.ruoyi.system.service.TMicroWishService; |
| | | import com.ruoyi.system.service.TMicroWishService; |
| | | import com.ruoyi.system.vo.TMicroWishVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-11-06 |
| | | */ |
| | | @Api(tags = "心愿发布") |
| | | @RestController |
| | | @RequestMapping("/t-micro-wish") |
| | | public class TMicroWishController { |
| | | |
| | | private final TMicroWishService microWishService; |
| | | @Autowired |
| | | public TMicroWishController(TMicroWishService microWishService) { |
| | | this.microWishService = microWishService; |
| | | } |
| | | |
| | | /** |
| | | * 获取心愿发布管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取心愿发布分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TMicroWishVO>> pageList(@RequestBody TMicroWishQuery query) { |
| | | return R.ok(microWishService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 查看心愿发布详情 |
| | | */ |
| | | @ApiOperation(value = "查看心愿发布详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TMicroWish> getDetailById(@RequestParam String id) { |
| | | return R.ok(microWishService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除心愿发布 |
| | | */ |
| | | @Log(title = "心愿发布信息-删除心愿发布", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除心愿发布") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(microWishService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除心愿发布 |
| | | */ |
| | | @Log(title = "心愿发布信息-删除心愿发布", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除心愿发布") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(microWishService.removeByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 审核心愿 |
| | | */ |
| | | @Log(title = "心愿发布信息-审核心愿", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "审核心愿") |
| | | @PostMapping(value = "/reviewWishes") |
| | | public R<Boolean> reviewWishes(@RequestBody ReviewWishesDTO dto) { |
| | | microWishService.update(Wrappers.lambdaUpdate(TMicroWish.class) |
| | | .set(TMicroWish::getStatus, dto.getStatus()) |
| | | .set(TMicroWish::getAuditRemark, dto.getAuditRemark()) |
| | | .eq(TMicroWish::getId, dto.getId())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 处理心愿 |
| | | */ |
| | | @Log(title = "心愿发布信息-处理心愿", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "处理心愿") |
| | | @PostMapping(value = "/handlingWishes") |
| | | public R<Boolean> handlingWishes(@RequestBody HandlingWishesDTO dto) { |
| | | microWishService.update(Wrappers.lambdaUpdate(TMicroWish.class) |
| | | .set(TMicroWish::getStatus, dto.getStatus()) |
| | | .set(TMicroWish::getProcessResult, dto.getProcessResult()) |
| | | .set(TMicroWish::getProcessPictures, dto.getProcessPictures()) |
| | | .eq(TMicroWish::getId, dto.getId())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |