拆分模块
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.DesktopUtils;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.model.CloudTyc;
|
||||
import com.ecep.contract.util.UITools;
|
||||
import com.ecep.contract.vm.CloudTycInfoViewModel;
|
||||
|
||||
import javafx.application.Platform;
|
||||
|
||||
public class CloudTycService implements IEntityService<CloudTyc> {
|
||||
|
||||
public void save(CloudTycInfoViewModel viewModel) {
|
||||
int infoId = viewModel.getId().get();
|
||||
CloudTyc cloudTyc = findById(infoId);
|
||||
if (cloudTyc == null) {
|
||||
return;
|
||||
}
|
||||
if (viewModel.copyTo(cloudTyc)) {
|
||||
cloudTyc.setLatestUpdate(Instant.now());
|
||||
CloudTyc saved = save(cloudTyc);
|
||||
Platform.runLater(() -> viewModel.update(saved));
|
||||
}
|
||||
}
|
||||
|
||||
public void showInBrowse(String cloudId) {
|
||||
String baseUrl = SpringApp.getBean(SysConfService.class).getString("cloud.tyc.company");
|
||||
if (!StringUtils.hasText(baseUrl)) {
|
||||
UITools.showAlertAndWait("系统参数 cloud.tyc.company 未配置");
|
||||
return;
|
||||
}
|
||||
|
||||
String url = baseUrl + cloudId;
|
||||
|
||||
DesktopUtils.showInBrowse(url);
|
||||
|
||||
// UITools.showExceptionAndWait("使用浏览器打开网址出现异常", e);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudTyc findById(Integer id) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findById'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudTyc save(CloudTyc entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'save'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(CloudTyc entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'delete'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CloudTyc> findAll() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<CloudTyc> findAll(Map<String, Object> params, Pageable pageable) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
}
|
||||
|
||||
public CloudTyc getOrCreateCloudTyc(Company company) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getOrCreateCloudTyc'");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user