@ -3,18 +3,16 @@ package app.controllers.other;
import app.annotations.enums.AuthMethod ;
import app.annotations.enums.AuthMethod ;
import app.annotations.interfaces.CheckWebAccess ;
import app.annotations.interfaces.CheckWebAccess ;
import app.entities.VipGiveMethod ;
import app.entities.VipGiveMethod ;
import app.entities.VipPrice ;
import app.services.db.VIPService ;
import app.services.db.VIPService ;
import app.utils.SteamIDConverter ;
import app.utils.SteamIDConverter ;
import jakarta.servlet.http.HttpServletRequest ;
import jakarta.servlet.http.HttpServletRequest ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.http.HttpStatus ;
import org.springframework.http.HttpStatus ;
import org.springframework.http.ResponseEntity ;
import org.springframework.http.ResponseEntity ;
import org.springframework.web.bind.annotation.PostMapping ;
import org.springframework.web.bind.annotation.* ;
import org.springframework.web.bind.annotation.RequestMapping ;
import org.springframework.web.bind.annotation.RequestParam ;
import org.springframework.web.bind.annotation.RestController ;
import java.util.HashSet ;
import java.util.* ;
@RestController
@RestController
@RequestMapping ( "api/external/vip" )
@RequestMapping ( "api/external/vip" )
@ -23,10 +21,21 @@ public class ExternalVIPController {
HashSet < String > unique_set ;
HashSet < String > unique_set ;
List < VipPrice > prices ;
@Autowired
@Autowired
public ExternalVIPController ( VIPService vipService ) {
public ExternalVIPController ( VIPService vipService ) {
this . vipService = vipService ;
this . vipService = vipService ;
this . unique_set = new HashSet ( ) ;
this . unique_set = new HashSet ( ) ;
setupPrices ( ) ;
}
public void setupPrices ( ) {
prices = new ArrayList < > ( ) ;
prices . add ( new VipPrice ( "1 Месяц" , 200 , "1 ключ" , "site_content/images/vip/VIP_1_MOUNTH.jpg" , "month" ) ) ;
prices . add ( new VipPrice ( "1 Неделя" , 100 , "40 рефов" , "site_content/images/vip/VIP_7_DAYS.jpg" , "week" ) ) ;
prices . add ( new VipPrice ( "1 День" , 35 , "10 рефов" , "site_content/images/vip/VIP_1_DAY.jpg" , "day" ) ) ;
prices . add ( new VipPrice ( "1 День" , 0 , "бесплатно" , "site_content/images/vip/freevip.jpg" , "free" ) ) ;
}
}
@PostMapping
@PostMapping
@ -50,4 +59,9 @@ public class ExternalVIPController {
extra ) ;
extra ) ;
return new ResponseEntity ( result , HttpStatus . OK ) ;
return new ResponseEntity ( result , HttpStatus . OK ) ;
}
}
@GetMapping
public ResponseEntity getPrices ( ) {
return new ResponseEntity ( prices , HttpStatus . OK ) ;
}
}
}