Commit 53d46dc5 by zhiwj

批量发布

parent bee93683
......@@ -11,7 +11,7 @@ public class IndexQO extends PageQO implements Serializable {
private static final long serialVersionUID = 5687670215343610800L;
private Integer classifyType;
private Integer moduleId;
private String moduleId;
private Integer isAppIndex;
private String search;
......@@ -23,11 +23,11 @@ public class IndexQO extends PageQO implements Serializable {
this.classifyType = classifyType;
}
public Integer getModuleId() {
public String getModuleId() {
return moduleId;
}
public void setModuleId(Integer moduleId) {
public void setModuleId(String moduleId) {
this.moduleId = moduleId;
}
......
......@@ -5,6 +5,8 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.qo.DataExplainQO;
import java.util.List;
/**
* @author zhiwj
* @Description:
......@@ -65,9 +67,9 @@ public interface DataExplainApiService {
* @Title: publish
* @Description:
* @author zhiwj
* @param dataExplainId
* @param dataExplainIdList
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> publish(Integer dataExplainId);
ServiceResponse<Void> publish(List<Integer> dataExplainIdList);
}
......@@ -5,6 +5,8 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.qo.IndexQO;
import java.util.List;
/**
* @author zhiwj
* @Description:
......@@ -66,9 +68,9 @@ public interface IndexApiService {
* @Title: publish
* @Description:
* @author zhiwj
* @param indexId
* @param indexIdList
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> publish(Integer indexId);
ServiceResponse<Void> publish(List<Integer> indexIdList);
}
......@@ -16,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author zhiwj
......@@ -70,8 +72,11 @@ public class DataExplainController {
}
@RequestMapping("/publishDataExplain")
public RestResponse publishIndex(Integer dataExplainId) {
ServiceResponse<Void> serviceResponse = dataExplainApiService.publish(dataExplainId);
public RestResponse publishIndex(String dataExplainIds) {
if (StringUtils.isBlank(dataExplainIds)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
ServiceResponse<Void> serviceResponse = dataExplainApiService.publish(Stream.of(dataExplainIds.split(",")).map(Integer::valueOf).collect(Collectors.toList()));
return ResultControllerUtils.commonResult(serviceResponse);
}
......
......@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author zhiwj
......@@ -88,8 +90,11 @@ public class IndexController {
}
@RequestMapping("/publishIndex")
public RestResponse publishIndex(Integer indexId) {
ServiceResponse<Void> serviceResponse = indexApiService.publish(indexId);
public RestResponse publishIndex(String indexIds) {
if (StringUtils.isBlank(indexIds)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
ServiceResponse<Void> serviceResponse = indexApiService.publish(Stream.of(indexIds.split(",")).map(Integer::valueOf).collect(Collectors.toList()));
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
......@@ -18,6 +18,8 @@ import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhiwj
* @Description:
......@@ -96,8 +98,10 @@ public class DataExplainApiServiceImpl implements DataExplainApiService {
}
@Override
public ServiceResponse<Void> publish(Integer dataExplainId) {
public ServiceResponse<Void> publish(List<Integer> dataExplainIdList) {
for (Integer dataExplainId : dataExplainIdList) {
this.updateTipService.publish(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
}
return EnterpriseServiceResponse.success();
}
}
......@@ -125,8 +125,10 @@ public class IndexApiServiceImpl implements IndexApiService {
}
@Override
public ServiceResponse<Void> publish(Integer indexId) {
public ServiceResponse<Void> publish(List<Integer> indexIdList) {
for (Integer indexId : indexIdList) {
this.updateTipService.publish(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
}
return EnterpriseServiceResponse.success();
}
}
......@@ -161,5 +161,6 @@
<if test="type != null ">
and type = #{type}
</if>
order by update_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -368,5 +368,6 @@
and name like concat('%', #{search}, '%')
</if>
</where>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment