From caaa37d3f59eeb33d97e0f3497bbf5885865f59d Mon Sep 17 00:00:00 2001 From: dangsn <dangsn@chicecm.com> Date: 星期一, 09 十二月 2024 18:27:17 +0800 Subject: [PATCH] 调整WebBoService中的查询接口。主要是BusinessObject对象属性的赋值,以及BusinessObject和BaseModel之间的属性互相赋值 --- Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java | 60 ++++++------------------------------------------------------ 1 files changed, 6 insertions(+), 54 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java index 800ff1d..51d8004 100644 --- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java +++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java @@ -1,36 +1,17 @@ package com.vci.starter.web.util; -import com.vci.starter.web.annotation.controller.VciUnCheckRight; -import com.vci.starter.web.annotation.log.VciUnLog; -import com.vci.starter.web.autoconfigure.AppAutoConfigure; -import com.vci.starter.web.pagemodel.BaseResult; import org.springframework.beans.BeansException; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; -import org.springframework.context.ConfigurableApplicationContext; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; /** * spring鐨勪笂涓嬫枃宸ュ叿锛� - * 娉ㄦ剰springmvc涓殑controller涓嶅簲璇ュ湪杩欓噷鑾峰彇锛屽洜涓簊pringmvc鍙簲璇ヨ鍓嶇璋冪敤 - * 娌℃湁浣跨敤springboot鐨刴ain鍑芥暟閲岃缃苟鑾峰彇鏄洜涓哄彲鑳戒細璁╁涓湇鍔″悎骞跺埌涓�璧峰惎鍔� - * @author weidy - * @date 2019/10/31 9:02 AM + * @author dangsn + * @date 2024/12/3 */ -@RestController -@RequestMapping("/application") +@Component public class ApplicationContextProvider implements ApplicationContextAware { - - /** - * 鏈嶅姟鐨勯厤缃� - */ - @Autowired - private AppAutoConfigure appAutoConfigure; /** * 搴旂敤鐨勪笂涓嬫枃 @@ -39,12 +20,12 @@ /** * 璁剧疆搴旂敤鐨勪笂涓嬫枃 - * @param applicationContext 涓婁笅鏂� + * @param context 涓婁笅鏂� * @throws BeansException 鍑虹幇閿欒鏃堕渶瑕佹姏鍑哄紓甯哥粰spring瀹瑰櫒 */ @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - ApplicationContextProvider.applicationContext = applicationContext; + public void setApplicationContext(ApplicationContext context) throws BeansException { + applicationContext = context; } /** @@ -75,33 +56,4 @@ public static <T> T getBean(Class<T> c) throws BeansException{ return applicationContext.getBean(c); } - - /** - * 鍏虫満 - * @return 鎵ц瀹屾垚 - */ - @PostMapping("/shutDownContext") - @VciUnLog - @VciUnCheckRight - public BaseResult shutDownContext(String privateKey){ - if( appAutoConfigure.getPrivateTokenKey().equalsIgnoreCase(privateKey)) { - ConfigurableApplicationContext ctx = (ConfigurableApplicationContext) applicationContext; - ctx.close(); - return BaseResult.success("鍏抽棴鏈嶅姟鎴愬姛"); - }else{ - return BaseResult.fail("鎮ㄦ病鏈夋潈闄愬叧闂湇鍔�"); - } - } - - /** - * 妫�鏌ユ槸鍚﹀畬鎴� - * @return 璋冪敤灏辫鏄庢垚鍔熶簡 - */ - @PostMapping("/checkOnline") - @VciUnLog - @VciUnCheckRight - public BaseResult checkOnline(){ - return BaseResult.success("鍚姩瀹屾垚"); - } - } -- Gitblit v1.9.3