first commit
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package review
|
||||
|
||||
import (
|
||||
"context"
|
||||
"tianyuan-api/apps/user/client/enterprise"
|
||||
|
||||
"tianyuan-api/apps/admin/internal/svc"
|
||||
"tianyuan-api/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetPendingEnterpriseLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetPendingEnterpriseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPendingEnterpriseLogic {
|
||||
return &GetPendingEnterpriseLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetPendingEnterpriseLogic) GetPendingEnterprise(req *types.GetPendingEnterpriseReq) (resp *types.GetPendingEnterpriseResp, err error) {
|
||||
pendingEnterpriseList, err := l.svcCtx.EntRpc.GetPendingEnterprise(l.ctx, &enterprise.GetPendingEnterpriseReq{Page: req.Page, PageSize: req.PageSize})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var list []types.EnterpriseItem
|
||||
|
||||
for _, ent := range pendingEnterpriseList.List {
|
||||
list = append(list, types.EnterpriseItem{
|
||||
Id: ent.Id,
|
||||
EnterpriseName: ent.EnterpriseName,
|
||||
EnterpriseContact: ent.EnterpriseContact,
|
||||
CreditCode: ent.CreditCode,
|
||||
LegalPerson: ent.LegalPerson,
|
||||
AuthStatus: ent.AuthStatus,
|
||||
BusinessLicense: ent.BusinessLicense,
|
||||
UpdatedAt: ent.UpdatedAt,
|
||||
CreatedAt: ent.CreatedAt,
|
||||
})
|
||||
}
|
||||
resp = &types.GetPendingEnterpriseResp{
|
||||
Total: pendingEnterpriseList.Total,
|
||||
List: list,
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
37
apps/admin/internal/logic/review/reviewenterpriselogic.go
Normal file
37
apps/admin/internal/logic/review/reviewenterpriselogic.go
Normal file
@@ -0,0 +1,37 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user