splitted one operator module to file, account, image operators; splitted operator functions; etc

This commit is contained in:
2026-03-05 11:32:32 +02:00
parent 9ecd25ed0b
commit 80d6a244cf
54 changed files with 1049 additions and 826 deletions
+11 -11
View File
@@ -12,7 +12,7 @@ package handler
import (
"fmt"
"mstore/app/operator"
"mstore/app/accoper"
"mstore/app/router"
"mstore/pkg/terms"
)
@@ -21,7 +21,7 @@ import (
func (hand *Handler) CreateAccount(rctx *router.Context) {
var err error
params := &operator.CreateAccountParams{}
params := &accoper.CreateAccountParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -41,7 +41,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.CreateAccount(rctx.Ctx, operatorID, params)
res, err := hand.acop.CreateAccount(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -54,7 +54,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
func (hand *Handler) GetAccount(rctx *router.Context) {
var err error
params := &operator.GetAccountParams{}
params := &accoper.GetAccountParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -74,7 +74,7 @@ func (hand *Handler) GetAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.GetAccount(rctx.Ctx, operatorID, params)
res, err := hand.acop.GetAccount(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -87,7 +87,7 @@ func (hand *Handler) GetAccount(rctx *router.Context) {
func (hand *Handler) ListAccounts(rctx *router.Context) {
var err error
params := &operator.ListAccountsParams{}
params := &accoper.ListAccountsParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -107,7 +107,7 @@ func (hand *Handler) ListAccounts(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.ListAccounts(rctx.Ctx, params)
res, err := hand.acop.ListAccounts(rctx.Ctx, params)
if err != nil {
hand.logg.Errorf("ListAccounts error: %v", err)
hand.SendError(rctx, err)
@@ -120,7 +120,7 @@ func (hand *Handler) ListAccounts(rctx *router.Context) {
func (hand *Handler) UpdateAccount(rctx *router.Context) {
var err error
params := &operator.UpdateAccountParams{}
params := &accoper.UpdateAccountParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -140,7 +140,7 @@ func (hand *Handler) UpdateAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.UpdateAccount(rctx.Ctx, operatorID, params)
res, err := hand.acop.UpdateAccount(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("UpdateAccount error: %v", err)
hand.SendError(rctx, err)
@@ -153,7 +153,7 @@ func (hand *Handler) UpdateAccount(rctx *router.Context) {
func (hand *Handler) DeleteAccount(rctx *router.Context) {
var err error
params := &operator.DeleteAccountParams{}
params := &accoper.DeleteAccountParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -173,7 +173,7 @@ func (hand *Handler) DeleteAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.DeleteAccount(rctx.Ctx, operatorID, params)
res, err := hand.acop.DeleteAccount(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("DeleteAccount error: %v", err)
hand.SendError(rctx, err)