package com.ruoyi.web.controller.api; import com.ruoyi.common.basic.PageInfo; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.domain.*; import com.ruoyi.system.query.CommentQuery; import com.ruoyi.system.query.MessageQuery; import com.ruoyi.system.service.*; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.Arrays; /** *

* 咨询留言 前端控制器 *

* * @author luodangjia * @since 2024-09-19 */ @RestController @RequestMapping("/t-consultation-message") public class TConsultationMessageController { @Resource private TConsultationMessageService consultationMessageService; @Resource private TConsultationService consultationService; @Resource private TTechnicalTitleService tTechnicalTitleService; @Resource private TTitleMajorService majorService; @Resource private TLevelService levelService; //列表 @ApiOperation(value = "列表",tags = "后台-需求留言管理") @PostMapping("/list") public R> list(@RequestBody MessageQuery messageQuery){ PageInfo tConsultationMessagePageInfo = consultationMessageService.pageQuery(messageQuery); for (TConsultationMessage record : tConsultationMessagePageInfo.getRecords()) { TConsultation byId = consultationService.getById(record.getConsultationId()); record.setTitle(byId.getClassificationName()); TTechnicalTitle byId1 = tTechnicalTitleService.getById(byId.getTitleId() ); TTitleMajor byId2 = majorService.getById(byId.getMajorId()); TLevel byId3 = levelService.getById(byId.getLevel()); record.setClassName(byId1.getTitileName()+"-"+byId2.getMajorName()+"-"+byId3.getName()); } return R.ok(tConsultationMessagePageInfo); } //删除 @ApiOperation(value = "删除",tags = "后台-需求留言管理") @PostMapping("/deleteByIds") public R deleteById(String ids){ consultationMessageService.removeByIds(Arrays.asList(ids.split(","))); return R.ok(); } }