| | |
| | | |
| | | 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 |
| | | } |