feat: 网元授权添加用户容量列
This commit is contained in:
@@ -156,6 +156,7 @@ func (s *NeLicenseController) Code(c *gin.Context) {
|
||||
if licensePath != "" {
|
||||
neLicense.LicensePath = licensePath
|
||||
} else {
|
||||
neLicense.Capability = 0
|
||||
neLicense.SerialNum = ""
|
||||
neLicense.ExpiryDate = ""
|
||||
neLicense.Status = "0"
|
||||
@@ -259,6 +260,7 @@ func (s *NeLicenseController) State(c *gin.Context) {
|
||||
}
|
||||
if neState, err := neFetchlink.NeState(neInfo); err == nil && neState["sn"] != nil {
|
||||
neLicense.Status = "1"
|
||||
neLicense.Capability = parse.Number(neState["capability"])
|
||||
neLicense.SerialNum = fmt.Sprint(neState["sn"])
|
||||
neLicense.ExpiryDate = fmt.Sprint(neState["expire"])
|
||||
} else {
|
||||
@@ -274,9 +276,10 @@ func (s *NeLicenseController) State(c *gin.Context) {
|
||||
s.neLicenseService.Update(neLicense)
|
||||
|
||||
if neLicense.Status == "1" {
|
||||
c.JSON(200, resp.OkData(map[string]string{
|
||||
"sn": neLicense.SerialNum,
|
||||
"expire": neLicense.ExpiryDate,
|
||||
c.JSON(200, resp.OkData(map[string]any{
|
||||
"capability": neLicense.Capability,
|
||||
"sn": neLicense.SerialNum,
|
||||
"expire": neLicense.ExpiryDate,
|
||||
}))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user