增加导出日志

This commit is contained in:
2023-11-16 13:51:02 +08:00
parent 494c7e5aca
commit ada4339add
4 changed files with 239 additions and 0 deletions
+155
View File
@@ -3,6 +3,7 @@ package controller
import (
"github.com/gin-gonic/gin"
"hospital-admin-api/api/dao"
"hospital-admin-api/api/model"
"hospital-admin-api/api/requests"
"hospital-admin-api/api/responses"
"hospital-admin-api/api/service"
@@ -44,6 +45,20 @@ func (r *Export) DoctorWithdrawal(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "提现记录",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -78,6 +93,20 @@ func (r *Export) DoctorWithdrawalOrder(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "提现记录-关联订单",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -114,6 +143,20 @@ func (r *Export) UserDoctor(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "医生列表",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -149,6 +192,20 @@ func (r *Export) UserDoctorBankCard(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "医生银行卡列表",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -183,6 +240,20 @@ func (r *Export) DoctorAccount(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "医生账户",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -217,6 +288,20 @@ func (r *Export) OrderInquiryForAccount(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "医生账户-关联订单",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -251,6 +336,20 @@ func (r *Export) UserPatient(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "患者列表",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -285,6 +384,20 @@ func (r *Export) PatientFamily(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "就诊人列表",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -320,6 +433,20 @@ func (r *Export) OrderInquiry(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "问诊订单",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -355,6 +482,20 @@ func (r *Export) OrderProduct(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "药品订单",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}
@@ -389,5 +530,19 @@ func (r *Export) OrderPrescription(c *gin.Context) {
return
}
// 获取当前登陆用户id
userId := c.GetInt64("UserId")
if userId != 0 {
// 记录日志
logExport := &model.LogExport{
AdminUserId: userId,
ExportModule: "处方",
ExportFile: utils.RemoveOssDomain(ossAddress),
}
logExportDao := dao.LogExportDao{}
_, _ = logExportDao.AddLogExportUnTransaction(logExport)
}
responses.OkWithData(ossAddress, c)
}