package com.landtool.lanbase.modules.api.controller;
|
|
import java.io.IOException;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;
|
import com.landtool.lanbase.modules.org.service.OrgGroupService;
|
|
/**
|
* @Description: 群组管理模块提供的api
|
* @Author: bing.guo
|
* @Date: 2018/2/01
|
*
|
*/
|
@Controller
|
@RequestMapping(path = "/api/org/group/")
|
@Api(value = "", tags = {"群组管理相关接口"})
|
public class OrgGroupApiController {
|
|
@Autowired
|
private OrgGroupService orgGroupService;
|
|
/**
|
* 根据应用程序ID获取对应群组列表
|
* @return
|
*/
|
@GetMapping("/queryListById/{appId}")
|
@ApiOperation(
|
value = "根据应用程序ID获取对应群组列表",
|
notes = ""
|
)
|
public void queryListById(@ApiParam(name="appId",value="应用程序appId",required=true)
|
@PathVariable(name = "appId")Long appId,
|
HttpServletResponse response) throws IOException{
|
SimplePropertyPreFilter filter = new SimplePropertyPreFilter();
|
filter.getExcludes().add("appId");
|
filter.getExcludes().add("description");
|
filter.getExcludes().add("rCreateUser");
|
filter.getExcludes().add("rCreateDate");
|
|
response.setHeader("Content-Type","application/json;charset=UTF-8");
|
response.getWriter().write(JSONObject.toJSONString(orgGroupService.queryListById(appId),filter));
|
}
|
}
|