refactor(models,ddb): rename miltiple object models and related functions
This commit is contained in:
parent
db213bd559
commit
b3cd25117f
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/jackc/pgx/v5/pgconn"
|
"github.com/jackc/pgx/v5/pgconn"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PersonsGet(ctx context.Context, user_id, filter, sort string, limit, offset int) (persons models.Persons, statusCode int, err error) {
|
func PersonGetSlice(ctx context.Context, user_id, filter, sort string, limit, offset int) (persons models.PersonSlice, statusCode int, err error) {
|
||||||
ok, _ := UserAuth(ctx, user_id)
|
ok, _ := UserAuth(ctx, user_id)
|
||||||
if !ok {
|
if !ok {
|
||||||
err = fmt.Errorf("unauthorized")
|
err = fmt.Errorf("unauthorized")
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/jackc/pgx/v5/pgconn"
|
"github.com/jackc/pgx/v5/pgconn"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RolesGet(ctx context.Context, user_id, filter, sort string, limit, offset int) (roles models.Roles, statusCode int, err error) {
|
func RoleGetSlice(ctx context.Context, user_id, filter, sort string, limit, offset int) (roles models.RoleSlice, statusCode int, err error) {
|
||||||
ok, _ := UserAuth(ctx, user_id)
|
ok, _ := UserAuth(ctx, user_id)
|
||||||
if !ok {
|
if !ok {
|
||||||
err = fmt.Errorf("unauthorized")
|
err = fmt.Errorf("unauthorized")
|
||||||
|
|||||||
@ -7,32 +7,32 @@ type Pagination struct {
|
|||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Persons struct {
|
type PersonSlice struct {
|
||||||
Pagination Pagination `json:"pagination"`
|
Pagination Pagination `json:"pagination"`
|
||||||
Persons []PersonBrief `json:"persons"`
|
Persons []PersonBrief `json:"persons"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Roles struct {
|
type RoleSlice struct {
|
||||||
Pagination Pagination `json:"pagination"`
|
Pagination Pagination `json:"pagination"`
|
||||||
Roles []Role `json:"roles"`
|
Roles []Role `json:"roles"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Artists struct {
|
type ArtistSlice struct {
|
||||||
Pagination Pagination `json:"pagination"`
|
Pagination Pagination `json:"pagination"`
|
||||||
Artists []ArtistBrief `json:"artists"`
|
Artists []ArtistBrief `json:"artists"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tracks struct {
|
type TrackSlice struct {
|
||||||
Pagination Pagination `json:"pagination"`
|
Pagination Pagination `json:"pagination"`
|
||||||
Tracks []TrackBrief `json:"tracks"`
|
Tracks []TrackBrief `json:"tracks"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Aliases struct {
|
type AliasSlice struct {
|
||||||
Pagination Pagination `json:"pagination"`
|
Pagination Pagination `json:"pagination"`
|
||||||
Aliases []Alias `json:"aliases"`
|
Aliases []Alias `json:"aliases"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Kirokus struct {
|
type KirokuSlice struct {
|
||||||
Pagination Pagination `json:"pagination"`
|
Pagination Pagination `json:"pagination"`
|
||||||
Kirokus []Kiroku `json:"kirokus"`
|
Kirokus []Kiroku `json:"kirokus"`
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user