123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- package com.jd.controller;
- import com.jd.code.ConstString;
- import com.jd.entity.basic.SsoSystem;
- import com.jd.service.SsoSystemService;
- import com.jd.util.Blank;
- import com.jd.util.SendUtil;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.HashMap;
- import java.util.Map;
- /**
- * SSO业务系统类
- * @author leihy
- */
- @RestController
- @RequestMapping("ssoSystem")
- @Api(value = "SSO业务系统", tags = {"SSO业务系统"})
- public class SsoSystemController {
- private final SsoSystemService ssoSystemService;
- public SsoSystemController(SsoSystemService ssoSystemService) {
- this.ssoSystemService = ssoSystemService;
- }
- /**
- * 查询SSO业务系统列表
- * @return
- */
- @GetMapping("/getSsoSystemList")
- @ApiOperation(value = "查询SSO业务系统列表")
- public Map<String, Object> getSsoSystemList(String userId) {
- Map<String, Object> map = new HashMap<>(4);
- map.put("userId", userId);
- return SendUtil.send(true, ConstString.RESULT_SUCCESS, ssoSystemService.getSsoSystemList(map));
- }
- /**
- * 获得sso系统列表页面
- * @param page 页面
- * @param limit 限制
- * @param queryValue 查询值
- * @return {@link Map}<{@link String}, {@link Object}>
- */
- @GetMapping("getSsoSystemListByPage")
- @ApiOperation(value = "分页查询SSO业务系统列表")
- public Map<String, Object> getSsoSystemListByPage(Integer page, Integer limit, String queryValue) {
- if (Blank.isEmpty(page, limit)) {
- return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
- }
- Map<String, Object> param = new HashMap<>(4);
- param.put("start", (page - 1) * limit);
- param.put("limit", limit);
- param.put("queryValue", queryValue);
- return ssoSystemService.getSsoSystemListByPage(param);
- }
- /**
- * 插入sso系统
- * @param ssoSystem sso系统
- * @return {@link Map}<{@link String}, {@link Object}>
- */
- @PostMapping("insertSsoSystem")
- @ApiOperation(value = "新增SSO业务系统")
- public Map<String, Object> insertSsoSystem(SsoSystem ssoSystem) {
- return ssoSystemService.insertSsoSystem(ssoSystem);
- }
- /**
- * 更新sso系统
- * @param ssoSystem sso系统
- * @return {@link Map}<{@link String}, {@link Object}>
- */
- @PostMapping("updateSsoSystem")
- @ApiOperation(value = "编辑SSO业务系统")
- public Map<String, Object> updateSsoSystem(SsoSystem ssoSystem) {
- return ssoSystemService.updateSsoSystem(ssoSystem);
- }
- /**
- * 删除sso系统
- * @param id id
- * @return {@link Map}<{@link String}, {@link Object}>
- */
- @PostMapping("deleteSsoSystem")
- @ApiOperation(value = "删除SSO业务系统")
- public Map<String, Object> deleteSsoSystem(Integer id) {
- if (Blank.isEmpty(id)) {
- return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
- }
- return ssoSystemService.deleteSsoSystem(id);
- }
- /**
- * 获得sso系统信息
- * @param id id
- * @return {@link Map}<{@link String}, {@link Object}>
- */
- @GetMapping("getSsoSystemInfo")
- @ApiOperation(value = "查询SSO业务系统详情")
- public Map<String, Object> getSsoSystemInfo(Integer id) {
- if (Blank.isEmpty(id)) {
- return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
- }
- return ssoSystemService.getSsoSystemInfo(id);
- }
- }
|