ChannelController.java 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package com.simuwang.manage.api.channel;
  2. import com.simuwang.base.common.support.MybatisPage;
  3. import com.simuwang.base.pojo.dto.GetByIdQuery;
  4. import com.simuwang.base.pojo.dto.query.ChannelIdPageQuery;
  5. import com.simuwang.base.pojo.dto.query.ChannelPageQuery;
  6. import com.simuwang.base.pojo.vo.*;
  7. import com.simuwang.logging.SystemLog;
  8. import com.simuwang.manage.service.ChannelService;
  9. import com.smppw.common.pojo.ResultVo;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.PostMapping;
  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 java.util.List;
  16. @SystemLog(value = "渠道管理")
  17. @RestController
  18. @RequestMapping("/v1/channel")
  19. public class ChannelController {
  20. @Autowired
  21. private ChannelService channelService;
  22. /**
  23. * 保存渠道信息
  24. * @param channel
  25. * @return
  26. */
  27. @SystemLog(value = "保存渠道信息", type = SystemLog.Type.INSERT)
  28. @PostMapping("save-channel")
  29. public ResultVo saveChannel(@RequestBody ChannelInfoVO channel) {
  30. ResultVo vo = channelService.saveChannel(channel);
  31. return vo;
  32. }
  33. /**
  34. * 保存渠道邮件信息
  35. * @param channelEmailInfoVOList
  36. * @return
  37. */
  38. @SystemLog(value = "保存渠道邮件信息", type = SystemLog.Type.INSERT)
  39. @PostMapping("save-channel-email")
  40. public ResultVo saveChannelEmail(@RequestBody List<ChannelEmailInfoVO> channelEmailInfoVOList) {
  41. ResultVo vo = channelService.saveChannelEmail(channelEmailInfoVOList);
  42. return vo;
  43. }
  44. /**
  45. * 删除渠道信息
  46. * @param idListVO
  47. * @return
  48. */
  49. @SystemLog(value = "删除渠道信息", type = SystemLog.Type.INSERT)
  50. @PostMapping("delete-channel")
  51. public ResultVo deleteChannel(@RequestBody IdListVO idListVO) {
  52. ResultVo vo = channelService.deleteChannel(idListVO.getIdList());
  53. return vo;
  54. }
  55. /**
  56. * 删除渠道邮件
  57. * @param idVO
  58. * @return
  59. */
  60. @SystemLog(value = "删除渠道邮件", type = SystemLog.Type.INSERT)
  61. @PostMapping("delete-channel-email")
  62. public ResultVo deleteChannelEmail(@RequestBody IdVO idVO) {
  63. ResultVo vo = channelService.deleteChannelEmail(idVO.getId());
  64. return vo;
  65. }
  66. /**
  67. * 查询渠道信息
  68. * @param channelPageQuery
  69. * @return
  70. */
  71. @SystemLog(value = "查询渠道信息")
  72. @RequestMapping("search-channel-list")
  73. public MybatisPage<ChannelPageInfoVO> searchChannelList(ChannelPageQuery channelPageQuery){
  74. MybatisPage<ChannelPageInfoVO> result = channelService.searchChannelList(channelPageQuery);
  75. return result;
  76. }
  77. /**
  78. * 查询渠道邮件
  79. * @param channelIdPageQuery
  80. * @return
  81. */
  82. @SystemLog(value = "查询渠道邮件信息")
  83. @RequestMapping("search-channel-email")
  84. public MybatisPage<ChannelEmailInfoVO> searchChannelEmail(ChannelIdPageQuery channelIdPageQuery){
  85. MybatisPage<ChannelEmailInfoVO> result = channelService.searchChannelEmailList(channelIdPageQuery);
  86. return result;
  87. }
  88. }