更改ID太长问题

This commit is contained in:
XM-GO
2023-09-19 10:18:50 +08:00
parent 4794e32106
commit a7d0cec2bf
16 changed files with 135 additions and 25 deletions

View File

@@ -2,9 +2,9 @@ package api
import (
"github.com/PandaXGO/PandaKit/restfulx"
"github.com/kakuilan/kgo"
"pandax/apps/device/entity"
"pandax/apps/device/services"
"pandax/pkg/tool"
"strings"
)
@@ -70,7 +70,7 @@ func (p *DeviceGroupApi) GetDeviceGroup(rc *restfulx.ReqCtx) {
func (p *DeviceGroupApi) InsertDeviceGroup(rc *restfulx.ReqCtx) {
var data entity.DeviceGroup
restfulx.BindJsonAndValid(rc, &data)
data.Id = kgo.KStr.Uniqid("dg_")
data.Id = tool.GenerateID()
data.Owner = rc.LoginAccount.UserName
data.OrgId = rc.LoginAccount.OrganizationId
p.DeviceGroupApp.Insert(data)