代码调整
This commit is contained in:
parent
2e7f368e06
commit
08a35b4070
|
|
@ -10,6 +10,26 @@ import (
|
||||||
"voucher/internal/biz/vo"
|
"voucher/internal/biz/vo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (c *CmbService) QueryProduct(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
|
||||||
|
|
||||||
|
bizReply, err := c.queryProduct(ctx, request)
|
||||||
|
if err != nil {
|
||||||
|
return c.QueryProductFail(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.QueryProductSuccess(ctx, bizReply)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CmbService) queryProduct(ctx context.Context, request *v1.CmbRequest) (*v1.CmbQueryProductReply, error) {
|
||||||
|
|
||||||
|
bizContent, err := c.CmbMixRepo.ProductQueryVerify(ctx, request)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.VoucherBiz.CmbProductQuery(ctx, bizContent.ActivityId)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *CmbService) QueryProductSuccess(ctx context.Context, bizReply *v1.CmbQueryProductReply) (*v1.CmbReply, error) {
|
func (c *CmbService) QueryProductSuccess(ctx context.Context, bizReply *v1.CmbQueryProductReply) (*v1.CmbReply, error) {
|
||||||
|
|
||||||
replyBizContent, _ := json.Marshal(bizReply)
|
replyBizContent, _ := json.Marshal(bizReply)
|
||||||
|
|
@ -37,23 +57,3 @@ func (c *CmbService) QueryProductFail(ctx context.Context, err error) (*v1.CmbRe
|
||||||
|
|
||||||
return c.GetResponse(ctx, replyBizContent)
|
return c.GetResponse(ctx, replyBizContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CmbService) QueryProduct(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
|
|
||||||
|
|
||||||
bizReply, err := c.queryProduct(ctx, request)
|
|
||||||
if err != nil {
|
|
||||||
return c.QueryProductFail(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.QueryProductSuccess(ctx, bizReply)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CmbService) queryProduct(ctx context.Context, request *v1.CmbRequest) (*v1.CmbQueryProductReply, error) {
|
|
||||||
|
|
||||||
bizContent, err := c.CmbMixRepo.ProductQueryVerify(ctx, request)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.VoucherBiz.CmbProductQuery(ctx, bizContent.ActivityId)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,27 @@ import (
|
||||||
v1 "voucher/api/v1"
|
v1 "voucher/api/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (c *CmbService) Query(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
|
||||||
|
|
||||||
|
orderNo, err := c.query(ctx, request)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return c.QueryFail(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.QuerySuccess(ctx, orderNo)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CmbService) query(ctx context.Context, request *v1.CmbRequest) (*v1.CmbQueryReply, error) {
|
||||||
|
|
||||||
|
bizContent, err := c.CmbMixRepo.QueryVerify(ctx, request)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.VoucherBiz.CmbQuery(ctx, bizContent.CodeNo)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *CmbService) QuerySuccess(ctx context.Context, bizReply *v1.CmbQueryReply) (*v1.CmbReply, error) {
|
func (c *CmbService) QuerySuccess(ctx context.Context, bizReply *v1.CmbQueryReply) (*v1.CmbReply, error) {
|
||||||
|
|
||||||
replyBizContent, _ := json.Marshal(bizReply)
|
replyBizContent, _ := json.Marshal(bizReply)
|
||||||
|
|
@ -29,24 +50,3 @@ func (c *CmbService) QueryFail(ctx context.Context, err error) (*v1.CmbReply, er
|
||||||
|
|
||||||
return c.GetResponse(ctx, replyBizContent)
|
return c.GetResponse(ctx, replyBizContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CmbService) Query(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
|
|
||||||
|
|
||||||
orderNo, err := c.query(ctx, request)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return c.QueryFail(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.QuerySuccess(ctx, orderNo)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CmbService) query(ctx context.Context, request *v1.CmbRequest) (*v1.CmbQueryReply, error) {
|
|
||||||
|
|
||||||
bizContent, err := c.CmbMixRepo.QueryVerify(ctx, request)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.VoucherBiz.CmbQuery(ctx, bizContent.CodeNo)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue