You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
package com.example.demo.controller;
|
|
|
|
import com.example.demo.entity.Admin;
|
|
import com.example.demo.service.AdminService;
|
|
import org.activiti.engine.HistoryService;
|
|
import org.activiti.engine.ProcessEngine;
|
|
import org.activiti.engine.ProcessEngineConfiguration;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
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 reactor.core.publisher.Flux;
|
|
import reactor.core.publisher.Mono;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author yanpeng
|
|
* @version 1.0
|
|
* @desc TODO
|
|
* @company 北京中经网软件有限公司
|
|
* @date 2020/10/27 14:34
|
|
*/
|
|
@RestController
|
|
@RequestMapping("admin")
|
|
public class AdminController {
|
|
|
|
@Autowired
|
|
private AdminService adminService;
|
|
|
|
@Autowired
|
|
private ProcessEngine processEngine;
|
|
|
|
@GetMapping("list")
|
|
public Flux<List<Admin>> list(){
|
|
List<Admin> list = adminService.findList(null);
|
|
HistoryService historyService = processEngine.getHistoryService();
|
|
return Flux.just(list);
|
|
}
|
|
|
|
@PostMapping("save")
|
|
public Mono<Admin> list(Admin admin){
|
|
Admin save = adminService.save(admin);
|
|
return Mono.just(save);
|
|
}
|
|
}
|
|
|