remove duplicated get method to /api/v1/users from the main file
This commit is contained in:
parent
4d9f0fbb0e
commit
94b3fec5e2
|
@ -1,31 +1,14 @@
|
|||
package com.mixel.docusphere;
|
||||
|
||||
import com.mixel.docusphere.entity.User;
|
||||
import com.mixel.docusphere.repository.UserRepository;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootApplication
|
||||
@RestController
|
||||
public class DocuSphereApplication {
|
||||
|
||||
public DocuSphereApplication(UserRepository userRepository) {
|
||||
this.userRepository = userRepository;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DocuSphereApplication.class, args);
|
||||
}
|
||||
|
||||
private final UserRepository userRepository;
|
||||
|
||||
@GetMapping("/api/v1/users")
|
||||
public List<User> getUsers() {
|
||||
return userRepository.findAll();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue