feat: CR login, register, subscribe
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package authdomain
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type LoginReq struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type LoginRepoResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package authdomain
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type RegisterUserReq struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Phone string `json:"phone"`
|
||||
SubscribePlanID string `json:"subscribe_plan_id"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Phone string `json:"phone"`
|
||||
SubscribeID string `json:"subscribe_id"`
|
||||
}
|
||||
|
||||
type RegisterStaffReq struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type Staff struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package domain
|
||||
|
||||
type StaffLoginReq struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type StaffLoginResponse struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package cachingdomain
|
||||
|
||||
import "time"
|
||||
|
||||
type CacheSpec struct {
|
||||
Key string
|
||||
TTL time.Duration
|
||||
Data any
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package subscribedomain
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type Subscribe struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
SubscribePlanID string `json:"subscribe_plan_id"`
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package subscribeplandomain
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type SubscribePlanReq struct {
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
type SubscribePlan struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Code string `json:"code"`
|
||||
}
|
||||
Reference in New Issue
Block a user