SysUserUniteController.java
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.chinagas.modules.system.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.chinagas.api.system.domain.SysUserUnite;
import com.chinagas.api.system.domain.SysUserUnite;
import com.chinagas.common.core.domain.R;
import com.chinagas.common.core.utils.StringUtils;
import com.chinagas.common.log.annotation.Log;
import com.chinagas.common.log.enums.BusinessType;
import com.chinagas.modules.system.service.ISysUserUniteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/sysUserUnite")
public class SysUserUniteController {
@Autowired
private ISysUserUniteService iSysUserUniteService;
@Log(title = "用户钉钉信息", businessType = BusinessType.INSERT)
@PostMapping("/saveOrUpdate")
public R<Boolean> saveOrUpdate(@RequestBody SysUserUnite sysUserUnite){
if (sysUserUnite == null
|| StringUtils.isEmpty(sysUserUnite.getDingTalkUnionId())
|| StringUtils.isEmpty(sysUserUnite.getDingTalkUserId())
|| sysUserUnite.getUserId() == null) {
return R.ok(false);
}
iSysUserUniteService.remove(Wrappers.<SysUserUnite>lambdaQuery().eq(SysUserUnite::getUserId,sysUserUnite.getUserId()));
return R.ok(iSysUserUniteService.save(sysUserUnite));
}
}