Documentation
¶
Index ¶
- Variables
- type FormService
- type GenericDBService
- type SchemaService
- type SchemaServiceImpl
- func (s *SchemaServiceImpl) CreateSchema(userID uuid.UUID, formID uuid.UUID, schema model.FormSchemaModel) error
- func (s *SchemaServiceImpl) DeleteSchema(userID uuid.UUID, formID uuid.UUID, schemaID uuid.UUID) error
- func (s *SchemaServiceImpl) GetSchema(formID uuid.UUID, schemaID uuid.UUID) (model.FormSchemaModel, error)
- func (s *SchemaServiceImpl) GetSchemas(formID uuid.UUID) ([]model.FormSchemaModel, error)
- func (s *SchemaServiceImpl) UpdateSchema(username uuid.UUID, formID uuid.UUID, schemaID uuid.UUID, ...) error
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoPermission = errors.New("no permission")
)
Functions ¶
This section is empty.
Types ¶
type FormService ¶
type FormService interface { GetFormsOfUser(userID uuid.UUID) ([]model.FormModel, error) GetForm(formID uuid.UUID) (model.FormModel, error) GetForms() ([]model.FormModel, error) CreateForm(userID uuid.UUID, title string) error UpdateForm(userID uuid.UUID, id uuid.UUID, title string) error DeleteForm(userID uuid.UUID, id uuid.UUID) error }
func NewFormService ¶
func NewFormService(db *bun.DB) FormService
type GenericDBService ¶
type GenericDBService[T any] interface { GetModelByID(id uuid.UUID) (T, error) GetModel(whereQuery string, args ...interface{}) (T, error) GetModels(whereQuery string, args ...interface{}) ([]T, error) InsertModel(model T, columns ...string) error UpdateModel(model T, id uuid.UUID, columns ...string) error DeleteModelByID(id uuid.UUID) error }
func NewGenericDBService ¶
func NewGenericDBService[T any](db *bun.DB) GenericDBService[T]
type SchemaService ¶
type SchemaService interface { GetSchemas(formID uuid.UUID) ([]model.FormSchemaModel, error) GetSchema(formID uuid.UUID, schemaID uuid.UUID) (model.FormSchemaModel, error) CreateSchema(formID uuid.UUID, userID uuid.UUID, formSchema model.FormSchemaModel) error UpdateSchema(username uuid.UUID, formID uuid.UUID, schemaID uuid.UUID, schemaData map[string]interface{}) error DeleteSchema(userID uuid.UUID, formID uuid.UUID, schemaID uuid.UUID) error }
func NewSchemaService ¶
func NewSchemaService(db *bun.DB) SchemaService
type SchemaServiceImpl ¶
type SchemaServiceImpl struct {
// contains filtered or unexported fields
}
func (*SchemaServiceImpl) CreateSchema ¶
func (s *SchemaServiceImpl) CreateSchema(userID uuid.UUID, formID uuid.UUID, schema model.FormSchemaModel) error
func (*SchemaServiceImpl) DeleteSchema ¶
func (*SchemaServiceImpl) GetSchema ¶
func (s *SchemaServiceImpl) GetSchema(formID uuid.UUID, schemaID uuid.UUID) (model.FormSchemaModel, error)
func (*SchemaServiceImpl) GetSchemas ¶
func (s *SchemaServiceImpl) GetSchemas(formID uuid.UUID) ([]model.FormSchemaModel, error)
type UserService ¶
type UserService interface { RegisterUser(user model.UserModel) error LoginUser(user model.UserModel) (string, error) GetUserById(id uuid.UUID) (model.UserModel, error) UpdateUser(id uuid.UUID, password string) error DeleteUser(id uuid.UUID) error }
func NewUserService ¶
func NewUserService(db *bun.DB, passwordService *auth.PasswordService, jwtService *auth.JWTService) UserService
Click to show internal directories.
Click to hide internal directories.