对接企业微信

This commit is contained in:
2026-04-24 20:10:51 +08:00
parent 03ba0c9090
commit d1ff7bde35
16 changed files with 1097 additions and 3 deletions

View File

@@ -0,0 +1,75 @@
package com.rj.controller;
import com.rj.entity.QweiUser;
import com.rj.service.IQweiUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("/api/qweiUser")
@Tag(name = "企微用户", description = "qwei_user增删改查与分页")
public class QweiUserController {
@Autowired
private IQweiUserService qweiUserService;
@PostMapping("/add")
@Operation(summary = "新增")
public ResponseEntity<Map<String, Object>> add(
@Parameter(description = "实体", required = true) @RequestBody QweiUser entity) {
Map<String, Object> result = qweiUserService.add(entity);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);
}
return ResponseEntity.badRequest().body(result);
}
@PutMapping("/update")
@Operation(summary = "更新")
public ResponseEntity<Map<String, Object>> update(
@Parameter(description = "实体", required = true) @RequestBody QweiUser entity) {
Map<String, Object> result = qweiUserService.update(entity);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);
}
return ResponseEntity.badRequest().body(result);
}
@DeleteMapping("/delete/{id}")
@Operation(summary = "删除")
public ResponseEntity<Map<String, Object>> delete(
@Parameter(description = "主键ID(UUID)", required = true) @PathVariable String id) {
Map<String, Object> result = qweiUserService.deleteById(id);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);
}
return ResponseEntity.badRequest().body(result);
}
@GetMapping("/list")
@Operation(summary = "分页查询")
public ResponseEntity<Map<String, Object>> list(
@RequestParam(defaultValue = "1") Integer current,
@RequestParam(defaultValue = "10") Integer size,
@RequestParam(required = false) String userid,
@RequestParam(required = false) String userName,
@RequestParam(required = false) Long mainDepartmentId,
@RequestParam(required = false) Integer status) {
Map<String, Object> result = qweiUserService.pageQuery(current, size, userid, userName, mainDepartmentId, status);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);
}
return ResponseEntity.internalServerError().body(result);
}
}