result_ok.go 281 B

123456789101112131415161718
  1. package rest_result
  2. import "git.ali33.ru/fcg-xvii/go-tools/json"
  3. func NewResultOK(data any) *ResultOK {
  4. if data == nil {
  5. data = json.Map{}
  6. }
  7. return &ResultOK{
  8. OK: true,
  9. Data: data,
  10. }
  11. }
  12. type ResultOK struct {
  13. OK bool `rest:"default"`
  14. Data any `rest:"default"`
  15. }