addentpersonlogic.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. IC "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/config"
  5. "bp.jydev.jianyu360.cn/BaseService/biService/service"
  6. "context"
  7. "github.com/gogf/gf/v2/util/gconv"
  8. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
  9. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
  10. "github.com/zeromicro/go-zero/core/logx"
  11. )
  12. type AddEntPersonLogic struct {
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. logx.Logger
  16. }
  17. func NewAddEntPersonLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddEntPersonLogic {
  18. return &AddEntPersonLogic{
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. Logger: logx.WithContext(ctx),
  22. }
  23. }
  24. func (l *AddEntPersonLogic) AddEntPerson(in *pb.AddEntPersonReq) (*pb.BiResp, error) {
  25. // todo: add your logic here and delete this line
  26. status, err := service.AddEntPerrson(in.EntId, in.Phone, in.PersonName, IC.IC.PaymentAddress)
  27. errMsg := ""
  28. if err != nil {
  29. errMsg = err.Error()
  30. }
  31. return &pb.BiResp{
  32. ErrorCode: gconv.Int64(common.If(status, 0, 1)),
  33. ErrorMsg: errMsg,
  34. }, err
  35. }