getcompanytypelogic.go 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
  5. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type GetCompanyTypeLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewGetCompanyTypeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCompanyTypeLogic {
  15. return &GetCompanyTypeLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *GetCompanyTypeLogic) GetCompanyType(req *types.GetCompanyTypeReq) (resp *types.BiResp, err error) {
  22. res, err := l.svcCtx.BiServiceRpc.GetCompanyType(l.ctx, &biservice.CompanyReq{
  23. CompanyName: req.CompanyName,
  24. })
  25. status := int64(0)
  26. if res != nil {
  27. status = res.Status
  28. }
  29. resp = &types.BiResp{
  30. Data: map[string]interface{}{
  31. "status": status,
  32. },
  33. }
  34. return resp, err
  35. }