fix bugs
Signed-off-by: devad <cossjie@foxmail.com> Former-commit-id: a1cfa437749687ad57c815977dca33a2d6885fc0
This commit is contained in:
parent
9c9d836bac
commit
fb0c6029bd
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue