zmy09
parent
c9a9ab950f
commit
32eb478322
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -5,6 +5,7 @@ import doctor.domain.vo.DoctorVo;
|
|||
import doctor.domain.vo.InquiryDetailsRecordVo;
|
||||
import doctor.service.InquiryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -37,4 +38,40 @@ public class InquiryController {
|
|||
DoctorVo doctorVo = inquiryService.findDoctorInfo(doctorId);
|
||||
return HealthR.ok(doctorVo);
|
||||
}
|
||||
|
||||
//咨询医生
|
||||
@PutMapping("/verify/v1/consultDoctor")
|
||||
public HealthR consultDoctor(@RequestHeader Integer userId,
|
||||
@RequestHeader String sessionId,
|
||||
@RequestParam Integer doctorId){
|
||||
String doctorUserName = inquiryService.consultDoctor(userId,doctorId);
|
||||
return HealthR.ok(doctorUserName);
|
||||
}
|
||||
|
||||
//关注医生
|
||||
@PostMapping("/verify/v1/followDoctor")
|
||||
public HealthR followDoctor(@RequestHeader Integer userId,
|
||||
@RequestHeader String sessionId,
|
||||
@RequestParam Integer doctorId) {
|
||||
inquiryService.followDoctor(userId,doctorId);
|
||||
return HealthR.ok();
|
||||
}
|
||||
|
||||
//取消关注医生
|
||||
@DeleteMapping("/verify/v1/cancelFollow")
|
||||
public HealthR cancelFollow(@RequestHeader Integer userId,
|
||||
@RequestHeader String sessionId,
|
||||
@RequestParam Integer doctorId){
|
||||
inquiryService.cancelFollow(userId,doctorId);
|
||||
return HealthR.ok();
|
||||
}
|
||||
|
||||
//结束问诊
|
||||
@PutMapping("/verify/v1/endInquiry")
|
||||
public HealthR endInquiry(@RequestHeader Integer userId,
|
||||
@RequestHeader String sessionId,
|
||||
@RequestParam Integer recordId) {
|
||||
inquiryService.endInquiry(userId,recordId);
|
||||
return HealthR.ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package doctor.mapper;
|
|||
|
||||
import doctor.domain.entity.InquiryDetailsRecordEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -14,4 +15,8 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface InquiryMapper {
|
||||
List<InquiryDetailsRecordEntity> findHistoryInquiryRecord();
|
||||
|
||||
void consultDoctor(@Param("userId") Integer userId, @Param("doctorId") Integer doctorId);
|
||||
|
||||
String findDoctorUserNameByDoctorId(@Param("doctorId") Integer doctorId);
|
||||
}
|
||||
|
|
|
@ -15,4 +15,12 @@ public interface InquiryService {
|
|||
List<InquiryDetailsRecordVo> findHistoryInquiryRecord();
|
||||
|
||||
DoctorVo findDoctorInfo(Integer doctorId);
|
||||
|
||||
String consultDoctor(Integer userId, Integer doctorId);
|
||||
|
||||
void followDoctor(Integer userId, Integer doctorId);
|
||||
|
||||
void cancelFollow(Integer userId, Integer doctorId);
|
||||
|
||||
void endInquiry(Integer userId, Integer recordId);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import doctor.domain.vo.InquiryDetailsRecordVo;
|
|||
import doctor.mapper.InquiryMapper;
|
||||
import doctor.service.InquiryService;
|
||||
import doctor.util.ConvertUtil;
|
||||
import doctor.util.RSAUtils;
|
||||
import doctor.util.RsaKey;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -33,4 +35,31 @@ public class InquiryServiceImpl implements InquiryService {
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consultDoctor(Integer userId, Integer doctorId) {
|
||||
inquiryMapper.consultDoctor(userId,doctorId);
|
||||
String doctorUserName = inquiryMapper.findDoctorUserNameByDoctorId(doctorId);
|
||||
try {
|
||||
String s = RSAUtils.rsaDecrypt(doctorUserName, RsaKey.PUBLIC_KEY);
|
||||
return s;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void followDoctor(Integer userId, Integer doctorId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelFollow(Integer userId, Integer doctorId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endInquiry(Integer userId, Integer recordId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
from doctor where department_id = #{deptId}
|
||||
</select>
|
||||
</mapper>
|
||||
2
|
||||
|
||||
|
|
|
@ -3,10 +3,30 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="doctor.mapper.InquiryMapper">
|
||||
<insert id="consultDoctor">
|
||||
insert into inquiry_record(
|
||||
user_id,
|
||||
doctor_id,
|
||||
status,
|
||||
show_status,
|
||||
inquiry_time,
|
||||
create_time
|
||||
)values (
|
||||
#{userId},
|
||||
#{doctorId},
|
||||
1,
|
||||
1,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="findHistoryInquiryRecord" resultType="doctor.domain.entity.InquiryDetailsRecordEntity">
|
||||
select *
|
||||
from inquiry_details_record
|
||||
</select>
|
||||
<select id="findDoctorUserNameByDoctorId" resultType="java.lang.String">
|
||||
select user_name from doctor where doctor_id=#{doctorId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue