Browse Source

1、接口调用

zhaops 3 years ago
parent
commit
cc482589f3

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -62,6 +62,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/mappingConfig/deleteRecords").permitAll()
                 .antMatchers("/tran/mappingConfig/deleteRecords").permitAll()
                 //.antMatchers("/tran/hospitalInfo/saveRecord").permitAll()
                 //.antMatchers("/tran/hospitalInfo/saveRecord").permitAll()
                 .antMatchers("/tran/log/pageList").permitAll()
                 .antMatchers("/tran/log/pageList").permitAll()
+                .antMatchers("/tran/log/getRecordById").permitAll()
                 .antMatchers("/tran/hospitalInfo/getHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllEnableHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllEnableHospitalInfo").permitAll()

+ 2 - 1
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -103,8 +103,9 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/mappingConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/mappingConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/mappingConfig/deleteRecord", request)
                 || matchers("/tran/mappingConfig/deleteRecord", request)
                 || matchers("/tran/mappingConfig/deleteRecords", request)
                 || matchers("/tran/mappingConfig/deleteRecords", request)
-                //|| matchers("/tran/hospitalInfo/saveRecord", request)
                 || matchers("/tran/log/pageList", request)
                 || matchers("/tran/log/pageList", request)
+                || matchers("/tran/log/getRecordById", request)
+                //|| matchers("/tran/hospitalInfo/saveRecord", request)
                 || matchers("/tran/hospitalInfo/getHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllEnableHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllEnableHospitalInfo", request)

+ 10 - 0
src/main/java/com/diagbot/facade/TranLogFacade.java

@@ -6,6 +6,7 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.TranLogServiceImpl;
 import com.diagbot.service.impl.TranLogServiceImpl;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.IdVO;
 import com.diagbot.vo.TranLogPageVO;
 import com.diagbot.vo.TranLogPageVO;
 import org.apache.commons.lang3.time.DateUtils;
 import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
@@ -43,4 +44,13 @@ public class TranLogFacade extends TranLogServiceImpl {
         IPage<TranLog> page = super.getPage(tranLogPageVO);
         IPage<TranLog> page = super.getPage(tranLogPageVO);
         return page;
         return page;
     }
     }
+
+    /**
+     * 获取单条记录
+     * @param idVO
+     * @return
+     */
+    public TranLog getRecordById(IdVO idVO) {
+        return this.getById(idVO.getId());
+    }
 }
 }

+ 12 - 0
src/main/java/com/diagbot/web/TranLogController.java

@@ -5,10 +5,12 @@ import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.TranLog;
 import com.diagbot.entity.TranLog;
 import com.diagbot.facade.TranLogFacade;
 import com.diagbot.facade.TranLogFacade;
+import com.diagbot.vo.IdVO;
 import com.diagbot.vo.TranLogPageVO;
 import com.diagbot.vo.TranLogPageVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -44,4 +46,14 @@ public class TranLogController {
         IPage<TranLog> data = tranLogFacade.pageList(tranLogPageVO);
         IPage<TranLog> data = tranLogFacade.pageList(tranLogPageVO);
         return RespDTO.onSuc(data);
         return RespDTO.onSuc(data);
     }
     }
+
+    @ApiOperation(value = "查看接口记录[by:zhaops]",
+            notes = "id")
+    @PostMapping("/getRecordById")
+    @SysLogger("getRecordById")
+    @Transactional
+    public RespDTO<TranLog> getRecordById(@RequestBody @Valid IdVO idVO) {
+        TranLog data = tranLogFacade.getRecordById(idVO);
+        return RespDTO.onSuc(data);
+    }
 }
 }