Package com.cib.yym.homepage.controller

Source Code of com.cib.yym.homepage.controller.AccountController

package com.cib.yym.homepage.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cib.yym.homepage.service.ReadItLaterService;
import com.cib.yym.homepage.service.impl.ReadItLaterServiceImpl;

@Controller
@RequestMapping(value="/account")
public class AccountController {

  public final static String VIEW_SIGNIN_SUCCESS = "signinSuccess";
  public final static String VIEW_SIGNIN_FAIL = "signinFail";
  public final static String VIEW_DASHBOARD = "/my/dashboard";
 
  @RequestMapping(value="/authenticate",method=RequestMethod.POST)
  public String authenticate(@RequestParam String name,@RequestParam String password,@RequestParam String signInType)
  {
    if(signInType != null)
    {
      if(signInType.equals("readitlater"))
      {
        ReadItLaterService rService = new ReadItLaterServiceImpl();
        if(rService.authenticate(name, password))
        {
          return VIEW_SIGNIN_SUCCESS;
        }
      }
    }
    return VIEW_SIGNIN_FAIL;
   
  }
 
  @RequestMapping(value="/dashboard")
  public String dashboard()
  {
    return "/my/dashboard";
  }
 
}
TOP

Related Classes of com.cib.yym.homepage.controller.AccountController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.