You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.7 KiB
Java
53 lines
1.7 KiB
Java
package com.supervision.controller;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.supervision.domain.LivetalkingChatDTO;
|
|
import com.supervision.dto.DigitalHumanDTO;
|
|
import com.supervision.dto.DigitalHumanVoiceDTO;
|
|
import com.supervision.dto.R;
|
|
import com.supervision.service.danmaku.DigitalHumanManageService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
/**
|
|
* 数字人控制器
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/digitalHuman")
|
|
@RequiredArgsConstructor
|
|
public class DigitalHumanController {
|
|
|
|
private final DigitalHumanManageService digitalHumanManageService;
|
|
|
|
/**
|
|
* 分页查询数字人列表
|
|
* @param page 当前页码
|
|
* @param pageSize 每页大小
|
|
* @return
|
|
*/
|
|
@GetMapping("/pageList")
|
|
public R<IPage<DigitalHumanDTO>> pageList(@RequestParam(name = "page", required = false,defaultValue = "1") Integer page,
|
|
@RequestParam (name = "pageSize", required = false,defaultValue = "10") Integer pageSize) {
|
|
|
|
IPage<DigitalHumanDTO> paged = digitalHumanManageService.pageList(page, pageSize);
|
|
return R.ok(paged);
|
|
}
|
|
|
|
/**
|
|
* 切换数字人语音
|
|
* @param digitalHumanVoiceDTO 包含语音ID和数字人ID的DTO
|
|
* @return
|
|
*/
|
|
@PostMapping("/switchVoice")
|
|
public R<Void> setVoice(@RequestBody DigitalHumanVoiceDTO digitalHumanVoiceDTO) {
|
|
digitalHumanManageService.setVoice(digitalHumanVoiceDTO);
|
|
return R.ok();
|
|
}
|
|
|
|
@PostMapping("/livetalking/chatCallBack")
|
|
public R<Void> chatCallBack(@RequestBody LivetalkingChatDTO digitalHumanVoiceDTO) {
|
|
digitalHumanManageService.chatCallBack(digitalHumanVoiceDTO);
|
|
return R.ok();
|
|
}
|
|
}
|