提交 03c3fbce 编写于 作者: laizhilong's avatar laizhilong

Merge remote-tracking branch 'origin/master'

......@@ -22,9 +22,9 @@ import java.util.List;
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
})
@ComponentScan(basePackages = {"cn.ibizlab"}
,excludeFilters={
@ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.SysPSSystemResource"),
}
// ,excludeFilters={
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.xxx"),
// }s
)
@Import({
org.springframework.cloud.openfeign.FeignClientsConfiguration.class
......
......@@ -20,9 +20,9 @@ import java.util.List;
@Configuration
@EnableTransactionManagement
@ComponentScan(basePackages = {"cn.ibizlab"}
,excludeFilters={
@ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.SysPSSystemResource"),
}
// ,excludeFilters={
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX,pattern="cn.ibizlab.api.rest.SysPSSystemResource"),
// }
)
@EnableMongoRepositories(basePackages = {"cn.ibizlab"})
@MapperScan("cn.ibizlab.*.mapper")
......
......@@ -106,6 +106,11 @@ public class SysPSSystemResource {
@ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统")
@RequestMapping(method = RequestMethod.POST, value = "/syspssystems/save")
public ResponseEntity<Boolean> save(@RequestBody SysPSSystemDTO syspssystemdto) {
SysPSSystem system = syspssystemService.getById(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);
}
return ResponseEntity.status(HttpStatus.OK).body(syspssystemService.save(syspssystemMapping.toDomain(syspssystemdto)));
}
......
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册