mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[优化]
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/develop/gen"
|
||||
"pandax/apps/develop/services"
|
||||
"pandax/kit/restfulx"
|
||||
)
|
||||
|
||||
type GenApi struct {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/develop/api/vo"
|
||||
"pandax/apps/develop/entity"
|
||||
"pandax/apps/develop/gen"
|
||||
"pandax/apps/develop/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type DevGenTable struct {
|
||||
TableId int64 `gorm:"primaryKey;autoIncrement" json:"tableId"` // 编号
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
"sync"
|
||||
"text/template"
|
||||
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/develop/entity"
|
||||
"pandax/apps/develop/services"
|
||||
sysEntity "pandax/apps/system/entity"
|
||||
sysServices "pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
|
||||
"github.com/kakuilan/kgo"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/develop/api"
|
||||
"pandax/apps/develop/services"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/develop/api"
|
||||
"pandax/apps/develop/api/vo"
|
||||
"pandax/apps/develop/entity"
|
||||
"pandax/apps/develop/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -2,9 +2,9 @@ package services
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/develop/entity"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/global/model"
|
||||
)
|
||||
|
||||
@@ -7,10 +7,10 @@ package api
|
||||
// ==========================================================================
|
||||
import (
|
||||
"fmt"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/pkg/cache"
|
||||
"pandax/pkg/global"
|
||||
"strings"
|
||||
@@ -166,7 +166,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.GenerateTdID("d")
|
||||
data.Id = utils.GenerateID("d")
|
||||
data.LinkStatus = global.INACTIVE
|
||||
data.LastAt = time.Now()
|
||||
data.Protocol = product.ProtocolName
|
||||
|
||||
@@ -2,9 +2,9 @@ package api
|
||||
|
||||
// ==========================================================================
|
||||
import (
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"strings"
|
||||
|
||||
"pandax/apps/device/entity"
|
||||
|
||||
@@ -3,9 +3,9 @@ package api
|
||||
// ==========================================================================
|
||||
import (
|
||||
"encoding/json"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
devicerpc "pandax/pkg/device_rpc"
|
||||
"strings"
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -80,7 +80,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 = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("dg")
|
||||
data.Owner = rc.LoginAccount.UserName
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
p.DeviceGroupApp.Insert(data)
|
||||
|
||||
@@ -7,10 +7,10 @@ package api
|
||||
// ==========================================================================
|
||||
import (
|
||||
"fmt"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/pkg/global"
|
||||
"strings"
|
||||
|
||||
@@ -112,7 +112,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.GenerateTdID("p")
|
||||
data.Id = utils.GenerateID("p")
|
||||
data.Owner = rc.LoginAccount.UserName
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
// 如果未设置规则链,默认为主链
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -66,7 +66,7 @@ func (p *ProductCategoryApi) GetProductCategory(rc *restfulx.ReqCtx) {
|
||||
func (p *ProductCategoryApi) InsertProductCategory(rc *restfulx.ReqCtx) {
|
||||
var data entity.ProductCategory
|
||||
restfulx.BindJsonAndValid(rc, &data)
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("pc")
|
||||
data.Owner = rc.LoginAccount.UserName
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
p.ProductCategoryApp.Insert(data)
|
||||
|
||||
@@ -2,10 +2,10 @@ package api
|
||||
|
||||
// ==========================================================================
|
||||
import (
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/pkg/tool"
|
||||
"path"
|
||||
"strings"
|
||||
@@ -56,7 +56,7 @@ func (p *ProductOtaApi) InsertProductOta(rc *restfulx.ReqCtx) {
|
||||
// 生成文件MD5值
|
||||
md5, err := tool.GetFileMd5(path.Join(filePath, data.Url))
|
||||
biz.ErrIsNil(err, "读取文件md5校验值错误")
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("ota")
|
||||
data.Check = md5
|
||||
p.ProductOtaApp.Insert(data)
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/pkg/global"
|
||||
"strings"
|
||||
|
||||
@@ -59,7 +59,7 @@ func (p *ProductTemplateApi) GetProductTemplate(rc *restfulx.ReqCtx) {
|
||||
func (p *ProductTemplateApi) InsertProductTemplate(rc *restfulx.ReqCtx) {
|
||||
var data entity.ProductTemplate
|
||||
restfulx.BindJsonAndValid(rc, &data)
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("pt")
|
||||
if data.Classify == entity.ATTRIBUTES_TSL || data.Classify == entity.TELEMETRY_TSL {
|
||||
// 向超级表及子表中添加字段
|
||||
len := 100
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
ruleService "pandax/apps/rule/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/device/api"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/apps/device/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -2,8 +2,8 @@ package services
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/kit/biz"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/job/api/from"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/jobs"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ type JobApi struct {
|
||||
func (j *JobApi) CreateJob(rc *restfulx.ReqCtx) {
|
||||
var job entity.SysJob
|
||||
restfulx.BindQuery(rc, &job)
|
||||
job.Id = utils.GenerateID()
|
||||
job.Id = utils.GenerateID("j")
|
||||
job.Owner = rc.LoginAccount.UserName
|
||||
job.OrgId = rc.LoginAccount.OrganizationId
|
||||
_, err := j.JobApp.Insert(job)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package jobs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/job/entity"
|
||||
logEntity "pandax/apps/job/entity"
|
||||
"pandax/apps/job/services"
|
||||
logServices "pandax/apps/job/services"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -52,7 +52,7 @@ type ExecJob struct {
|
||||
func (e *ExecJob) Run() {
|
||||
startTime := time.Now()
|
||||
jobLog := logEntity.JobLog{Name: e.Name, EntryId: e.EntryId, TargetInvoke: e.InvokeTarget, Status: "0"}
|
||||
jobLog.Id = utils.GenerateID()
|
||||
jobLog.Id = utils.GenerateID("j")
|
||||
jobLog.OrgId = e.OrgId
|
||||
jobLog.Owner = e.Owner
|
||||
var obj = jobList[e.InvokeTarget]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/job/api"
|
||||
"pandax/apps/job/entity"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/job/api"
|
||||
"pandax/apps/job/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/log/entity"
|
||||
"pandax/apps/log/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
)
|
||||
|
||||
type LogLoginApi struct {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/log/entity"
|
||||
"pandax/apps/log/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
)
|
||||
|
||||
type LogOperApi struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"pandax/kit/model"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"pandax/kit/model"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
)
|
||||
|
||||
type LogOper struct {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/log/api"
|
||||
"pandax/apps/log/entity"
|
||||
"pandax/apps/log/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/log/api"
|
||||
"pandax/apps/log/entity"
|
||||
"pandax/apps/log/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/rule/entity"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/rule_engine"
|
||||
"strings"
|
||||
)
|
||||
@@ -84,7 +84,7 @@ func (p *RuleChainApi) GetRuleChain(rc *restfulx.ReqCtx) {
|
||||
func (p *RuleChainApi) InsertRuleChain(rc *restfulx.ReqCtx) {
|
||||
var data entity.RuleChain
|
||||
restfulx.BindJsonAndValid(rc, &data)
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("rc")
|
||||
data.Owner = rc.LoginAccount.UserName
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
_, err := p.RuleChainApp.Insert(data)
|
||||
@@ -115,7 +115,7 @@ func (p *RuleChainApi) CloneRuleChain(rc *restfulx.ReqCtx) {
|
||||
one, err := p.RuleChainApp.FindOne(id)
|
||||
biz.ErrIsNil(err, "规则链不存在")
|
||||
one.RuleName = one.RuleName + "-克隆"
|
||||
one.Id = utils.GenerateID()
|
||||
one.Id = utils.GenerateID("rc")
|
||||
one.Root = "0"
|
||||
_, err = p.RuleChainApp.Insert(*one)
|
||||
biz.ErrIsNil(err, "克隆规则链失败")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/rule/entity"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/pkg/rule_engine/nodes"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/rule/api"
|
||||
"pandax/apps/rule/entity"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/rule/api"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/casbin"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
entity "pandax/apps/system/entity"
|
||||
services "pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/casbin"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
entity "pandax/apps/system/entity"
|
||||
services "pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
)
|
||||
|
||||
type ConfigApi struct {
|
||||
|
||||
@@ -2,12 +2,12 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
entity "pandax/apps/system/entity"
|
||||
services "pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/system/api/vo"
|
||||
entity "pandax/apps/system/entity"
|
||||
services "pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
)
|
||||
|
||||
type MenuApi struct {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ package api
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/system/api/vo"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ package api
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ package api
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/casbin"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
entity "pandax/apps/system/entity"
|
||||
services "pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/casbin"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/ws"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/ws"
|
||||
"pandax/pkg/middleware"
|
||||
"runtime"
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
)
|
||||
|
||||
type SysTenantsApi struct {
|
||||
|
||||
@@ -2,9 +2,9 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/oss"
|
||||
"pandax/kit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/oss"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/pkg/config"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/tool"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/token"
|
||||
"pandax/apps/system/api/form"
|
||||
"pandax/apps/system/api/vo"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/token"
|
||||
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
@@ -15,12 +15,12 @@ import (
|
||||
logEntity "pandax/apps/log/entity"
|
||||
logServices "pandax/apps/log/services"
|
||||
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/captcha"
|
||||
filek "github.com/PandaXGO/PandaKit/file"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/captcha"
|
||||
filek "pandax/kit/file"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/global"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type SysApi struct {
|
||||
model.BaseAutoModel
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type SysConfig struct {
|
||||
ConfigId int64 `json:"configId" gorm:"primaryKey;AUTO_INCREMENT;comment:主键编码"`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type SysDictData struct {
|
||||
DictCode int64 `json:"dictCode" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type SysMenu struct {
|
||||
MenuId int64 `json:"menuId" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type SysNotice struct {
|
||||
NoticeId int64 `json:"noticeId" gorm:"primary_key;AUTO_INCREMENT"`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
// 组织组织
|
||||
type SysOrganization struct {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type SysPost struct {
|
||||
PostId int64 `gorm:"primary_key;AUTO_INCREMENT" json:"postId"`
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"pandax/kit/casbin"
|
||||
"pandax/kit/model"
|
||||
"github.com/PandaXGO/PandaKit/casbin"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"pandax/kit/model"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
import "pandax/kit/model"
|
||||
import "github.com/PandaXGO/PandaKit/model"
|
||||
|
||||
type LoginM struct {
|
||||
Username string `gorm:"type:varchar(64)" json:"username"`
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/casbin"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/casbin"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/api/vo"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/api/vo"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -7,11 +7,11 @@ package router
|
||||
**/
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/kit/restfulx"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"pandax/apps/system/api"
|
||||
"pandax/apps/system/api/form"
|
||||
"pandax/apps/system/api/vo"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/kit/model"
|
||||
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
logServices "pandax/apps/log/services"
|
||||
"pandax/kit/restfulx"
|
||||
)
|
||||
|
||||
func InitUserRouter(container *restful.Container) {
|
||||
|
||||
@@ -2,8 +2,8 @@ package services
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/PandaXGO/PandaKit/casbin"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/kit/casbin"
|
||||
"pandax/pkg/global"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
@@ -6,8 +6,8 @@ package services
|
||||
* @Date 2022/7/14 17:49
|
||||
**/
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/kit/biz"
|
||||
"pandax/pkg/global"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user