servicelogic.go 571 B

123456789101112131415161718192021222324252627282930
  1. package logic
  2. import (
  3. "context"
  4. "apklink/service/internal/svc"
  5. "apklink/service/internal/types"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type ServiceLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) ServiceLogic {
  14. return ServiceLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *ServiceLogic) Service(req types.Request) (resp *types.Response, err error) {
  21. return &types.Response{
  22. Message: "Hello go-zero",
  23. }, nil
  24. }