12345678910111213141516171819202122 |
- package repo
- import (
- "assetcenter/db/model"
- "go.mongodb.org/mongo-driver/bson/primitive"
- )
- func FabricGetById(ctx *RepoSession, id string, project []string) *model.Fabric {
- eid, _ := primitive.ObjectIDFromHex(id)
- option := DocSearchOptions{
- CollectName: CollectionFabric,
- Query: Map{"_id": eid},
- Project: project,
- }
- entity := &model.Fabric{}
- ok, err := RepoSeachDoc(ctx, &option, entity)
- if err != nil || !ok {
- return nil
- }
- return entity
- }
|