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) CreateGrant(rctx *router.Context) {
var err error
params := &operator.CreateGrantParams{}
params := &accoper.CreateGrantParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -41,7 +41,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.CreateGrant(rctx.Ctx, operatorID, params)
res, err := hand.acop.CreateGrant(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("CreateGrant error: %v", err)
hand.SendError(rctx, err)
@@ -54,7 +54,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
func (hand *Handler) GetGrant(rctx *router.Context) {
var err error
params := &operator.GetGrantParams{}
params := &accoper.GetGrantParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -74,7 +74,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.GetGrant(rctx.Ctx, operatorID, params)
res, err := hand.acop.GetGrant(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("CreateGrant error: %v", err)
hand.SendError(rctx, err)
@@ -87,7 +87,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
func (hand *Handler) ListGrants(rctx *router.Context) {
var err error
params := &operator.ListGrantsParams{}
params := &accoper.ListGrantsParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -107,7 +107,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.ListGrants(rctx.Ctx, operatorID, params)
res, err := hand.acop.ListGrants(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("ListGrants error: %v", err)
hand.SendError(rctx, err)
@@ -120,7 +120,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
func (hand *Handler) UpdateGrant(rctx *router.Context) {
var err error
params := &operator.UpdateGrantParams{}
params := &accoper.UpdateGrantParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -140,7 +140,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.UpdateGrant(rctx.Ctx, operatorID, params)
res, err := hand.acop.UpdateGrant(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("UpdateGrant error: %v", err)
hand.SendError(rctx, err)
@@ -153,7 +153,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
func (hand *Handler) DeleteGrant(rctx *router.Context) {
var err error
params := &operator.DeleteGrantParams{}
params := &accoper.DeleteGrantParams{}
err = rctx.BindJSON(params)
if err != nil {
hand.SendError(rctx, err)
@@ -173,7 +173,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.DeleteGrant(rctx.Ctx, operatorID, params)
res, err := hand.acop.DeleteGrant(rctx.Ctx, operatorID, params)
if err != nil {
hand.logg.Errorf("DeleteGrant error: %v", err)
hand.SendError(rctx, err)