package org.jeecg.modules.orderplatform.controller;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.orderplatform.service.IPlatformQueryOtherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/platform/query")
public class PlatformQueryOtherCtrl {

    @Autowired
    IPlatformQueryOtherService platformQueryOtherService;

    @GetMapping(value = "/designLeader")
    public Result<List<JSONObject>> queryPageList() {
        Result<List<JSONObject>> result = new Result<>();
        result.setSuccess(true);
        result.setResult(platformQueryOtherService.getAllDesignLeader());
        return result;
    }


    @GetMapping(value = "/identity")
    public Result<JSONObject> identity() {
        Result<JSONObject> result = new Result<>();
        result.setSuccess(true);
        result.setResult(platformQueryOtherService.queryIdentity());
        return result;
    }

    @GetMapping(value ="/jobContent")
    public Result<Map<String,Object>> jobContent() {
        Result<Map<String,Object>> result = new Result<>();
        Map<String,Object> jobContent =new HashMap<>();
        jobContent.put("operatorJobContent",platformQueryOtherService.operatorJobContent());
        jobContent.put("designLeaderJobContent",platformQueryOtherService.designLeaderJobContent());
        jobContent.put("designJobContent",platformQueryOtherService.designJobContent());
        result.setSuccess(true);
        result.setResult(jobContent);
        return result;
    }
}
