Skip to content

Commit

Permalink
feat:cloudmind-content.file基本完成
Browse files Browse the repository at this point in the history
  • Loading branch information
Love-YeLin committed Jan 18, 2024
1 parent 843bab9 commit 35d3b42
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ WORKDIR /build

ADD go.mod .
ADD go.sum .
RUN go mod download
RUN go mod tidy

COPY . .
RUN sh ./build.sh

Expand Down
2 changes: 1 addition & 1 deletion biz/infrastructure/convertor/convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func UserMapperToUserDetail(in *usermapper.User) *gencontent.UserDetail {
return &gencontent.UserDetail{
Name: in.Name,
Sex: int64(in.Sex),
Sex: in.Sex,

Check failure on line 13 in biz/infrastructure/convertor/convertor.go

View workflow job for this annotation

GitHub Actions / run (linux-amd64-fmt)

cannot use in.Sex (variable of type int64) as int32 value in struct literal
FullName: in.FullName,
IdCard: in.IdCard,
CreatedAt: in.CreateAt.UnixMilli(),
Expand Down
8 changes: 7 additions & 1 deletion biz/infrastructure/mapper/file/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type FilterOptions struct {
OnlyFileId *string
OnlyFatherId *string
OnlyFileType *int64
OnlyTag *string
IsDel int64
DocumentType int64
}
Expand All @@ -34,6 +35,7 @@ func (f *MongoFileFilter) toBson() bson.M {
f.CheckOnlyFileId()
f.CheckOnlyFatherId()
f.CheckOnlyFileType()
f.CheckIsDel()
f.CheckDocumentType()
return f.m
}
Expand Down Expand Up @@ -69,7 +71,11 @@ func (f *MongoFileFilter) CheckIsDel() {

func (f *MongoFileFilter) CheckDocumentType() {
if f.DocumentType == 2 {
f.m[consts.Tag] = bson.M{"$ne": nil}
if f.OnlyTag != nil {
f.m[consts.Tag] = bson.M{"$elemMatch": bson.M{"$eq": *f.OnlyTag}}
} else {
f.m[consts.Tag] = bson.M{"$ne": nil}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions biz/infrastructure/util/convertor/convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func FileFilterOptionsToFilterOptions(opts *gencontent.FileFilterOptions) (filte
OnlyFileId: opts.OnlyFileId,
OnlyFatherId: opts.OnlyFatherId,
OnlyFileType: opts.OnlyFileType,

Check failure on line 144 in biz/infrastructure/util/convertor/convertor.go

View workflow job for this annotation

GitHub Actions / run (linux-amd64-fmt)

cannot use opts.OnlyFileType (variable of type *int32) as *int64 value in struct literal
OnlyTag: opts.OnlyTag,
IsDel: opts.IsDel,
DocumentType: opts.DocumentType,
}
Expand Down
5 changes: 0 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ require (
google.golang.org/grpc v1.60.1
)

replace (
github.com/CloudStriver/go-pkg => ../go-pkg
github.com/CloudStriver/service-idl-gen-go => ../service-idl-gen-go
)

require (
github.com/apache/thrift v0.16.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down

0 comments on commit 35d3b42

Please sign in to comment.