|
@@ -28,15 +28,19 @@ func NewDocCollectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocCol
|
|
|
|
|
|
func (l *DocCollectLogic) DocCollect(in *userlib.UserCollectRequest) (*userlib.UserCollectResponse, error) {
|
|
func (l *DocCollectLogic) DocCollect(in *userlib.UserCollectRequest) (*userlib.UserCollectResponse, error) {
|
|
// todo: add your logic here and delete this line
|
|
// todo: add your logic here and delete this line
|
|
|
|
+ result := &userlib.UserCollectResponse{}
|
|
b := userLibService.UserDocCollect(
|
|
b := userLibService.UserDocCollect(
|
|
&model.UserDoc{
|
|
&model.UserDoc{
|
|
UserId: in.UserId,
|
|
UserId: in.UserId,
|
|
DocId: in.DocId,
|
|
DocId: in.DocId,
|
|
AppId: in.AppId,
|
|
AppId: in.AppId,
|
|
}, int(in.Cost))
|
|
}, int(in.Cost))
|
|
|
|
+ result.Code = 0
|
|
|
|
+ result.Message = "收藏失败"
|
|
|
|
+ if b {
|
|
|
|
+ result.Code = 1
|
|
|
|
+ result.Message = "收藏成功"
|
|
|
|
+ }
|
|
log.Printf("用户文档收藏,userId:[%s],docId:[%s] 是否成功:[%v]", in.UserId, in.DocId, b)
|
|
log.Printf("用户文档收藏,userId:[%s],docId:[%s] 是否成功:[%v]", in.UserId, in.DocId, b)
|
|
- return &userlib.UserCollectResponse{
|
|
|
|
- Code: 200,
|
|
|
|
- Message: "success",
|
|
|
|
- }, nil
|
|
|
|
|
|
+ return result, nil
|
|
}
|
|
}
|