重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
29 lines
736 B
Java
29 lines
736 B
Java
package com.ecep.contract.converter;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import com.ecep.contract.service.CompanyService;
|
|
import com.ecep.contract.vo.CompanyVo;
|
|
|
|
import jakarta.annotation.PostConstruct;
|
|
|
|
@Lazy
|
|
@Component
|
|
public class CompanyStringConverter extends EntityStringConverter<CompanyVo> {
|
|
|
|
@Lazy
|
|
@Autowired
|
|
CompanyService service;
|
|
public CompanyStringConverter() {
|
|
|
|
}
|
|
|
|
@PostConstruct
|
|
private void init() {
|
|
setInitialized(project -> service.findById(project.getId()));
|
|
setSuggestion(service::search);
|
|
setFromString(service::findByName);
|
|
}
|
|
} |