HomeController.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2017-2020 吴学文 and java110 team.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.java110.front.controller;
  17. import com.java110.core.base.controller.BaseController;
  18. import com.java110.core.context.IPageData;
  19. import com.java110.front.smo.IFlowServiceSMO;
  20. import com.java110.utils.constant.CommonConstant;
  21. import org.slf4j.Logger;
  22. import org.slf4j.LoggerFactory;
  23. import org.springframework.beans.factory.annotation.Autowired;
  24. import org.springframework.stereotype.Controller;
  25. import org.springframework.ui.Model;
  26. import org.springframework.web.bind.annotation.RequestMapping;
  27. import javax.servlet.http.HttpServletRequest;
  28. /**
  29. * 控制中心处理类
  30. * Created by wuxw on 2018/4/25.
  31. */
  32. @Controller
  33. public class HomeController extends BaseController {
  34. private final static Logger logger = LoggerFactory.getLogger(HomeController.class);
  35. @Autowired
  36. private IFlowServiceSMO flowServiceSMOImpl;
  37. @RequestMapping(path = "/")
  38. public String index(Model model, HttpServletRequest request) {
  39. String template = "index";
  40. IPageData pd = (IPageData) request.getAttribute(CommonConstant.CONTEXT_PAGE_DATA);
  41. if (!flowServiceSMOImpl.hasStoreInfos(pd)) {
  42. //初始化 商户信息
  43. template = "init_company";
  44. }
  45. return template;
  46. }
  47. public IFlowServiceSMO getFlowServiceSMOImpl() {
  48. return flowServiceSMOImpl;
  49. }
  50. public void setFlowServiceSMOImpl(IFlowServiceSMO flowServiceSMOImpl) {
  51. this.flowServiceSMOImpl = flowServiceSMOImpl;
  52. }
  53. }