修复需要从前端传新增人修改人的问题
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"dataengine/dao/dict"
|
||||
dto "dataengine/model/dto/dict"
|
||||
entity "dataengine/model/entity/dict"
|
||||
"dataengine/utils"
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
@@ -35,8 +36,11 @@ func (s *apiInterfaceService) Create(ctx context.Context, req *dto.CreateApiInte
|
||||
return nil, errors.New("接口编码在该平台下已存在")
|
||||
}
|
||||
|
||||
// 从 context 中获取当前用户
|
||||
currentUser := utils.GetCurrentUser(ctx)
|
||||
|
||||
// 插入数据库
|
||||
id, err := dict.ApiInterface.Insert(ctx, req)
|
||||
id, err := dict.ApiInterface.Insert(ctx, req, currentUser)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -87,7 +91,9 @@ func (s *apiInterfaceService) List(ctx context.Context, req *dto.ListApiInterfac
|
||||
Method: item.Method,
|
||||
Status: item.Status,
|
||||
StatusName: s.getStatusName(item.Status),
|
||||
CreatedBy: item.Creator,
|
||||
CreatedAt: safeUnix(item.CreatedAt),
|
||||
UpdatedBy: item.Updater,
|
||||
UpdatedAt: safeUnix(item.UpdatedAt),
|
||||
})
|
||||
}
|
||||
@@ -151,13 +157,15 @@ func (s *apiInterfaceService) Update(ctx context.Context, req *dto.UpdateApiInte
|
||||
}
|
||||
}
|
||||
|
||||
_, err = dict.ApiInterface.Update(ctx, req)
|
||||
currentUser := utils.GetCurrentUser(ctx)
|
||||
_, err = dict.ApiInterface.Update(ctx, req, currentUser)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus 更新接口状态
|
||||
func (s *apiInterfaceService) UpdateStatus(ctx context.Context, req *dto.UpdateApiInterfaceStatusReq) (err error) {
|
||||
_, err = dict.ApiInterface.UpdateStatus(ctx, req.Id, req.Status.String())
|
||||
currentUser := utils.GetCurrentUser(ctx)
|
||||
_, err = dict.ApiInterface.UpdateStatus(ctx, req.Id, req.Status.String(), currentUser)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user