提交 8c581110 编写于 作者: zhouweidong's avatar zhouweidong

资源MD5校验

上级 39166c31
...@@ -22,9 +22,9 @@ import java.util.List; ...@@ -22,9 +22,9 @@ import java.util.List;
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class, org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
}) })
@ComponentScan(basePackages = {"cn.ibizlab"} @ComponentScan(basePackages = {"cn.ibizlab"}
// ,excludeFilters={ ,excludeFilters={
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.xxx.rest.xxx"), @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.SysPSSystemResource"),
// } }
) )
@Import({ @Import({
org.springframework.cloud.openfeign.FeignClientsConfiguration.class org.springframework.cloud.openfeign.FeignClientsConfiguration.class
......
...@@ -20,9 +20,9 @@ import java.util.List; ...@@ -20,9 +20,9 @@ import java.util.List;
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
@ComponentScan(basePackages = {"cn.ibizlab"} @ComponentScan(basePackages = {"cn.ibizlab"}
// ,excludeFilters={ ,excludeFilters={
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.xxx"), @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.SysPSSystemResource"),
// } }
) )
@EnableMongoRepositories(basePackages = {"cn.ibizlab"}) @EnableMongoRepositories(basePackages = {"cn.ibizlab"})
@MapperScan("cn.ibizlab.*.mapper") @MapperScan("cn.ibizlab.*.mapper")
......
package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.api.dto.SysPSSystemDTO;
import cn.ibizlab.api.rest.SysPSSystemResource;
import cn.ibizlab.core.uaa.domain.SysPSSystem;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class UserSysPSSystemResource extends SysPSSystemResource {
@Override
public ResponseEntity<Boolean> save(@RequestBody SysPSSystemDTO syspssystemdto) {
SysPSSystem system = syspssystemService.get(syspssystemdto.getPssystemid());
if( !StringUtils.isEmpty(system.getMd5check()) && system.getMd5check().equals(syspssystemdto.getMd5check())){
log.warn(String.format("[%s]系统资源没有变化,忽略本次同步请求:",syspssystemdto.getPssystemid()));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
else{
return super.save(syspssystemdto);
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册