getindustrylogic.go 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/api/internal/svc"
  4. "app.yhyue.com/moapp/jyInfo/api/internal/types"
  5. common2 "app.yhyue.com/moapp/jyInfo/rpc/common/commonclient"
  6. "app.yhyue.com/moapp/jybase/common"
  7. "context"
  8. "fmt"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type GetIndustryLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewGetIndustryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetIndustryLogic {
  17. return &GetIndustryLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. func (l *GetIndustryLogic) GetIndustry() (resp *types.CommonRes, err error) {
  24. //AppId用不到,暂时写死放这里
  25. res, err0 := l.svcCtx.Common.IndustryInfo(l.ctx, &common2.ProjectReq{AppId: "10000"})
  26. fmt.Println(err0)
  27. if err0 != nil {
  28. return &types.CommonRes{
  29. Err_code: -1,
  30. Err_msg: "错误",
  31. }, nil
  32. }
  33. return &types.CommonRes{
  34. Err_code: common.IntAll(res.ErrCode),
  35. Err_msg: res.ErrMsg,
  36. Data: res.Data,
  37. }, nil
  38. }