uuid used
This commit is contained in:
+14
-14
@@ -15,10 +15,10 @@ type CreateAccountParams struct {
|
||||
Password string `json:"password"`
|
||||
}
|
||||
type CreateAccountResult struct {
|
||||
AccountID string `json:"accountId"`
|
||||
AccountID auxuuid.UUID `json:"accountId"`
|
||||
}
|
||||
|
||||
func (oper *Operator) CreateAccount(ctx context.Context, operatorID string, params *CreateAccountParams) (*CreateAccountResult, error) {
|
||||
func (oper *Operator) CreateAccount(ctx context.Context, operatorID auxuuid.UUID, params *CreateAccountParams) (*CreateAccountResult, error) {
|
||||
var err error
|
||||
res := &CreateAccountResult{}
|
||||
|
||||
@@ -62,14 +62,14 @@ func (oper *Operator) CreateAccount(ctx context.Context, operatorID string, para
|
||||
|
||||
// GetAccount
|
||||
type GetAccountParams struct {
|
||||
Username string `json:"username"`
|
||||
AccountID string `json:"accountId"`
|
||||
Username string `json:"username"`
|
||||
AccountID auxuuid.UUID `json:"accountId"`
|
||||
}
|
||||
type GetAccountResult struct {
|
||||
Account *descr.AccountShort `json:"account"`
|
||||
}
|
||||
|
||||
func (oper *Operator) GetAccount(ctx context.Context, params *GetAccountParams) (*GetAccountResult, error) {
|
||||
func (oper *Operator) GetAccount(ctx context.Context, operatorID auxuuid.UUID, params *GetAccountParams) (*GetAccountResult, error) {
|
||||
var err error
|
||||
res := &GetAccountResult{}
|
||||
|
||||
@@ -128,15 +128,15 @@ func (oper *Operator) GetAccount(ctx context.Context, params *GetAccountParams)
|
||||
}
|
||||
|
||||
type UpdateAccountParams struct {
|
||||
Username string `json:"username"`
|
||||
AccountID string `json:"accountId"`
|
||||
NewUsername string `json:"newUsername"`
|
||||
NewPassword string `json:"newPassword"`
|
||||
Disabled bool `json:"disabled"`
|
||||
Username string `json:"username"`
|
||||
AccountID auxuuid.UUID `json:"accountId"`
|
||||
NewUsername string `json:"newUsername"`
|
||||
NewPassword string `json:"newPassword"`
|
||||
Disabled bool `json:"disabled"`
|
||||
}
|
||||
type UpdateAccountResult struct{}
|
||||
|
||||
func (oper *Operator) UpdateAccount(ctx context.Context, params *UpdateAccountParams) (*UpdateAccountResult, error) {
|
||||
func (oper *Operator) UpdateAccount(ctx context.Context, operatorID auxuuid.UUID, params *UpdateAccountParams) (*UpdateAccountResult, error) {
|
||||
var err error
|
||||
res := &UpdateAccountResult{}
|
||||
if params.Username == "" && params.AccountID == "" {
|
||||
@@ -195,12 +195,12 @@ func (oper *Operator) UpdateAccount(ctx context.Context, params *UpdateAccountPa
|
||||
}
|
||||
|
||||
type DeleteAccountParams struct {
|
||||
Username string `json:"username"`
|
||||
AccountID string `json:"accountId"`
|
||||
Username string `json:"username"`
|
||||
AccountID auxuuid.UUID `json:"accountId"`
|
||||
}
|
||||
type DeleteAccountResult struct{}
|
||||
|
||||
func (oper *Operator) DeleteAccount(ctx context.Context, params *DeleteAccountParams) (*DeleteAccountResult, error) {
|
||||
func (oper *Operator) DeleteAccount(ctx context.Context, operatorID auxuuid.UUID, params *DeleteAccountParams) (*DeleteAccountResult, error) {
|
||||
var err error
|
||||
res := &DeleteAccountResult{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user