From 3c921c53c2b4dcd617a4ec88bd2a78fe69f2b600 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期四, 10 八月 2023 19:34:33 +0800 Subject: [PATCH] temp --- service/collectionProjection.go | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/service/collectionProjection.go b/service/collectionProjection.go index b86d98b..7da5f09 100644 --- a/service/collectionProjection.go +++ b/service/collectionProjection.go @@ -15,3 +15,31 @@ return ecode.OK } + +func (CollectionProjectionService) UpdateCollectionProjection(collectionProjection *model.CollectionProjection) int { + err := model.NewCollectionProjectionSearch().SetID(collectionProjection.Id).Update(collectionProjection) + if err != nil { + return ecode.CollectionProjectionUpdateErr + } + + return ecode.OK +} + +func (CollectionProjectionService) DeleteCollectionProjection(id int) int { + err := model.NewCollectionProjectionSearch().SetID(id).Delete() + if err != nil { + return ecode.CollectionProjectionNotExist + } + + return ecode.OK +} + +func (CollectionProjectionService) GetCollectionProjectionList(page, pageSize int) (int64, int, []*model.CollectionProjection) { + + total, err, list := model.NewCollectionProjectionSearch().SetPage(page, pageSize).Find() + if err != nil { + return total, ecode.CollectionProjectionListErr, list + } + + return total, ecode.OK, list +} -- Gitblit v1.8.0