新增获取医生提现列表-分页

This commit is contained in:
2023-10-30 10:25:44 +08:00
parent 409de1661d
commit f65d7b8414
8 changed files with 451 additions and 2 deletions
+6
View File
@@ -13,6 +13,7 @@ type Api struct {
orderPrescriptionManage // 处方管理
inquiryManage // 问诊管理
caManage // ca管理
financeManage // 财务管理
}
// SysSetting 系统设置
@@ -71,3 +72,8 @@ type inquiryManage struct {
type caManage struct {
UserCaCert // 证书
}
// 财务管理
type financeManage struct {
DoctorWithdrawal // 提现记录
}
+55
View File
@@ -0,0 +1,55 @@
package controller
import (
"github.com/gin-gonic/gin"
"hospital-admin-api/api/dao"
"hospital-admin-api/api/dto"
"hospital-admin-api/api/requests"
"hospital-admin-api/api/responses"
"hospital-admin-api/global"
"hospital-admin-api/utils"
)
// DoctorWithdrawal 医生提现
type DoctorWithdrawal struct{}
// GetDoctorWithdrawalPage 获取医生提现列表-分页
func (r *DoctorWithdrawal) GetDoctorWithdrawalPage(c *gin.Context) {
doctorWithdrawalRequest := requests.DoctorWithdrawalRequest{}
req := doctorWithdrawalRequest.GetDoctorWithdrawalPage
if err := c.ShouldBind(&req); err != nil {
responses.FailWithMessage(err.Error(), c)
return
}
// 参数验证
if err := global.Validate.Struct(req); err != nil {
responses.FailWithMessage(utils.Translate(err), c)
return
}
if req.Page == 0 {
req.Page = 1
}
if req.PageSize == 0 {
req.PageSize = 20
}
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
doctorWithdrawal, total, err := doctorWithdrawalDao.GetDoctorWithdrawalPageSearch(req, req.Page, req.PageSize)
if err != nil {
responses.FailWithMessage(err.Error(), c)
return
}
// 处理返回值
res := dto.GetDoctorWithdrawalListDto(doctorWithdrawal)
result := make(map[string]interface{})
result["page"] = req.Page
result["page_size"] = req.PageSize
result["total"] = total
result["data"] = res
responses.OkWithData(result, c)
}