package com.huiju.foyo.controller;

import com.alibaba.fastjson.JSONObject;
import com.huiju.foyo.common.ResponseBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author FXF
 * @date 2019-08-21
 */
@RestController
@RequestMapping("/")
public class LoginController {
	
	@PostMapping("/admin/login/login")
	public ResponseBean login(@RequestBody String jsonString){
		ResponseBean responseBean = new ResponseBean();
		responseBean.addSuccess(jsonString);
		return responseBean;
	}
	
	@GetMapping("/admin/user/info")
	public String info(){
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("roles","['admin']");
		jsonObject.put("token","admin");
		jsonObject.put("introduction","我是超级管理员");
		jsonObject.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
		jsonObject.put("name","'Super Admin'");
		return jsonObject.toJSONString();
	}
}
