Commit 53d46dc5 by zhiwj

批量发布

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