响应状态改成自定义状态
This commit is contained in:
@@ -3,7 +3,7 @@ package controller
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/app/middleware"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/repository"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -55,9 +55,9 @@ func SendErrorResponse(ctx *gin.Context, code ResponseCode, message string) {
|
||||
func setAuditDetails(c *gin.Context, actionType, description string, targetResource interface{}) {
|
||||
// 只有当 actionType 不为空时,才设置审计信息,这作为触发审计的标志
|
||||
if actionType != "" {
|
||||
c.Set(middleware.ContextAuditActionType, actionType)
|
||||
c.Set(middleware.ContextAuditDescription, description)
|
||||
c.Set(middleware.ContextAuditTargetResource, targetResource)
|
||||
c.Set(repository.ContextAuditActionType, actionType)
|
||||
c.Set(repository.ContextAuditDescription, description)
|
||||
c.Set(repository.ContextAuditTargetResource, targetResource)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user