查询主播信息接口,主播信息展示类

This commit is contained in:
2025-06-12 15:12:53 +08:00
parent 7601a3c454
commit f273ac166b
4 changed files with 104 additions and 0 deletions

View File

@@ -1,8 +1,11 @@
package com.yupi.springbootinit.controller;
import cn.dev33.satoken.stp.StpUtil;
import com.yupi.springbootinit.common.BaseResponse;
import com.yupi.springbootinit.common.ResultUtils;
import com.yupi.springbootinit.model.dto.host.HostInfoDTO;
import com.yupi.springbootinit.model.entity.NewHosts;
import com.yupi.springbootinit.model.vo.hosts.NewHostsVO;
import com.yupi.springbootinit.rabbitMQ.MQSender;
import com.yupi.springbootinit.service.HostInfoService;
import lombok.extern.slf4j.Slf4j;
@@ -24,10 +27,18 @@ public class HostInfoController {
@Resource
private MQSender mqSender;
@Resource
private HostInfoService hostInfoService;
@PostMapping("add_host")
public BaseResponse<Boolean> addHost(@RequestBody List<NewHosts> newHosts){
mqSender.send(newHosts);
return ResultUtils.success(true);
}
@PostMapping("hosts_info")
public BaseResponse<List<NewHostsVO>> hostsInfo(@RequestBody HostInfoDTO hostInfoDTO){
List<NewHostsVO> hostsVOList=hostInfoService.getConditionHosts(hostInfoDTO);
return ResultUtils.success(hostsVOList);
}
}