| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.system.domain.TInformation; |
| | | import com.ruoyi.system.query.TInformationQuery; |
| | | import com.ruoyi.system.query.TVipPurchaseRecordQuery; |
| | | import com.ruoyi.system.service.TInformationService; |
| | | import com.ruoyi.system.vo.TVipPurchaseRecordVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Api(tags = "资讯管理") |
| | | @RestController |
| | | @RequestMapping("/tInformation") |
| | | public class TInformationController { |
| | | |
| | | private final TInformationService informationService; |
| | | |
| | | @Autowired |
| | | public TInformationController(TInformationService informationService) { |
| | | this.informationService = informationService; |
| | | } |
| | | |
| | | /** |
| | | * 获取资讯管理分页列表 |
| | | */ |
| | | @ApiOperation(value = "获取资讯管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TInformation>> pageList(@RequestBody TInformationQuery query) { |
| | | return AjaxResult.success(informationService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加资讯 |
| | | */ |
| | | @ApiOperation(value = "添加资讯") |
| | | @PostMapping(value = "/addInformation") |
| | | public AjaxResult addInformation(@RequestBody TInformation information) { |
| | | return AjaxResult.success(informationService.save(information)); |
| | | } |
| | | |
| | | /** |
| | | * 修改资讯 |
| | | */ |
| | | @ApiOperation(value = "修改资讯") |
| | | @PostMapping(value = "/updateInformation") |
| | | public AjaxResult updateInformation(@RequestBody TInformation information) { |
| | | return AjaxResult.success(informationService.updateById(information)); |
| | | } |
| | | |
| | | /** |
| | | * 获取资讯管理详情 |
| | | */ |
| | | @ApiOperation(value = "获取资讯管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TInformation> getDetailById(@RequestParam Long id) { |
| | | return AjaxResult.success(informationService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除资讯 |
| | | */ |
| | | @ApiOperation(value = "通过id删除资讯") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<TInformation> deleteById(@RequestParam Long id) { |
| | | return AjaxResult.success(informationService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 资讯上下架 |
| | | */ |
| | | @ApiOperation(value = "资讯上下架") |
| | | @GetMapping(value = "/upAndDown") |
| | | public AjaxResult upAndDown(@RequestParam Long id, |
| | | @RequestParam Integer status) { |
| | | return AjaxResult.success(informationService.upAndDown(id,status)); |
| | | } |
| | | |
| | | } |
| | | |