Merge remote-tracking branch 'origin/newMaster' into newMaster
# Conflicts: # doctor-auth/src/main/resources/bootstrap.yml # doctor-gateway/src/main/resources/bootstrap.yml # doctor-modules/doctor-file/src/main/resources/bootstrap.yml # doctor-modules/doctor-gen/src/main/resources/bootstrap.yml # doctor-modules/doctor-health/src/main/resources/mapper/doctor/DoctorMapper.xml # doctor-modules/doctor-job/src/main/resources/bootstrap.yml # doctor-modules/doctor-system/src/main/resources/bootstrap.yml # doctor-visual/doctor-monitor/src/main/resources/bootstrap.ymlnewMaster
commit
0f3112dcf0
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue