mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
[fix] 生成ID首位必须为字母
This commit is contained in:
@@ -186,7 +186,7 @@ func (p *DeviceApi) InsertDevice(rc *restfulx.ReqCtx) {
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
list, _ := p.DeviceApp.FindList(entity.Device{Name: data.Name})
|
||||
biz.IsTrue(!(list != nil && len(*list) > 0), fmt.Sprintf("名称%s已存在,设置其他命名", data.Name))
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateTdID("d")
|
||||
data.LinkStatus = global.INACTIVE
|
||||
data.LastAt = time.Now()
|
||||
data.Protocol = product.ProtocolName
|
||||
|
||||
@@ -107,7 +107,7 @@ func (p *ProductApi) GetProduct(rc *restfulx.ReqCtx) {
|
||||
func (p *ProductApi) InsertProduct(rc *restfulx.ReqCtx) {
|
||||
var data entity.Product
|
||||
restfulx.BindJsonAndValid(rc, &data)
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateTdID("p")
|
||||
data.Owner = rc.LoginAccount.UserName
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
// 如果未设置规则链,默认为主链
|
||||
|
||||
Reference in New Issue
Block a user