feat: 添加店铺邀请列表查询接口并修复 responded_at 未写入
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"juwan-backend/app/shop/rpc/internal/models/shopinvitations"
|
||||
"juwan-backend/app/shop/rpc/internal/svc"
|
||||
"juwan-backend/app/shop/rpc/pb"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -26,9 +27,13 @@ func NewUpdateShopInvitationsLogic(ctx context.Context, svcCtx *svc.ServiceConte
|
||||
}
|
||||
|
||||
func (l *UpdateShopInvitationsLogic) UpdateShopInvitations(in *pb.UpdateShopInvitationsReq) (*pb.UpdateShopInvitationsResp, error) {
|
||||
update, err := l.svcCtx.ShopModelRW.ShopInvitations.UpdateOneID(in.Id).
|
||||
builder := l.svcCtx.ShopModelRW.ShopInvitations.UpdateOneID(in.Id).
|
||||
Where(shopinvitations.PlayerIDEQ(in.PlayerId)).
|
||||
SetStatus(in.Status).Save(l.ctx)
|
||||
SetStatus(in.Status)
|
||||
if in.RespondedAt > 0 {
|
||||
builder = builder.SetRespondedAt(time.Unix(in.RespondedAt, 0))
|
||||
}
|
||||
update, err := builder.Save(l.ctx)
|
||||
if err != nil {
|
||||
logx.Errorf("failed to update shop invitation: %v", err)
|
||||
return nil, errors.New("failed to update shop invitation")
|
||||
|
||||
Reference in New Issue
Block a user