1
0

feat: 许可证和网元开关机

This commit is contained in:
TsMask
2023-10-12 09:49:34 +08:00
parent 3220f9d138
commit 55fe1d534d
5 changed files with 211 additions and 24 deletions

View File

@@ -1630,9 +1630,20 @@ func IsPermissionAllowed(token, method, module, dbname, tbname, pack string) (bo
}
type NeLicense struct {
NeType string `json:"neType" xorm:"ne_type"`
NeID string `json:"neID" xorm:"ne_id"`
Capability int `json:"capability"`
NeType string `json:"neType" xorm:"ne_type"`
NeID string `json:"neID" xorm:"ne_id"`
SerialNo string `json:"serialNo" xorm:"serial_no"`
Capcity int `json:"capcity" xorm:"capcity"`
Used int `json:"used" xorm:"used"`
FeatureEnabled string `json:"featureEnabled" xorm:"feature_enabled"`
ExpirationDate string `json:"expirationDate" xorm:"expiration_date"`
Status string `json:"status" xorm:"status"`
Path string `json:"path" xorm:"path"`
FileName string `json:"file_name" xorm:"file_name"`
Comment string `json:"comment" xorm:"comment"`
CreatedAt string `json:"createdAt" xorm:"-"`
UpdatedAt string `json:"updatedAt" xorm:"-"`
DeletedAt string `json:"deletedAt" xorm:"-"`
}
func XormAdjustmentNeLicense(neType, neID string, value int) (int64, error) {

View File

@@ -220,17 +220,11 @@ func init() {
Register("PATCH", cm.CustomUriSoftwareNE, cm.RollBackSoftwareToNF, nil)
// License management
Register("GET", cm.LicenseUri, cm.ExportCmFromNF, nil)
Register("POST", cm.LicenseUri, cm.ImportCmToNF, nil)
Register("DELETE", cm.LicenseUri, cm.ImportCmToNF, nil)
Register("POST", cm.UriLicense, cm.UploadLicenseFileData, nil)
Register("POST", cm.UriLicenseExt, cm.UploadLicenseFileData, nil)
Register("POST", cm.NeLicenseUri, cm.ExportCmFromNF, nil)
Register("PUT", cm.NeLicenseUri, cm.ImportCmToNF, nil)
Register("PATCH", cm.NeLicenseUri, cm.ImportCmToNF, nil)
Register("POST", cm.CustomNeLicenseUri, cm.ExportCmFromNF, nil)
Register("PUT", cm.CustomNeLicenseUri, cm.ImportCmToNF, nil)
Register("PATCH", cm.CustomNeLicenseUri, cm.ImportCmToNF, nil)
Register("POST", cm.CustomUriLicense, cm.UploadLicenseFileData, nil)
Register("POST", cm.CustomUriLicenseExt, cm.UploadLicenseFileData, nil)
// Trace management
Register("POST", trace.UriTraceTask, trace.PostTraceTaskToNF, nil)