LiveLiveController.java 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package com.game.business.controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import com.game.common.core.domain.R;
  5. import org.springframework.security.access.prepost.PreAuthorize;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.PutMapping;
  10. import org.springframework.web.bind.annotation.DeleteMapping;
  11. import org.springframework.web.bind.annotation.PathVariable;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import com.game.common.annotation.Log;
  16. import com.game.common.core.controller.BaseController;
  17. import com.game.common.core.domain.AjaxResult;
  18. import com.game.common.enums.BusinessType;
  19. import io.swagger.annotations.Api;
  20. import io.swagger.annotations.ApiOperation;
  21. import com.game.business.domain.LiveLive;
  22. import com.game.business.service.ILiveLiveService;
  23. import com.game.common.utils.poi.ExcelUtil;
  24. import com.game.common.core.page.TableDataInfo;
  25. /**
  26. * 直播管理Controller
  27. *
  28. * @author game
  29. * @date 2024-08-30
  30. */
  31. @RestController
  32. @RequestMapping("/business/live")
  33. @Api(value = "LiveLiveController", description = "直播管理接口", tags = {"直播管理"})
  34. public class LiveLiveController extends BaseController
  35. {
  36. @Autowired
  37. private ILiveLiveService liveLiveService;
  38. /**
  39. * 查询直播管理列表
  40. */
  41. @PreAuthorize("@ss.hasPermi('business:live:list')")
  42. @GetMapping("/list")
  43. @ApiOperation(value = "查询直播管理列表", notes = "获取直播管理列表")
  44. public TableDataInfo<LiveLive> list(LiveLive liveLive)
  45. {
  46. startPage();
  47. List<LiveLive> list = liveLiveService.selectLiveLiveList(liveLive);
  48. return getDataTable(list);
  49. }
  50. /**
  51. * 导出直播管理列表
  52. */
  53. @PreAuthorize("@ss.hasPermi('business:live:export')")
  54. @Log(title = "直播管理", businessType = BusinessType.EXPORT)
  55. @PostMapping("/export")
  56. @ApiOperation(value = "导出直播管理列表", notes = "导出直播管理列表")
  57. public void export(HttpServletResponse response, LiveLive liveLive)
  58. {
  59. List<LiveLive> list = liveLiveService.selectLiveLiveList(liveLive);
  60. ExcelUtil<LiveLive> util = new ExcelUtil<LiveLive>(LiveLive.class);
  61. util.exportExcel(response, list, "直播管理数据");
  62. }
  63. /**
  64. * 获取直播管理详细信息
  65. */
  66. @PreAuthorize("@ss.hasPermi('business:live:query')")
  67. @GetMapping(value = "/{id}")
  68. @ApiOperation(value = "获取直播管理详细信息", notes = "获取直播管理详细信息")
  69. public R<LiveLive> getInfo(@PathVariable("id") Long id)
  70. {
  71. return R.ok(liveLiveService.selectLiveLiveById(id));
  72. }
  73. /**
  74. * 新增直播管理
  75. */
  76. @PreAuthorize("@ss.hasPermi('business:live:add')")
  77. @Log(title = "直播管理", businessType = BusinessType.INSERT)
  78. @ApiOperation(value = "新增直播管理", notes = "新增直播管理")
  79. @PostMapping
  80. public R add(@RequestBody LiveLive liveLive)
  81. {
  82. return R.ok(liveLiveService.insertLiveLive(liveLive));
  83. }
  84. /**
  85. * 修改直播管理
  86. */
  87. @PreAuthorize("@ss.hasPermi('business:live:edit')")
  88. @Log(title = "直播管理", businessType = BusinessType.UPDATE)
  89. @ApiOperation(value = "修改直播管理", notes = "修改直播管理")
  90. @PutMapping
  91. public R edit(@RequestBody LiveLive liveLive)
  92. {
  93. return R.ok(liveLiveService.updateLiveLive(liveLive));
  94. }
  95. /**
  96. * 删除直播管理
  97. */
  98. @PreAuthorize("@ss.hasPermi('business:live:remove')")
  99. @Log(title = "直播管理", businessType = BusinessType.DELETE)
  100. @ApiOperation(value = "删除直播管理", notes = "删除直播管理")
  101. @DeleteMapping("/{ids}")
  102. public R remove(@PathVariable Long[] ids)
  103. {
  104. return R.ok(liveLiveService.deleteLiveLiveByIds(ids));
  105. }
  106. }