Signed-off-by: devad <cossjie@foxmail.com>
This commit is contained in:
devad 2024-01-03 15:04:26 +08:00
parent 7300f017fa
commit a1cfa43774
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ func (l *DeleteAppByAppNameLogic) DeleteAppByAppName(req *types.DeleteAppReq) (r
resp = &types.DeleteAppResp{}
var task = &Task{}
//查询应用的yamlString
l.svcCtx.DbEngin.Raw(`select * from task where ns_id= ? and name= ? `, req.NsID, req.Name).Scan(&task)
l.svcCtx.DbEngin.Raw(`select * from task where ns_id= ? and name= ? AND deleted_at IS NULL`, req.NsID, req.Name).Scan(&task)
if task.Id == 0 {
resp.Code = 500
resp.Msg = "App not fount"

View File

@ -23,7 +23,7 @@ func NewGetAppByAppNameLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G
func (l *GetAppByAppNameLogic) GetAppByAppName(req *types.AppDetailReq) (resp interface{}, err error) {
var task Task
db := l.svcCtx.DbEngin.Raw("select * from task where ns_id = ? and name = ?", req.NsID, req.Name).Scan(&task)
db := l.svcCtx.DbEngin.Raw("select * from task where ns_id = ? and name = ? AND deleted_at IS NULL", req.NsID, req.Name).Scan(&task)
if db.Error != nil {
logx.Errorf("db error: %v", db.Error)
return

View File

@ -29,7 +29,7 @@ func (l *RestartAppByAppNameLogic) RestartAppByAppName(req *types.DeleteAppReq)
resp = &types.AppResp{}
var task = &Task{}
//查询应用的yamlString
l.svcCtx.DbEngin.Raw(`select * from task where ns_id= ? and name= ? `, req.NsID, req.Name).Scan(&task)
l.svcCtx.DbEngin.Raw(`select * from task where ns_id= ? and name= ? AND deleted_at IS NULL`, req.NsID, req.Name).Scan(&task)
if task.Id == 0 {
resp.Code = 500
resp.Msg = "App not fount"