package com.itheima.file.controller;

import com.alibaba.fastjson.JSONObject;
import com.itheima.file.pojo.Org;
import com.itheima.file.pojo.Person;
import com.itheima.file.service.OrgService;
import com.itheima.file.service.PersonService;
import com.itheima.file.util.HTTPHelper;
import com.itheima.file.util.SslUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.hc.client5.http.auth.AuthScope;
import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Base64;
import java.util.LinkedHashMap;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api")
public class ApiController {

    @Autowired
    private OrgService orgService;
    @Autowired
    private PersonService personService;

    @GetMapping("/org")
    public List<Org> getOrgList(){
        List<Org> list = orgService.list();
        return list;
    }

    @GetMapping("/person")
    public List<Person> getPersonList(){
        List<Person> list = personService.list();
        return list;
    }

}
