Customer: trainer, trainerId
This commit is contained in:
@@ -44,6 +44,11 @@ class CustomerController ( private val customerRepository: CustomerRepository )
|
||||
fun getRealCustomers(active: String, @RequestHeader headers: HttpHeaders): List<Customer> =
|
||||
customerRepository.findByActive(active)
|
||||
|
||||
@Secured
|
||||
@GetMapping("/customers/trainees/{id}")
|
||||
fun getCustomerListByTrainerId(@PathVariable(value = "id") trainerId: Long, @RequestHeader headers: HttpHeaders): List<Customer> =
|
||||
customerRepository.findByTrainerId(trainerId)
|
||||
|
||||
@Secured
|
||||
@PostMapping("/customers/{id}")
|
||||
fun updateCustomerById(@PathVariable(value = "id") customerId: Long,
|
||||
|
||||
@@ -17,6 +17,8 @@ data class Customer (
|
||||
var dateChange: String? = null,
|
||||
var dataPolicyAllowed: Int = 0,
|
||||
var admin: Int = 0,
|
||||
var trainer: Int = 0,
|
||||
var trainerId: Long = 0,
|
||||
var password: String? = "",
|
||||
var birthYear:Int = 0,
|
||||
var weight: Int = 0,
|
||||
|
||||
@@ -9,4 +9,6 @@ interface CustomerRepository : JpaRepository<Customer, Long> {
|
||||
fun findByActive( active: String? ): List<Customer>
|
||||
|
||||
fun findByEmail(email: String?): Customer?
|
||||
|
||||
fun findByTrainerId( trainerId: Long ): List<Customer>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user