From 25d1f2bb1ad855c838a53e6441dc127a7b3c4bfd Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 22 Nov 2024 19:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/advertising_space_dao.go | 1 + src/implement/advertising_space_implement.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/dao/advertising_space_dao.go b/src/dao/advertising_space_dao.go index 2683cdd..ebf7d69 100644 --- a/src/dao/advertising_space_dao.go +++ b/src/dao/advertising_space_dao.go @@ -4,4 +4,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" type AdvertisingSpaceDao interface { AdvertisingSpaceAll() (*[]model.AdvertisingSpace, error) + GetAdvertisingSpace(id string) (m *model.AdvertisingSpace, err error) } diff --git a/src/implement/advertising_space_implement.go b/src/implement/advertising_space_implement.go index a6dfe32..b7a07c3 100644 --- a/src/implement/advertising_space_implement.go +++ b/src/implement/advertising_space_implement.go @@ -22,3 +22,14 @@ func (a AdvertisingSpaceDb) AdvertisingSpaceAll() (*[]model.AdvertisingSpace, er } return &m, nil } +func (a AdvertisingSpaceDb) GetAdvertisingSpace(id string) (m *model.AdvertisingSpace, err error) { + m = new(model.AdvertisingSpace) + has, err := a.Db.Where("id=?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +}