right type used
This commit is contained in:
@@ -16,13 +16,13 @@ import (
|
||||
|
||||
"mstore/app/handler"
|
||||
"mstore/app/operator"
|
||||
"mstore/pkg/auxuuid"
|
||||
"mstore/pkg/descr"
|
||||
"mstore/pkg/uuid"
|
||||
)
|
||||
|
||||
func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, password string) (auxuuid.UUID, error) {
|
||||
func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, password string) (uuid.UUID, error) {
|
||||
var err error
|
||||
var res auxuuid.UUID
|
||||
var res uuid.UUID
|
||||
|
||||
apiuri, err := setApiPath(hosturi, "/v3/api/account/create")
|
||||
if err != nil {
|
||||
@@ -54,7 +54,7 @@ func (cli *Client) CreateAccount(ctx context.Context, hosturi, username, passwor
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) GetAccountByID(ctx context.Context, hosturi string, id auxuuid.UUID) (*descr.AccountShort, error) {
|
||||
func (cli *Client) GetAccountByID(ctx context.Context, hosturi string, id uuid.UUID) (*descr.AccountShort, error) {
|
||||
var err error
|
||||
res := &descr.AccountShort{}
|
||||
|
||||
@@ -121,7 +121,7 @@ func (cli *Client) GetAccountByName(ctx context.Context, hosturi, username strin
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, id auxuuid.UUID, newUsername, newPassword string) error {
|
||||
func (cli *Client) UpdateAccountByID(ctx context.Context, hosturi string, id uuid.UUID, newUsername, newPassword string) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/account/update")
|
||||
@@ -215,7 +215,7 @@ func (cli *Client) DeleteAccountByName(ctx context.Context, hosturi, username st
|
||||
return err
|
||||
}
|
||||
|
||||
func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi string, id auxuuid.UUID) error {
|
||||
func (cli *Client) DeleteAccountByID(ctx context.Context, hosturi string, id uuid.UUID) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/account/delete")
|
||||
|
||||
+10
-9
@@ -16,13 +16,14 @@ import (
|
||||
|
||||
"mstore/app/handler"
|
||||
"mstore/app/operator"
|
||||
"mstore/pkg/auxuuid"
|
||||
"mstore/pkg/descr"
|
||||
"mstore/pkg/terms"
|
||||
"mstore/pkg/uuid"
|
||||
)
|
||||
|
||||
func (cli *Client) CreateGrantByAccountID(ctx context.Context, hosturi string, accountID auxuuid.UUID, right, pattern string) (auxuuid.UUID, error) {
|
||||
func (cli *Client) CreateGrantByAccountID(ctx context.Context, hosturi string, accountID uuid.UUID, right terms.Right, pattern string) (uuid.UUID, error) {
|
||||
var err error
|
||||
var res auxuuid.UUID
|
||||
var res uuid.UUID
|
||||
|
||||
apiuri, err := setApiPath(hosturi, "/v3/api/grant/create")
|
||||
if err != nil {
|
||||
@@ -55,9 +56,9 @@ func (cli *Client) CreateGrantByAccountID(ctx context.Context, hosturi string, a
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) CreateGrantByUsername(ctx context.Context, hosturi, username, right, pattern string) (auxuuid.UUID, error) {
|
||||
func (cli *Client) CreateGrantByUsername(ctx context.Context, hosturi, username string, right terms.Right, pattern string) (uuid.UUID, error) {
|
||||
var err error
|
||||
var res auxuuid.UUID
|
||||
var res uuid.UUID
|
||||
|
||||
apiuri, err := setApiPath(hosturi, "/v3/api/grant/create")
|
||||
if err != nil {
|
||||
@@ -90,7 +91,7 @@ func (cli *Client) CreateGrantByUsername(ctx context.Context, hosturi, username,
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) GetGrant(ctx context.Context, hosturi string, id auxuuid.UUID) (*descr.Grant, error) {
|
||||
func (cli *Client) GetGrant(ctx context.Context, hosturi string, id uuid.UUID) (*descr.Grant, error) {
|
||||
var err error
|
||||
res := &descr.Grant{}
|
||||
|
||||
@@ -123,7 +124,7 @@ func (cli *Client) GetGrant(ctx context.Context, hosturi string, id auxuuid.UUID
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (cli *Client) UpdateGrant(ctx context.Context, hosturi string, grantID auxuuid.UUID, newPattern string) error {
|
||||
func (cli *Client) UpdateGrant(ctx context.Context, hosturi string, grantID uuid.UUID, newPattern string) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/grant/update")
|
||||
@@ -154,7 +155,7 @@ func (cli *Client) UpdateGrant(ctx context.Context, hosturi string, grantID auxu
|
||||
return err
|
||||
}
|
||||
|
||||
func (cli *Client) DeleteGrant(ctx context.Context, hosturi string, grantID auxuuid.UUID) error {
|
||||
func (cli *Client) DeleteGrant(ctx context.Context, hosturi string, grantID uuid.UUID) error {
|
||||
var err error
|
||||
|
||||
apipath, err := setApiPath(hosturi, "/v3/api/grant/delete")
|
||||
@@ -185,7 +186,7 @@ func (cli *Client) DeleteGrant(ctx context.Context, hosturi string, grantID auxu
|
||||
return err
|
||||
}
|
||||
|
||||
func (cli *Client) ListGrantsByAccountID(ctx context.Context, hosturi string, accountID auxuuid.UUID) ([]descr.Grant, error) {
|
||||
func (cli *Client) ListGrantsByAccountID(ctx context.Context, hosturi string, accountID uuid.UUID) ([]descr.Grant, error) {
|
||||
var err error
|
||||
res := make([]descr.Grant, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user