feat: Implement Oauth2 login log service and repository
- Added Oauth2LogLoginService for managing user authorization logs. - Implemented methods for inserting logs, cleaning logs, and exporting log data. - Created a new file for Oauth2 login log service. refactor: Remove unused open_api module - Deleted the open_api.go file as it was not utilized in the project. fix: Update error codes in SysProfileController - Changed error codes for binding errors and user authentication errors to more descriptive values. fix: Update cache handling in SysConfig and SysDictType services - Modified Redis set operations to include expiration time for cached values. refactor: Update middleware authorization checks - Replaced PreAuthorize middleware with AuthorizeUser across multiple routes in system and tool modules for consistency. chore: Clean up trace and ws modules - Updated middleware authorization in trace and ws modules to use AuthorizeUser.
This commit is contained in:
@@ -46,7 +46,7 @@ func (r *NeConfig) RefreshByNeTypeAndNeID(neType string) []model.NeConfig {
|
||||
v[i] = item
|
||||
}
|
||||
values, _ := json.Marshal(v)
|
||||
redis.Set("", key, string(values))
|
||||
redis.Set("", key, string(values), 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func (r *NeConfig) RefreshByNeTypeAndNeID(neType string) []model.NeConfig {
|
||||
neConfigList[i] = v
|
||||
}
|
||||
values, _ := json.Marshal(neConfigList)
|
||||
redis.Set("", key, string(values))
|
||||
redis.Set("", key, string(values), 0)
|
||||
}
|
||||
return neConfigList
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func (r NeInfo) FindByNeTypeAndNeID(neType, neID string) model.NeInfo {
|
||||
if neInfo.ID != 0 && neInfo.NeId == neID {
|
||||
redis.Del("", key)
|
||||
values, _ := json.Marshal(neInfo)
|
||||
redis.Set("", key, string(values))
|
||||
redis.Set("", key, string(values), 0)
|
||||
}
|
||||
}
|
||||
return neInfo
|
||||
@@ -64,7 +64,7 @@ func (r NeInfo) RefreshByNeTypeAndNeID(neType, neID string) model.NeInfo {
|
||||
neInfo = r.neInfoRepository.SelectNeInfoByNeTypeAndNeID(neType, neID)
|
||||
if neInfo.ID != 0 && neInfo.NeId == neID {
|
||||
values, _ := json.Marshal(neInfo)
|
||||
redis.Set("", key, string(values))
|
||||
redis.Set("", key, string(values), 0)
|
||||
}
|
||||
return neInfo
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func (r NeInfo) FindByNeType(neType string) []model.NeInfo {
|
||||
key := fmt.Sprintf("%s:%s:%s", constants.CACHE_NE_INFO, strings.ToUpper(v.NeType), v.NeId)
|
||||
redis.Del("", key)
|
||||
values, _ := json.Marshal(v)
|
||||
redis.Set("", key, string(values))
|
||||
redis.Set("", key, string(values), 0)
|
||||
}
|
||||
}
|
||||
return neInfo
|
||||
@@ -131,7 +131,7 @@ func (r NeInfo) FindByRmuid(rmUid string) model.NeInfo {
|
||||
key := fmt.Sprintf("%s:%s:%s", constants.CACHE_NE_INFO, strings.ToUpper(v.NeType), v.NeId)
|
||||
redis.Del("", key)
|
||||
values, _ := json.Marshal(v)
|
||||
redis.Set("", key, string(values))
|
||||
redis.Set("", key, string(values), 0)
|
||||
if v.RmUID == rmUid {
|
||||
neInfo = v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user