CompanyController.java 847 Bytes
package com.bsth.controller.basic;

import com.alibaba.fastjson.JSONObject;
import com.bsth.util.ConfigUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by panzhao on 2017/8/2.
 */
@RestController
@RequestMapping("company_json")
public class CompanyController {

    static String jsonStr;

    static{
        JSONObject json = JSONObject.parseObject(ConfigUtil.get("data.company.json"));
        JSONObject authJson = new JSONObject();
        String[] codes = ConfigUtil.get("tcc.company.id").split(",");
        for(int i = 0; i < codes.length; i ++){
            authJson.put(codes[i], json.get(codes[i]));
        }
        jsonStr = authJson.toJSONString();
    }

    @RequestMapping
    public String get(){
        return jsonStr;
    }
}