6
0

test.go 543 B

123456789101112131415161718192021222324252627282930
  1. package handler
  2. import (
  3. "context"
  4. "fmt"
  5. "dashoo.cn/common_definition/comm_def"
  6. )
  7. type Nullable struct {
  8. Str *string
  9. Int *int
  10. Bool *bool
  11. Slice *[]int
  12. }
  13. type TestController struct{}
  14. func (s *TestController) Nullable(ctx context.Context, req *Nullable, rsp *comm_def.CommonMsg) error {
  15. fmt.Printf("%v \n", req)
  16. fmt.Printf("%v \n", req.Str)
  17. fmt.Printf("%v \n", req.Int)
  18. fmt.Printf("%v \n", req.Bool)
  19. fmt.Printf("%v \n", req.Slice)
  20. rsp.Code = 200
  21. rsp.Msg = "success"
  22. rsp.Data = nil
  23. fmt.Printf("%v \n", rsp)
  24. return nil
  25. }