Browse Source

init

master
燕鹏 4 years ago
commit
01cb8c7f1f
  1. 37
      .gitignore
  2. 38
      build.gradle
  3. 1
      settings.gradle
  4. 13
      src/main/java/com/example/demo/DemoApplication.java
  5. 41
      src/main/java/com/example/demo/controller/AdminController.java
  6. 21
      src/main/java/com/example/demo/entity/Admin.java
  7. 25
      src/main/java/com/example/demo/entity/IDEntity.java
  8. 15
      src/main/java/com/example/demo/repository/AdminRespository.java
  9. 15
      src/main/java/com/example/demo/service/AdminService.java
  10. 20
      src/main/java/com/example/demo/service/impl/AdminServiceImpl.java
  11. 14
      src/main/resources/application.yml
  12. 61
      src/main/resources/bpmn/test.bpmn
  13. 13
      src/test/java/com/example/demo/DemoApplicationTests.java

37
.gitignore

@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/

38
build.gradle

@ -0,0 +1,38 @@
plugins {
id 'org.springframework.boot' version '2.3.4.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
repositories {
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "http://maven.aiprose.com/nexus/content/groups/public/" }
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'com.aiprose:jpa-common-utils:2.3.4'
implementation 'org.activiti:activiti-spring-boot-starter:7.1.0.M5'
runtimeOnly 'mysql:mysql-connector-java'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
compile group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}

1
settings.gradle

@ -0,0 +1 @@
rootProject.name = 'activiti-demo'

13
src/main/java/com/example/demo/DemoApplication.java

@ -0,0 +1,13 @@
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}

41
src/main/java/com/example/demo/controller/AdminController.java

@ -0,0 +1,41 @@
package com.example.demo.controller;
import com.example.demo.entity.Admin;
import com.example.demo.service.AdminService;
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;
@GetMapping("list")
public Flux<List<Admin>> list(){
List<Admin> list = adminService.findList(null);
return Flux.just(list);
}
@PostMapping("save")
public Mono<Admin> list(Admin admin){
Admin save = adminService.save(admin);
return Mono.just(save);
}
}

21
src/main/java/com/example/demo/entity/Admin.java

@ -0,0 +1,21 @@
package com.example.demo.entity;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @author yanpeng
* @version 1.0
* @desc TODO
* @company 北京中经网软件有限公司
* @date 2020/10/27 13:54
*/
@Data
@Entity
@Table(name="t_admin")
public class Admin extends IDEntity{
private String userName;
}

25
src/main/java/com/example/demo/entity/IDEntity.java

@ -0,0 +1,25 @@
package com.example.demo.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
/**
* @author yanpeng
* @version 1.0
* @desc TODO
* @company 北京中经网软件有限公司
* @date 2020/10/27 14:25
*/
@Data
@MappedSuperclass
public class IDEntity implements Serializable {
/**
* 主键
*/
@Id
@Column(columnDefinition = "INT UNSIGNED")
@GeneratedValue(strategy = GenerationType.AUTO)
protected Integer id;
}

15
src/main/java/com/example/demo/repository/AdminRespository.java

@ -0,0 +1,15 @@
package com.example.demo.repository;
import com.example.demo.entity.Admin;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author yanpeng
* @version 1.0
* @desc TODO
* @company 北京中经网软件有限公司
* @date 2020/10/27 14:21
*/
public interface AdminRespository extends JpaRepository<Admin, Integer>, JpaSpecificationExecutor<Admin> {
}

15
src/main/java/com/example/demo/service/AdminService.java

@ -0,0 +1,15 @@
package com.example.demo.service;
import com.aiprose.base.BaseCrudService;
import com.aiprose.base.BaseSpecService;
import com.example.demo.entity.Admin;
/**
* @author yanpeng
* @version 1.0
* @desc TODO
* @company 北京中经网软件有限公司
* @date 2020/10/27 14:27
*/
public interface AdminService extends BaseSpecService<Admin,Integer> {
}

20
src/main/java/com/example/demo/service/impl/AdminServiceImpl.java

@ -0,0 +1,20 @@
package com.example.demo.service.impl;
import com.aiprose.base.BaseSpecServiceImpl;
import com.example.demo.entity.Admin;
import com.example.demo.repository.AdminRespository;
import com.example.demo.service.AdminService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author yanpeng
* @version 1.0
* @desc TODO
* @company 北京中经网软件有限公司
* @date 2020/10/27 14:28
*/
@Transactional
@Service
public class AdminServiceImpl extends BaseSpecServiceImpl<AdminRespository, Admin,Integer> implements AdminService {
}

14
src/main/resources/application.yml

@ -0,0 +1,14 @@
server:
port: 9981
spring:
jpa:
hibernate:
ddl-auto: update
show-sql: true
generate-ddl: true
database-platform: org.hibernate.dialect.MySQL8Dialect
datasource:
username: root
password: trgis
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://47.98.109.5:3309/actibpmn?characterEncoding=utf8&useSSL=false

61
src/main/resources/bpmn/test.bpmn

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1603943189125" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="myProcess_1" isClosed="false" isExecutable="true" processType="None">
<startEvent id="_2" name="StartEvent"/>
<userTask activiti:exclusive="true" id="_3" name="填写请��"/>
<userTask activiti:exclusive="true" id="_4" name="部门��审核"/>
<endEvent id="_5" name="EndEvent"/>
<sequenceFlow id="_6" sourceRef="_2" targetRef="_3"/>
<sequenceFlow id="_7" sourceRef="_3" targetRef="_4"/>
<sequenceFlow id="_8" sourceRef="_4" targetRef="_5"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="myProcess_1">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="275.0" y="65.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="55.0" width="85.0" x="250.0" y="135.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<omgdc:Bounds height="55.0" width="85.0" x="250.0" y="235.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" id="Shape-_5">
<omgdc:Bounds height="32.0" width="32.0" x="275.0" y="340.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_3">
<omgdi:waypoint x="291.0" y="97.0"/>
<omgdi:waypoint x="291.0" y="135.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_3" targetElement="_4">
<omgdi:waypoint x="292.5" y="190.0"/>
<omgdi:waypoint x="292.5" y="235.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_4" targetElement="_5">
<omgdi:waypoint x="291.0" y="290.0"/>
<omgdi:waypoint x="291.0" y="340.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

13
src/test/java/com/example/demo/DemoApplicationTests.java

@ -0,0 +1,13 @@
package com.example.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
}
Loading…
Cancel
Save