调整文件命名
This commit is contained in:
		@@ -44,16 +44,16 @@ func NewApplication(configPath string) (*Application, error) {
 | 
			
		||||
	apiServer := api.NewAPI(
 | 
			
		||||
		cfg.Server,
 | 
			
		||||
		logger,
 | 
			
		||||
		infra.Repos.UserRepo,
 | 
			
		||||
		appServices.PigFarmService,
 | 
			
		||||
		appServices.PigBatchService,
 | 
			
		||||
		appServices.MonitorService,
 | 
			
		||||
		appServices.DeviceService,
 | 
			
		||||
		appServices.PlanService,
 | 
			
		||||
		appServices.UserService,
 | 
			
		||||
		infra.TokenService,
 | 
			
		||||
		appServices.AuditService,
 | 
			
		||||
		infra.Lora.ListenHandler,
 | 
			
		||||
		infra.repos.userRepo,
 | 
			
		||||
		appServices.pigFarmService,
 | 
			
		||||
		appServices.pigBatchService,
 | 
			
		||||
		appServices.monitorService,
 | 
			
		||||
		appServices.deviceService,
 | 
			
		||||
		appServices.planService,
 | 
			
		||||
		appServices.userService,
 | 
			
		||||
		infra.tokenService,
 | 
			
		||||
		appServices.auditService,
 | 
			
		||||
		infra.lora.listenHandler,
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
	// 4. 组装 Application 对象
 | 
			
		||||
@@ -74,7 +74,7 @@ func (app *Application) Start() error {
 | 
			
		||||
	app.Logger.Info("应用启动中...")
 | 
			
		||||
 | 
			
		||||
	// 1. 启动底层监听器
 | 
			
		||||
	if err := app.Infra.Lora.LoraListener.Listen(); err != nil {
 | 
			
		||||
	if err := app.Infra.lora.loraListener.Listen(); err != nil {
 | 
			
		||||
		return fmt.Errorf("启动 LoRa Mesh 监听器失败: %w", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -109,12 +109,12 @@ func (app *Application) Stop() error {
 | 
			
		||||
	app.Domain.planService.Stop()
 | 
			
		||||
 | 
			
		||||
	// 断开数据库连接
 | 
			
		||||
	if err := app.Infra.Storage.Disconnect(); err != nil {
 | 
			
		||||
	if err := app.Infra.storage.Disconnect(); err != nil {
 | 
			
		||||
		app.Logger.Errorw("数据库连接断开失败", "error", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 关闭 LoRa Mesh 监听器
 | 
			
		||||
	if err := app.Infra.Lora.LoraListener.Stop(); err != nil {
 | 
			
		||||
	if err := app.Infra.lora.loraListener.Stop(); err != nil {
 | 
			
		||||
		app.Logger.Errorw("LoRa Mesh 监听器关闭失败", "error", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user