datasmtdetaillogic.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "context"
  4. "jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/datasmt"
  5. "jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/api/internal/svc"
  6. "jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type DatasmtDetailLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewDatasmtDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DatasmtDetailLogic {
  15. return &DatasmtDetailLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *DatasmtDetailLogic) DatasmtDetail(req *types.DatasmtReqDetail) (resp *types.CommonResp, err error) {
  22. // todo: add your logic here and delete this line
  23. res, err := l.svcCtx.PublicService.Detail(l.ctx, &datasmt.DatasmtReqDetail{
  24. Id: req.Id,
  25. })
  26. if err != nil {
  27. return &types.CommonResp{
  28. Err_code: -1,
  29. Err_msg: "错误",
  30. Data: nil,
  31. }, nil
  32. }
  33. return &types.CommonResp{
  34. Data: res,
  35. }, nil
  36. }