refactor: migrate from raw pgx to GORM, unify ErrNoRows, cleanup auth
ci / build (push) Successful in 2m58s
ci / build (pull_request) Successful in 2m47s

This commit is contained in:
Mephimeow
2026-06-14 16:41:33 +00:00
parent 9da532e9dc
commit 2da484d781
19 changed files with 321 additions and 348 deletions
+8 -6
View File
@@ -3,16 +3,16 @@ package org
import "time"
type Organization struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID string `gorm:"type:uuid;primaryKey" json:"id"`
Name string `gorm:"type:text;not null" json:"name"`
Slug string `gorm:"type:text;not null;uniqueIndex" json:"slug"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
}
type CreateOrgRequest struct {
Name string `json:"name" binding:"required,min=2,max=100" example:"My Corp"`
Slug string `json:"slug" binding:"required,min=2,max=50" example:"my-corp"`
Slug string `json:"slug" binding:"required,min=2,max=50" example:"my-corp"`
}
type UpdateOrgRequest struct {
@@ -26,6 +26,8 @@ type OrgResponse struct {
type OrgListResponse struct {
Organizations []Organization `json:"organizations"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
type ErrorResponse struct {