LoginComponent.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.java110.web.components;
  2. import com.java110.core.context.IPageData;
  3. import com.java110.web.smo.ILoginServiceSMO;
  4. import com.java110.web.smo.sys.ISysServiceSMO;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.http.*;
  7. import org.springframework.stereotype.Component;
  8. @Component("login")
  9. public class LoginComponent {
  10. @Autowired
  11. private ILoginServiceSMO loginServiceSMOImpl;
  12. @Autowired
  13. private ISysServiceSMO sysServiceSMOImpl;
  14. /**
  15. * 用户登录
  16. *
  17. * @param pd
  18. * @return
  19. */
  20. public ResponseEntity<String> doLogin(IPageData pd) {
  21. ResponseEntity<String> responseEntity = null;
  22. try {
  23. responseEntity = loginServiceSMOImpl.doLogin(pd);
  24. } catch (Exception e) {
  25. responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
  26. } finally {
  27. return responseEntity;
  28. }
  29. }
  30. public ResponseEntity<String> getSysInfo(IPageData pd) {
  31. return sysServiceSMOImpl.getSysInfo(pd);
  32. }
  33. public ILoginServiceSMO getLoginServiceSMOImpl() {
  34. return loginServiceSMOImpl;
  35. }
  36. public void setLoginServiceSMOImpl(ILoginServiceSMO loginServiceSMOImpl) {
  37. this.loginServiceSMOImpl = loginServiceSMOImpl;
  38. }
  39. public ISysServiceSMO getSysServiceSMOImpl() {
  40. return sysServiceSMOImpl;
  41. }
  42. public void setSysServiceSMOImpl(ISysServiceSMO sysServiceSMOImpl) {
  43. this.sysServiceSMOImpl = sysServiceSMOImpl;
  44. }
  45. }