transformerserver.go 782 B

1234567891011121314151617181920212223242526272829303132
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: transform.proto
  3. package server
  4. import (
  5. "context"
  6. "shorturl/rpc/transform/internal/logic"
  7. "shorturl/rpc/transform/internal/svc"
  8. transform "shorturl/rpc/transform/pb"
  9. )
  10. type TransformerServer struct {
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewTransformerServer(svcCtx *svc.ServiceContext) *TransformerServer {
  14. return &TransformerServer{
  15. svcCtx: svcCtx,
  16. }
  17. }
  18. func (s *TransformerServer) Expand(ctx context.Context, in *transform.ExpandReq) (*transform.ExpandResp, error) {
  19. l := logic.NewExpandLogic(ctx, s.svcCtx)
  20. return l.Expand(in)
  21. }
  22. func (s *TransformerServer) Shorten(ctx context.Context, in *transform.ShortenReq) (*transform.ShortenResp, error) {
  23. l := logic.NewShortenLogic(ctx, s.svcCtx)
  24. return l.Shorten(in)
  25. }