Browse Source

云打包

master
huangjiajun 12 hours ago
parent
commit
15aa08a421
2 changed files with 12 additions and 0 deletions
  1. +1
    -0
      src/dao/cloud_bundle_dao.go
  2. +11
    -0
      src/implement/cloud_bundle_implement.go

+ 1
- 0
src/dao/cloud_bundle_dao.go View File

@@ -8,4 +8,5 @@ type CloudBundleDao interface {
FindCloudBundleAndTotal(page, limit string) (*[]model.CloudBundle, int64, error) FindCloudBundleAndTotal(page, limit string) (*[]model.CloudBundle, int64, error)
GetCloudBundle(id string) (m *model.CloudBundle, err error) GetCloudBundle(id string) (m *model.CloudBundle, err error)
GetCloudBundleLast(os string) (m *model.CloudBundle, err error) GetCloudBundleLast(os string) (m *model.CloudBundle, err error)
GetCloudBundleVersion(os, version string) (m *model.CloudBundle, err error)
} }

+ 11
- 0
src/implement/cloud_bundle_implement.go View File

@@ -48,3 +48,14 @@ func (c CloudBundleDb) GetCloudBundleLast(os string) (m *model.CloudBundle, err
} }
return m, nil 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
}

Loading…
Cancel
Save