base.go 613 B

123456789101112131415161718192021222324
  1. package models
  2. type BaseResponse struct {
  3. Ret int
  4. Msg string
  5. ErrMsg string
  6. ErrCode string
  7. Data interface{}
  8. Success bool `description:"true 执行成功,false 执行失败"`
  9. IsSendEmail bool `json:"-" description:"true 发送邮件,false 不发送邮件"`
  10. IsAddLog bool `json:"-" description:"true 新增操作日志,false 不新增操作日志" `
  11. }
  12. func (r *BaseResponse) Init() *BaseResponse {
  13. return &BaseResponse{Ret: 403, IsSendEmail: true}
  14. }
  15. type BaseResponseT[T any] struct {
  16. Ret int
  17. Msg string
  18. ErrMsg string
  19. ErrCode string
  20. Data T
  21. }