| 
					
				 | 
			
			
				@@ -0,0 +1,50 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+package com.iden.bms.controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.iden.common.service.IdenAutoincrKeyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.iden.common.util.Result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiImplicitParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiImplicitParams; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import lombok.extern.slf4j.Slf4j; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import javax.annotation.Resource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import javax.servlet.http.HttpServletRequest; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @author 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @version 1.0.0 创建于 2019-12-04 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ **/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RestController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Api(value = "AutoincrKeyController", tags = { "存放自增key管理" }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Slf4j 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RequestMapping("/bms/autoincrKey") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class AutoincrKeyController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private IdenAutoincrKeyService idenAutoincrKeyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "测试自增key", notes = "测试自增key") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiImplicitParams({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ApiImplicitParam(paramType = "query", name = "keyFlag", value = "keyFlag"), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @GetMapping(value = "/test", produces = "application/json;charset=utf-8") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Result<Long> test(HttpServletRequest request, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                             @RequestHeader(name = "token", required = true) String token, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                             @RequestParam(value = "keyFlag", required = false) String keyFlag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Long maxValue = this.idenAutoincrKeyService.updateMaxValue(keyFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return Result.success(maxValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return Result.error( "测试自增key失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |