mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: 组件升级、代码优化
This commit is contained in:
		
							
								
								
									
										34
									
								
								server/internal/sys/infrastructure/persistence/config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								server/internal/sys/infrastructure/persistence/config.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
package persistence
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"mayfly-go/internal/sys/domain/entity"
 | 
			
		||||
	"mayfly-go/internal/sys/domain/repository"
 | 
			
		||||
	"mayfly-go/pkg/biz"
 | 
			
		||||
	"mayfly-go/pkg/model"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type configRepoImpl struct{}
 | 
			
		||||
 | 
			
		||||
func newConfigRepo() repository.Config {
 | 
			
		||||
	return new(configRepoImpl)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *configRepoImpl) GetPageList(condition *entity.Config, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult {
 | 
			
		||||
	return model.GetPage(pageParam, condition, condition, toEntity)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *configRepoImpl) Insert(config *entity.Config) {
 | 
			
		||||
	biz.ErrIsNil(model.Insert(config), "新增系统配置失败")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *configRepoImpl) Update(config *entity.Config) {
 | 
			
		||||
	biz.ErrIsNil(model.UpdateById(config), "更新系统配置失败")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *configRepoImpl) GetConfig(condition *entity.Config, cols ...string) error {
 | 
			
		||||
	return model.GetBy(condition, cols...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (r *configRepoImpl) GetByCondition(condition *entity.Config, cols ...string) error {
 | 
			
		||||
	return model.GetBy(condition, cols...)
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user