提交 1.3.0-beta4

This commit is contained in:
dushixiang
2022-10-29 17:36:24 +08:00
parent f87d44d38b
commit b6150c77f8
15 changed files with 104 additions and 135 deletions

View File

@ -3,15 +3,14 @@ package repository
import (
"context"
"fmt"
"next-terminal/server/common/nt"
"strconv"
"strings"
"next-terminal/server/common/maps"
"next-terminal/server/common/nt"
"next-terminal/server/config"
"next-terminal/server/model"
"next-terminal/server/utils"
"github.com/labstack/echo/v4"
)
var AssetRepository = new(assetRepository)
@ -172,7 +171,7 @@ func (r assetRepository) FindTags(c context.Context) (o []string, err error) {
return utils.Distinct(o), nil
}
func (r assetRepository) UpdateAttributes(c context.Context, assetId, protocol string, m echo.Map) error {
func (r assetRepository) UpdateAttributes(c context.Context, assetId, protocol string, m maps.Map) error {
var data []model.AssetAttribute
var parameterNames []string
switch protocol {
@ -202,7 +201,7 @@ func (r assetRepository) UpdateAttributes(c context.Context, assetId, protocol s
return r.GetDB(c).CreateInBatches(&data, len(data)).Error
}
func genAttribute(assetId, name string, m echo.Map) model.AssetAttribute {
func genAttribute(assetId, name string, m maps.Map) model.AssetAttribute {
value := fmt.Sprintf("%v", m[name])
attribute := model.AssetAttribute{
Id: utils.Sign([]string{assetId, name}),