| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package cn.com.goldenwater.dcproj.controller.sso;
- import cn.com.goldenwater.dcproj.service.BisInspAllRlationPersService;
- import com.dcxx.framework.watermanagesdk.DingSdk;
- import com.dcxx.framework.watermanagesdk.utils.JsonHelper;
- import io.swagger.annotations.Api;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.ComponentScan;
- import org.springframework.web.bind.annotation.*;
- import java.util.Map;
- /**
- * @author hanxi
- * @date 2020-07-09
- */
- @Api(value = "钉钉用户单点登录", tags = "单点登录")
- @RestController
- @RequestMapping("/ding")
- @ComponentScan(basePackages =
- {"com.dcxx.framework.watermanagesdk.config"})
- public class DingController{
- @Autowired
- private BisInspAllRlationPersService bisInspAllRlationPersService;
- /**
- * @param
- * @return java.lang.String
- * @Author MJ
- * @Description 验证水管平台的票据信息,返回验证得到的用户信息
- * @Date 2019/8/8 10:54
- **/
- @RequestMapping("/validateTicket")
- public String validateDingTicket(@RequestParam(value = "ticket", required = false) String ticket) throws Exception {
- DingSdk dingSdk = new DingSdk();
- //TODO 以下参数请做对应修改
- //TODO 钉钉鉴权颁发的票据
- ticket = "ding_ticket_test";
- //TODO 钉钉微应用ID
- long agentId = 272787838L;
- Map<String, Object> dingUserMap = dingSdk.validateDingTicket(ticket, agentId);
- return JsonHelper.object2Json(dingUserMap);
- }
- }
|