KuaishouLabelServiceImpl.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.ruixuan.isc.service.impl;
  2. import com.ruixuan.common.utils.Result;
  3. import com.ruixuan.isc.entity.KuaishouLabel;
  4. import com.ruixuan.isc.mapper.KuaishouLabelMapper;
  5. import com.ruixuan.isc.service.IKuaishouLabelService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import java.util.List;
  9. /**
  10. * 快手标签Service业务层处理
  11. *
  12. * @author ruoyi
  13. * @date 2023-03-28
  14. */
  15. @Service
  16. public class KuaishouLabelServiceImpl implements IKuaishouLabelService {
  17. @Autowired
  18. private KuaishouLabelMapper kuaishouLabelMapper;
  19. /**
  20. * 查询快手标签
  21. *
  22. * @param id 快手标签主键
  23. * @return 快手标签
  24. */
  25. @Override
  26. public KuaishouLabel selectKuaishouLabelById(Long id) {
  27. return kuaishouLabelMapper.selectKuaishouLabelById(id);
  28. }
  29. /**
  30. * 查询快手标签列表
  31. *
  32. * @param kuaishouLabel 快手标签
  33. * @return 快手标签
  34. */
  35. @Override
  36. public List<KuaishouLabel> selectKuaishouLabelList(KuaishouLabel kuaishouLabel) {
  37. return kuaishouLabelMapper.selectKuaishouLabelList(kuaishouLabel);
  38. }
  39. /**
  40. * 新增快手标签
  41. */
  42. @Override
  43. public Result insertKuaishouLabel(KuaishouLabel kuaishouLabel) {
  44. String colour = kuaishouLabelMapper.getLabelColour();
  45. kuaishouLabel.setLabelColour(colour);
  46. int i = kuaishouLabelMapper.insertKuaishouLabel(kuaishouLabel);
  47. if (i > 0) {
  48. kuaishouLabelMapper.updateLabelColourStatus(colour);
  49. }
  50. return Result.success(kuaishouLabel);
  51. }
  52. /**
  53. * 修改快手标签
  54. */
  55. @Override
  56. public int updateKuaishouLabel(KuaishouLabel kuaishouLabel) {
  57. return kuaishouLabelMapper.updateKuaishouLabel(kuaishouLabel);
  58. }
  59. /**
  60. * 批量删除快手标签
  61. *
  62. * @param ids 需要删除的快手标签主键
  63. * @return 结果
  64. */
  65. @Override
  66. public int deleteKuaishouLabelByIds(Long[] ids) {
  67. return kuaishouLabelMapper.deleteKuaishouLabelByIds(ids);
  68. }
  69. /**
  70. * 删除快手标签信息
  71. *
  72. * @param id 快手标签主键
  73. * @return 结果
  74. */
  75. @Override
  76. public int deleteKuaishouLabelById(Long id) {
  77. return kuaishouLabelMapper.deleteKuaishouLabelById(id);
  78. }
  79. }