package common type BusinessException struct { Message string Code int } func (e *BusinessException) Error() string { return e.Message } func NewBusinessException(message string) *BusinessException { return &BusinessException{ Message: message, Code: 400, } } func NewNotFoundError(message string) *BusinessException { return &BusinessException{ Message: message, Code: 404, } } func NewConflictError(message string) *BusinessException { return &BusinessException{ Message: message, Code: 409, } } func NewBusinessExceptionWithCode(code int, message string) *BusinessException { return &BusinessException{ Message: message, Code: code, } }