base.go 603 B

1234567891011121314151617181920212223
  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 BaseRequest struct {
  16. }
  17. func (br *BaseRequest) Init() *BaseRequest {
  18. return &BaseRequest{}
  19. }