From 15aa08a421b0e603c80f32343f3460cefc361112 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 27 Nov 2024 16:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/cloud_bundle_dao.go | 1 + src/implement/cloud_bundle_implement.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/dao/cloud_bundle_dao.go b/src/dao/cloud_bundle_dao.go index 21b6de6..6c16591 100644 --- a/src/dao/cloud_bundle_dao.go +++ b/src/dao/cloud_bundle_dao.go @@ -8,4 +8,5 @@ type CloudBundleDao interface { FindCloudBundleAndTotal(page, limit string) (*[]model.CloudBundle, int64, error) GetCloudBundle(id string) (m *model.CloudBundle, err error) GetCloudBundleLast(os string) (m *model.CloudBundle, err error) + GetCloudBundleVersion(os, version string) (m *model.CloudBundle, err error) } diff --git a/src/implement/cloud_bundle_implement.go b/src/implement/cloud_bundle_implement.go index a63b36e..74c85f7 100644 --- a/src/implement/cloud_bundle_implement.go +++ b/src/implement/cloud_bundle_implement.go @@ -48,3 +48,14 @@ func (c CloudBundleDb) GetCloudBundleLast(os string) (m *model.CloudBundle, err } return m, nil } +func (c CloudBundleDb) GetCloudBundleVersion(os, version string) (m *model.CloudBundle, err error) { + m = new(model.CloudBundle) + has, err := c.Db.Where("os=? and version=?", os, version).Desc("id").Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +}