mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	实现服务的缓存策略设置
This commit is contained in:
		@@ -17,7 +17,7 @@ func (this *CreatePopupAction) Init() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *CreatePopupAction) RunGet(params struct{}) {
 | 
			
		||||
	this.Data["types"] = serverconfigs.AllCachePolicyTypes
 | 
			
		||||
	this.Data["types"] = serverconfigs.AllCachePolicyStorageTypes
 | 
			
		||||
	this.Show()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -44,15 +44,15 @@ func (this *CreatePopupAction) RunPost(params struct {
 | 
			
		||||
	// 校验选项
 | 
			
		||||
	var options interface{}
 | 
			
		||||
	switch params.Type {
 | 
			
		||||
	case serverconfigs.CachePolicyTypeFile:
 | 
			
		||||
	case serverconfigs.CachePolicyStorageFile:
 | 
			
		||||
		params.Must.
 | 
			
		||||
			Field("fileDir", params.FileDir).
 | 
			
		||||
			Require("请输入缓存目录")
 | 
			
		||||
		options = &serverconfigs.HTTPFileCacheConfig{
 | 
			
		||||
		options = &serverconfigs.HTTPFileCacheStorage{
 | 
			
		||||
			Dir: params.FileDir,
 | 
			
		||||
		}
 | 
			
		||||
	case serverconfigs.CachePolicyTypeMemory:
 | 
			
		||||
		options = &serverconfigs.HTTPMemoryCacheConfig{
 | 
			
		||||
	case serverconfigs.CachePolicyStorageMemory:
 | 
			
		||||
		options = &serverconfigs.HTTPMemoryCacheStorage{
 | 
			
		||||
		}
 | 
			
		||||
	default:
 | 
			
		||||
		this.Fail("请选择正确的缓存类型")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user