From 249ee195ce52ee4a4defeb67a33ef353919d3a11 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 25 Jun 2023 19:09:54 +0200 Subject: feat: Add user list UI Fill user settings UI with actual data. --- pkg/components/user/controller.go | 1 + pkg/components/user/model.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 pkg/components/user/controller.go create mode 100644 pkg/components/user/model.go (limited to 'pkg/components/user') diff --git a/pkg/components/user/controller.go b/pkg/components/user/controller.go new file mode 100644 index 0000000..a00006b --- /dev/null +++ b/pkg/components/user/controller.go @@ -0,0 +1 @@ +package user diff --git a/pkg/components/user/model.go b/pkg/components/user/model.go new file mode 100644 index 0000000..f957c39 --- /dev/null +++ b/pkg/components/user/model.go @@ -0,0 +1,33 @@ +package user + +import "context" + +type ( + User struct { + ID uint + Username string + Name string + IsAdmin bool + Path string + } + + UpdateUser struct { + Username string + Name string + Password *string + } + + CreateUser struct { + Username string + Name string + Password string + IsAdmin bool + Path string + } + + Repository interface { + List(ctx context.Context) ([]*User, error) + Create(ctx context.Context, createUser *CreateUser) error + Update(ctx context.Context, id uint, updateUser *UpdateUser) error + } +) -- cgit v1.2.3