Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增背景图片url字段 #100

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions biz/application/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ func (s *UserService) GetUser(ctx context.Context, req *gencontent.GetUserReq) (
return resp, err
}
return &gencontent.GetUserResp{
Name: user.Name,
Sex: user.Sex,
FullName: user.FullName,
IdCard: user.IdCard,
Description: user.Description,
Url: user.Url,
CreateTime: user.CreateAt.UnixMilli(),
UpdateTime: user.UpdateAt.UnixMilli(),
Labels: user.Labels,
Name: user.Name,
Sex: user.Sex,
FullName: user.FullName,
IdCard: user.IdCard,
Description: user.Description,
Url: user.Url,
CreateTime: user.CreateAt.UnixMilli(),
UpdateTime: user.UpdateAt.UnixMilli(),
Labels: user.Labels,
BackgroundUrl: user.BackgroundUrl,
}, nil
}

Expand All @@ -117,14 +118,15 @@ func (s *UserService) CreateUser(ctx context.Context, req *gencontent.CreateUser
func (s *UserService) UpdateUser(ctx context.Context, req *gencontent.UpdateUserReq) (resp *gencontent.UpdateUserResp, err error) {
oid, _ := primitive.ObjectIDFromHex(req.UserId)
if _, err = s.UserMongoMapper.Update(ctx, &usermapper.User{
ID: oid,
Name: req.Name,
Sex: req.Sex,
FullName: req.FullName,
IdCard: req.IdCard,
Description: req.Description,
Url: req.Url,
Labels: req.Labels,
ID: oid,
Name: req.Name,
Sex: req.Sex,
FullName: req.FullName,
IdCard: req.IdCard,
Description: req.Description,
Url: req.Url,
Labels: req.Labels,
BackgroundUrl: req.BackgroundUrl,
}); err != nil {
return resp, err
}
Expand Down
23 changes: 12 additions & 11 deletions biz/infrastructure/mapper/user/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ type (
FindManyByIds(ctx context.Context, ids []string) ([]*User, error)
}
User struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name,omitempty" json:"name,omitempty"`
Sex int64 `bson:"sex,omitempty" json:"sex,omitempty"`
FullName string `bson:"fullName,omitempty" json:"fullName,omitempty"`
IdCard string `bson:"idCard,omitempty" json:"idCard,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
Url string `bson:"url,omitempty" json:"url,omitempty"`
UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"`
Labels []string `bson:"labels,omitempty" json:"labels,omitempty"`
Score_ float64 `bson:"_score,omitempty" json:"_score,omitempty"`
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
Name string `bson:"name,omitempty" json:"name,omitempty"`
Sex int64 `bson:"sex,omitempty" json:"sex,omitempty"`
FullName string `bson:"fullName,omitempty" json:"fullName,omitempty"`
IdCard string `bson:"idCard,omitempty" json:"idCard,omitempty"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
Url string `bson:"url,omitempty" json:"url,omitempty"`
BackgroundUrl string `bson:"backgroundUrl,omitempty" json:"backgroundUrl,omitempty"`
UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"`
Labels []string `bson:"labels,omitempty" json:"labels,omitempty"`
Score_ float64 `bson:"_score,omitempty" json:"_score,omitempty"`
}

MongoMapper struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/CloudStriver/cloudmind-mq v1.0.12-0.20240411042341-53be6a32a1ac
github.com/CloudStriver/go-pkg v0.0.0-20240329084540-20ca37a52fea
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240412035535-b11df688dcda
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240415063135-d3955d0682e0
github.com/bytedance/sonic v1.10.2
github.com/cloudwego/kitex v0.8.0
github.com/elastic/go-elasticsearch/v8 v8.11.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ github.com/CloudStriver/service-idl-gen-go v0.0.0-20240412033032-028d45340c2f h1
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240412033032-028d45340c2f/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240412035535-b11df688dcda h1:iHiWtcp1r3bOilaaK2rbARfxPtujVWcDo+UHdkpWB3Q=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240412035535-b11df688dcda/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240415063135-d3955d0682e0 h1:daaQ68hELBrjQW++Sw2ztgqr61FVhtJBjT0UI74CAhk=
github.com/CloudStriver/service-idl-gen-go v0.0.0-20240415063135-d3955d0682e0/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down
Loading