mirror of
				https://github.com/MHSanaei/3x-ui.git
				synced 2025-10-30 03:42:51 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			471 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			471 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package job
 | |
| 
 | |
| import (
 | |
| 	"x-ui/web/service"
 | |
| )
 | |
| 
 | |
| type LoginStatus byte
 | |
| 
 | |
| const (
 | |
| 	LoginSuccess LoginStatus = 1
 | |
| 	LoginFail    LoginStatus = 0
 | |
| )
 | |
| 
 | |
| type StatsNotifyJob struct {
 | |
| 	xrayService  service.XrayService
 | |
| 	tgbotService service.Tgbot
 | |
| }
 | |
| 
 | |
| func NewStatsNotifyJob() *StatsNotifyJob {
 | |
| 	return new(StatsNotifyJob)
 | |
| }
 | |
| 
 | |
| // Here run is a interface method of Job interface
 | |
| func (j *StatsNotifyJob) Run() {
 | |
| 	if !j.xrayService.IsXrayRunning() {
 | |
| 		return
 | |
| 	}
 | |
| 	j.tgbotService.SendReport()
 | |
| }
 | 
