|
|
@@ -0,0 +1,123 @@
|
|
|
+package com.lc.ibps.components.pv.provider;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+
|
|
|
+import com.lc.ibps.api.base.constants.StateEnum;
|
|
|
+import com.lc.ibps.api.base.query.QueryFilter;
|
|
|
+import com.lc.ibps.base.core.constants.StringPool;
|
|
|
+import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
+import com.lc.ibps.cloud.entity.APIPageList;
|
|
|
+import com.lc.ibps.cloud.entity.APIRequest;
|
|
|
+import com.lc.ibps.cloud.entity.APIResult;
|
|
|
+import com.lc.ibps.cloud.provider.GenericProvider;
|
|
|
+import com.lc.ibps.components.pv.api.IExperimentalConfigService;
|
|
|
+import com.lc.ibps.components.pv.domain.ExperimentalConfig;
|
|
|
+import com.lc.ibps.components.pv.persistence.entity.ExperimentalConfigPo;
|
|
|
+import com.lc.ibps.components.pv.repository.ExperimentalConfigRepository;
|
|
|
+
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import io.swagger.annotations.Extension;
|
|
|
+import io.swagger.annotations.ExtensionProperty;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 性能验证配置信息 服务类
|
|
|
+ * <pre>
|
|
|
+ * 构建组:ibps-provider-experimentalConfig
|
|
|
+ * 开发公司:深圳市金源信通科技有限公司
|
|
|
+ * 开发人员:codegen
|
|
|
+ * 创建时间:2024-05-22 10:29:15
|
|
|
+ *</pre>
|
|
|
+ */
|
|
|
+@Api(tags = "性能验证配置信息管理", value = "性能验证配置信息数据")
|
|
|
+@Service
|
|
|
+public class ExperimentalConfigProvider extends GenericProvider implements IExperimentalConfigService{
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ExperimentalConfigRepository experimentalConfigRepository;
|
|
|
+
|
|
|
+ @ApiOperation(value = "性能验证配置信息列表(分页条件查询)数据", notes = "性能验证配置信息列表(分页条件查询)数据")
|
|
|
+ @Override
|
|
|
+ public APIResult<APIPageList<ExperimentalConfigPo>> query(
|
|
|
+ @ApiParam(name = "request", value = "传入查询请求json字符串", required = true)
|
|
|
+ @RequestBody(required = true) APIRequest request) {
|
|
|
+ APIResult<APIPageList<ExperimentalConfigPo>> result = new APIResult<>();
|
|
|
+ try {
|
|
|
+ QueryFilter queryFilter = getQueryFilter(request);
|
|
|
+ List<ExperimentalConfigPo> data = experimentalConfigRepository.query(queryFilter);
|
|
|
+ APIPageList<ExperimentalConfigPo> apiPageData = getAPIPageList(data);
|
|
|
+ result.setData(apiPageData);
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO ERROR => other error message
|
|
|
+ setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据id查询性能验证配置信息", notes = "根据id查询性能验证配置信息")
|
|
|
+ @Override
|
|
|
+ public APIResult<ExperimentalConfigPo> get(
|
|
|
+ @ApiParam(name = "id", value = "查询id", required = true)
|
|
|
+ @RequestParam(name = "id", required = true) String id) {
|
|
|
+ APIResult<ExperimentalConfigPo> result = new APIResult<>();
|
|
|
+ try {
|
|
|
+ ExperimentalConfigPo experimentalConfigPo = experimentalConfigRepository.get(id);
|
|
|
+ result.setData(experimentalConfigPo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "保存", notes = "保存性能验证配置信息信息",
|
|
|
+ extensions = {
|
|
|
+ @Extension(properties = {
|
|
|
+ @ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ @Override
|
|
|
+ public APIResult<Void> save(
|
|
|
+ @ApiParam(name = "experimentalConfigPo", value = "性能验证配置信息对象", required = true)
|
|
|
+ @RequestBody(required = true) ExperimentalConfigPo experimentalConfigPo) {
|
|
|
+ APIResult<Void> result = new APIResult<Void>();
|
|
|
+ try {
|
|
|
+ logger.info(" com.lc.ibps.components.provider.ExperimentalConfigProvider.save()--->experimentalConfigPo: {}", experimentalConfigPo.toString());
|
|
|
+ ExperimentalConfig domain = experimentalConfigRepository.newInstance(experimentalConfigPo);
|
|
|
+ domain.save();
|
|
|
+ result.setMessage("保存性能验证配置信息成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除", notes = "删除性能验证配置信息",
|
|
|
+ extensions = {
|
|
|
+ @Extension(properties = {
|
|
|
+ @ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ @Override
|
|
|
+ public APIResult<Void> remove(
|
|
|
+ @ApiParam(name = "ids", value = "性能验证配置信息ID数组", required = true)
|
|
|
+ @RequestParam(name = "ids", required = true) String[] ids) {
|
|
|
+ APIResult<Void> result = new APIResult<Void>();
|
|
|
+ try {
|
|
|
+ ExperimentalConfig domain = experimentalConfigRepository.newInstance();
|
|
|
+ domain.deleteByIds(ids);
|
|
|
+ result.setMessage("删除性能验证配置信息成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|