first commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package userproductlogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/sentinel/internal/svc"
|
||||
"tianyuan-api/apps/sentinel/sentinel"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type MatchingUserIdProductCodeLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewMatchingUserIdProductCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MatchingUserIdProductCodeLogic {
|
||||
return &MatchingUserIdProductCodeLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *MatchingUserIdProductCodeLogic) MatchingUserIdProductCode(in *sentinel.MatchingUserIdProductCodeRequest) (*sentinel.MatchResponse, error) {
|
||||
match, err := l.svcCtx.UserProductsModel.FindMatchUserProductCode(l.ctx, in.Id, in.ProductCode)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &sentinel.MatchResponse{
|
||||
Match: match,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user