SocialSignOnListController.java 1.8 KB
Newer Older
MaxKey单点登录官方's avatar
MaxKey单点登录官方 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 

MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
18 19 20 21
package org.maxkey.web.contorller;

import java.util.List;

M
3.5.0  
MaxKey 已提交
22 23
import org.maxkey.authn.annotation.CurrentUser;
import org.maxkey.entity.Message;
M
MaxKey 已提交
24
import org.maxkey.entity.SocialsAssociate;
M
3.5.0  
MaxKey 已提交
25 26
import org.maxkey.entity.UserInfo;
import org.maxkey.persistence.service.SocialsAssociatesService;
MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
27 28 29
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
M
3.5.0  
MaxKey 已提交
30
import org.springframework.http.ResponseEntity;
MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
31 32
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
M
3.5.0  
MaxKey 已提交
33
import org.springframework.web.bind.annotation.ResponseBody;
MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
34 35 36


@Controller
M
3.5.0  
MaxKey 已提交
37
@RequestMapping(value={"/config/socialsignon"})
MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
38 39 40 41
public class SocialSignOnListController {
	final static Logger _logger = LoggerFactory.getLogger(SocialSignOnListController.class);
	
	@Autowired
M
3.5.0  
MaxKey 已提交
42
	protected SocialsAssociatesService socialsAssociatesService;
MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
43 44
	
	
M
3.5.0  
MaxKey 已提交
45 46 47
	@RequestMapping(value={"/fetch"})
	@ResponseBody
	public ResponseEntity<?> fetch(@CurrentUser UserInfo currentUser){
M
MaxKey 已提交
48
		
M
3.5.0  
MaxKey 已提交
49 50
		List<SocialsAssociate>  listSocialsAssociate= 
				socialsAssociatesService.queryByUser(currentUser);
M
MaxKey 已提交
51
		
M
3.5.0  
MaxKey 已提交
52
		return new Message<List<SocialsAssociate>>(listSocialsAssociate).buildResponse();
MaxKey单点登录官方's avatar
init  
MaxKey单点登录官方 已提交
53 54 55
	}
	
}