dev_v1.0.1
parent
acf463cd48
commit
c8794b60d1
@ -0,0 +1,25 @@
|
|||||||
|
package com.supervision.controller;
|
||||||
|
|
||||||
|
import com.supervision.model.Patient;
|
||||||
|
import com.supervision.service.PatientService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "病人")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/patient")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PatientController {
|
||||||
|
|
||||||
|
private final PatientService patientService;
|
||||||
|
|
||||||
|
@ApiOperation("根据病人ID获取病人")
|
||||||
|
@GetMapping("queryPatientInfo")
|
||||||
|
public Patient queryPatientInfo(String id) {
|
||||||
|
return patientService.queryPatientById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.supervision.service;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public interface AskService {
|
||||||
|
|
||||||
|
String receiveVoiceFile(MultipartFile file) throws IOException;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.supervision.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import com.supervision.service.AskService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AskServiceImpl implements AskService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String receiveVoiceFile(MultipartFile file) throws IOException {
|
||||||
|
// 首先编码为base64编码
|
||||||
|
String encode = Base64.encode(file.getBytes());
|
||||||
|
// TODO 这里调用Python的接口,将文字转换为语音
|
||||||
|
return encode;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.supervision.websocket.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SocketMessageDTO {
|
||||||
|
|
||||||
|
private String socketId;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
}
|
Loading…
Reference in New Issue