fix: update instance center of ai
This commit is contained in:
parent
d2cd5980e3
commit
c005b8ab9c
|
@ -35,7 +35,8 @@ type (
|
||||||
/******************image inference*************************/
|
/******************image inference*************************/
|
||||||
/******************instance center*************************/
|
/******************instance center*************************/
|
||||||
InstanceCenterReq{
|
InstanceCenterReq{
|
||||||
InstanceType int32 `form:"instance_type"`
|
InstanceType int32 `json:"instance_type"`
|
||||||
|
InstanceClass string `json:"instance_class"`
|
||||||
}
|
}
|
||||||
InstanceCenterResp {
|
InstanceCenterResp {
|
||||||
InstanceCenterList []InstanceCenterList `json:"instanceCenterList" copier:"InstanceCenterList"`
|
InstanceCenterList []InstanceCenterList `json:"instanceCenterList" copier:"InstanceCenterList"`
|
||||||
|
|
|
@ -33,9 +33,10 @@ func (l *InstanceCenterLogic) InstanceCenter(req *types.InstanceCenterReq) (*typ
|
||||||
|
|
||||||
if req.InstanceType == 0 {
|
if req.InstanceType == 0 {
|
||||||
l.svcCtx.DbEngin.Raw("select * from ai_instance_center").Scan(&InstanceCenter)
|
l.svcCtx.DbEngin.Raw("select * from ai_instance_center").Scan(&InstanceCenter)
|
||||||
} else {
|
} else if req.InstanceType != 0 && req.InstanceClass == "" {
|
||||||
l.svcCtx.DbEngin.Raw("select * from ai_instance_center where instance_type = ? ", req.InstanceType).Scan(&InstanceCenter)
|
l.svcCtx.DbEngin.Raw("select * from ai_instance_center where instance_type = ? ", req.InstanceType).Scan(&InstanceCenter)
|
||||||
|
} else {
|
||||||
|
l.svcCtx.DbEngin.Raw("select * from ai_instance_center where instance_type = ? and instance_class = ?", req.InstanceType, req.InstanceClass).Scan(&InstanceCenter)
|
||||||
}
|
}
|
||||||
|
|
||||||
var instanceCenter = *InstanceCenter
|
var instanceCenter = *InstanceCenter
|
||||||
|
|
|
@ -3666,7 +3666,8 @@ type InstanceCenterList struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstanceCenterReq struct {
|
type InstanceCenterReq struct {
|
||||||
InstanceType int32 `form:"instance_type"`
|
InstanceType int32 `json:"instance_type"`
|
||||||
|
InstanceClass string `json:"instance_class"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstanceCenterResp struct {
|
type InstanceCenterResp struct {
|
||||||
|
|
Loading…
Reference in New Issue