建立机场项目后端管理Api的基础框架
1. 增加全局异常捕获处理 2. 增加RestfulApi调用的日志打印,请求参数返回参数 3. 添加双数据源配置(mysql,oracle) 其中oracle为基础旧有数据 4. 增加统一日志中心的配置ELK 5. 实现Controller层,DAO 层 ,Entity 层,Service 层 (轻)
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
|||||||
|
/target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/build/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
@@ -2,7 +2,6 @@ package com.gzzn.omms.adminapi;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class AdminApiApplication {
|
public class AdminApiApplication {
|
||||||
|
|||||||
+34
-37
@@ -1,37 +1,34 @@
|
|||||||
package com.gzzn.omms.adminapi.controller.basicdata;
|
package com.gzzn.omms.adminapi.controller.basicdata;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import java.util.List;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.IABCDao;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.ICheckinGroupDao;
|
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.ABC;
|
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.ICheckinGroupDao;
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.CheckinGroup;
|
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.CheckinGroup;
|
||||||
import com.gzzn.omms.adminapi.dto.ResponseDto;
|
import com.gzzn.omms.adminapi.dto.ResponseDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 值机岛
|
* 值机岛
|
||||||
* @author zhouxiunai
|
* @author zhouxiunai
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class CheckinGroupController {
|
public class CheckinGroupController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ICheckinGroupDao checkinGroupDao;
|
@Autowired
|
||||||
|
private ICheckinGroupDao checkinGroupDao;
|
||||||
@Autowired
|
|
||||||
private IABCDao ABCDao;
|
/**
|
||||||
|
* 获取所有值机岛数据
|
||||||
@GetMapping(value="/basicdata/checkinGroup")
|
* @return
|
||||||
public ResponseDto getCheckinGroup() {
|
*/
|
||||||
|
@GetMapping(value="/basicdata/checkinGroups")
|
||||||
ABC abc = ABCDao.findOne("1");
|
public ResponseDto getCheckinGroup() {
|
||||||
|
List<CheckinGroup> ls = (List<CheckinGroup>) checkinGroupDao.findAll();
|
||||||
return ResponseDto.success(abc);
|
return ResponseDto.success(ls);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
package com.gzzn.omms.adminapi.domain;
|
|
||||||
|
|
||||||
public interface BaseEntity {
|
|
||||||
public void load();
|
|
||||||
public void save();
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.gzzn.omms.adminapi.domain.secondary.dao.basicdata;
|
|
||||||
|
|
||||||
import org.springframework.data.repository.CrudRepository;
|
|
||||||
|
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.ABC;
|
|
||||||
|
|
||||||
public interface IABCDao extends CrudRepository<ABC,String>{
|
|
||||||
|
|
||||||
}
|
|
||||||
+9
-10
@@ -1,10 +1,9 @@
|
|||||||
package com.gzzn.omms.adminapi.domain.secondary.dao.basicdata;
|
package com.gzzn.omms.adminapi.domain.secondary.dao.basicdata;
|
||||||
|
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.CheckinGroup;
|
import com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata.CheckinGroup;
|
||||||
|
|
||||||
public interface ICheckinGroupDao extends CrudRepository<CheckinGroup,String> {
|
public interface ICheckinGroupDao extends CrudRepository<CheckinGroup,String> {
|
||||||
|
|
||||||
public CheckinGroup findByCheckinGroupCode(String code);
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
package com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
import javax.persistence.Table;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
@Table(name="ABC")
|
|
||||||
public class ABC {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@Column(name = "ID")
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
@Column(name = "NAME")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+46
-32
@@ -1,32 +1,46 @@
|
|||||||
package com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata;
|
package com.gzzn.omms.adminapi.domain.secondary.entity.baiscdata;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Transient;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
/**
|
||||||
import com.gzzn.omms.adminapi.domain.BaseEntity;
|
* 值机岛
|
||||||
import com.gzzn.omms.adminapi.domain.secondary.dao.basicdata.ICheckinGroupDao;
|
* @author zhouxiunai
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
/**
|
@Table(name="ORMS_CHECKIN_GROUP")
|
||||||
* 值机岛
|
public class CheckinGroup {
|
||||||
* @author zhouxiunai
|
|
||||||
*
|
@Id
|
||||||
*/
|
@Column(name = "CHECKIN_GROUP_CODE")
|
||||||
@Entity
|
private String checkinGroupCode;
|
||||||
@Table(name="ORMS_CHECKIN_GROUP")
|
|
||||||
public class CheckinGroup {
|
|
||||||
@Id
|
|
||||||
@Column(name = "CHECKIN_GROUP_CODE")
|
@Column(name = "CHECKIN_GROUP_NAME")
|
||||||
private String checkinGroupCode;
|
private String checkinGroupName;
|
||||||
|
|
||||||
|
public String getCheckinGroupCode() {
|
||||||
|
return checkinGroupCode;
|
||||||
@Column(name = "CHECKIN_GROUP_NAME")
|
}
|
||||||
private String checkinGroupName;
|
|
||||||
}
|
|
||||||
|
public void setCheckinGroupCode(String checkinGroupCode) {
|
||||||
|
this.checkinGroupCode = checkinGroupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCheckinGroupName() {
|
||||||
|
return checkinGroupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setCheckinGroupName(String checkinGroupName) {
|
||||||
|
this.checkinGroupName = checkinGroupName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
test-on-borrow: true
|
test-on-borrow: true
|
||||||
initial-size: 3
|
initial-size: 3
|
||||||
|
|
||||||
third:
|
secondary:
|
||||||
username: ommsxc
|
username: ommsxc
|
||||||
password: ommsxc
|
password: ommsxc
|
||||||
url: jdbc:oracle:thin:@130.120.2.105:1521/orcl
|
url: jdbc:oracle:thin:@130.120.2.105:1521/orcl
|
||||||
@@ -17,15 +17,4 @@ spring:
|
|||||||
tomcat:
|
tomcat:
|
||||||
max-active: 30
|
max-active: 30
|
||||||
test-on-borrow: true
|
test-on-borrow: true
|
||||||
initial-size: 3
|
initial-size: 3
|
||||||
|
|
||||||
secondary:
|
|
||||||
username: dc0305
|
|
||||||
password: 123456
|
|
||||||
url: jdbc:oracle:thin:@130.120.2.219:1521/orcl
|
|
||||||
driver: oracle.jdbc.driver.OracleDriver
|
|
||||||
tomcat:
|
|
||||||
max-active: 30
|
|
||||||
test-on-borrow: true
|
|
||||||
initial-size: 3
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user