修正返回目录
This commit is contained in:
@@ -6,8 +6,10 @@ import (
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses"
|
||||
"hospital-admin-api/api/responses/orderPrescriptionResponse"
|
||||
"hospital-admin-api/api/service"
|
||||
"hospital-admin-api/global"
|
||||
"hospital-admin-api/utils"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type OrderPrescription struct{}
|
||||
@@ -52,28 +54,28 @@ func (r *OrderPrescription) GetOrderPrescriptionPage(c *gin.Context) {
|
||||
responses.OkWithData(result, c)
|
||||
}
|
||||
|
||||
// // GetOrderPrescription 处方详情
|
||||
// func (r *OrderPrescription) GetOrderPrescription(c *gin.Context) {
|
||||
// id := c.Param("family_id")
|
||||
// if id == "" {
|
||||
// responses.FailWithMessage("缺少参数", c)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// // 将 id 转换为 int64 类型
|
||||
// familyId, err := strconv.ParseInt(id, 10, 64)
|
||||
// if err != nil {
|
||||
// responses.Fail(c)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// // 业务处理
|
||||
// patientFamilyService := service.PrescriptionService{}
|
||||
// getPrescriptionResponse, err := patientFamilyService.GetPrescription(familyId)
|
||||
// if err != nil {
|
||||
// responses.FailWithMessage(err.Error(), c)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// responses.OkWithData(getPrescriptionResponse, c)
|
||||
// }
|
||||
// GetOrderPrescription 处方详情
|
||||
func (r *OrderPrescription) GetOrderPrescription(c *gin.Context) {
|
||||
id := c.Param("order_prescription_id")
|
||||
if id == "" {
|
||||
responses.FailWithMessage("缺少参数", c)
|
||||
return
|
||||
}
|
||||
|
||||
// 将 id 转换为 int64 类型
|
||||
orderPrescriptionId, err := strconv.ParseInt(id, 10, 64)
|
||||
if err != nil {
|
||||
responses.Fail(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
orderPrescriptionService := service.OrderPrescriptionService{}
|
||||
getPrescriptionResponse, err := orderPrescriptionService.GetOrderPrescription(orderPrescriptionId)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.OkWithData(getPrescriptionResponse, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user