Skip to content

Commit

Permalink
修复Hook功能bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xff committed Mar 7, 2024
1 parent e361951 commit 8e990e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion goinsight/internal/apps/orders/services/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
commonModels "goInsight/internal/apps/common/models"
"goInsight/internal/apps/orders/forms"
"goInsight/internal/apps/orders/models"
"goInsight/internal/pkg/utils"

"github.com/gin-gonic/gin"
"github.com/go-sql-driver/mysql"
Expand Down Expand Up @@ -84,6 +85,11 @@ func (s *HookOrdersService) Run() error {
if err != nil {
return err
}
// 解析UUID
instance_id, err := utils.ParserUUID(s.InstanceID)
if err != nil {
return err
}
// 生成新的工单ID
orderID := uuid.New()
hookRecord := models.InsightOrderRecords{
Expand All @@ -94,8 +100,9 @@ func (s *HookOrdersService) Run() error {
Remark: record.Remark,
IsRestrictAccess: record.IsRestrictAccess,
DBType: s.DBType,
SQLType: record.SQLType,
Environment: s.Environment,
InstanceID: record.InstanceID,
InstanceID: instance_id,
Schema: s.NewSchema,
Applicant: s.Username, // warn:谁执行的hook,申请人改为谁
Organization: record.Organization,
Expand Down

0 comments on commit 8e990e1

Please sign in to comment.