38 lines
911 B
Go
38 lines
911 B
Go
|
package review
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"tianyuan-api/apps/admin/internal/svc"
|
||
|
"tianyuan-api/apps/admin/internal/types"
|
||
|
"tianyuan-api/apps/user/client/enterprise"
|
||
|
|
||
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
)
|
||
|
|
||
|
type ReviewEnterpriseLogic struct {
|
||
|
logx.Logger
|
||
|
ctx context.Context
|
||
|
svcCtx *svc.ServiceContext
|
||
|
}
|
||
|
|
||
|
func NewReviewEnterpriseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ReviewEnterpriseLogic {
|
||
|
return &ReviewEnterpriseLogic{
|
||
|
Logger: logx.WithContext(ctx),
|
||
|
ctx: ctx,
|
||
|
svcCtx: svcCtx,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (l *ReviewEnterpriseLogic) ReviewEnterprise(req *types.ReviewEnterpriseReq) (resp *types.ReviewEnterpriseResp, err error) {
|
||
|
|
||
|
_, err = l.svcCtx.EntRpc.ReviewEnterprise(l.ctx, &enterprise.ReviewEnterpriseReq{
|
||
|
EnterpriseId: req.EnterpriseID,
|
||
|
Status: req.Status,
|
||
|
Remarks: req.Remarks,
|
||
|
})
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &types.ReviewEnterpriseResp{}, nil
|
||
|
}
|