二条
authored
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package cn.dnect.company.service;
import cn.dnect.company.entity.Company;
import cn.dnect.company.repository.CompanyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created with IntelliJ IDEA.
* Date: 2019/2/12
* Time: 15:13
*
* @author: 二条
* Description:
*/
@Service
public class CompanyService {
@Autowired private CompanyRepository companyRepository;
public Company getCompany(Long id) {
return companyRepository.findById(id).orElse(new Company());
}
}
|