zheng-upms修改为dubbo方式
This commit is contained in:
parent
30762f45a4
commit
bd91ce53be
17
README.md
17
README.md
|
@ -5,29 +5,30 @@
|
|||
zheng
|
||||
├── zheng-common -- 公共模块
|
||||
├── zheng-upms -- 用户权限管理系统
|
||||
| ├── zheng-upms-dao -- 数据库MyBatisGenerator操作
|
||||
| ├── zheng-upms-service -- 业务逻辑
|
||||
| ├── zheng-upms-dao -- 数据库操作,MyBatisGenerator生成
|
||||
| ├── zheng-upms-rpc-api -- rpc接口包
|
||||
| ├── zheng-upms-rpc-service -- rpc服务提供者
|
||||
| ├── zheng-upms-client -- SSO登录客户端
|
||||
| └── zheng-upms-server -- 系统及SSO服务端[端口:1111]
|
||||
├── zheng-cms -- 内容管理系统
|
||||
| ├── zheng-cms-dao -- 数据库MyBatisGenerator操作
|
||||
| ├── zheng-cms-dao -- 数据库操作,MyBatisGenerator生成
|
||||
| ├── zheng-cms-service -- 业务逻辑
|
||||
| ├── zheng-cms-search -- 搜索服务[端口:2221]
|
||||
| ├── zheng-cms-admin -- 后台管理[端口:2222]
|
||||
| ├── zheng-cms-job -- 消息队列、任务调度等[端口:2223]
|
||||
| └── zheng-cms-web -- 网站前台[端口:2224]
|
||||
├── zheng-pay -- 支付系统
|
||||
| ├── zheng-pay-dao -- 数据库MyBatisGenerator操作
|
||||
| ├── zheng-pay-dao -- 数据库操作,MyBatisGenerator生成
|
||||
| ├── zheng-pay-service -- 业务逻辑
|
||||
| ├── zheng-pay-sdk -- 开发工具包
|
||||
| ├── zheng-pay-admin -- 后台管理[端口:3331]
|
||||
| └── zheng-pay-web -- 演示示例[端口:3332]
|
||||
├── zheng-ucenter -- 用户系统
|
||||
| ├── zheng-ucenter-dao -- 数据库MyBatisGenerator操作
|
||||
| ├── zheng-ucenter-dao -- 数据库操作,MyBatisGenerator生成
|
||||
| ├── zheng-ucenter-service -- 业务逻辑
|
||||
| └── zheng-ucenter-home -- 网站前台[端口:4441]
|
||||
|── zheng-wechat-mp -- 微信公众号管理系统
|
||||
| ├── zheng-wechat-mp-dao -- 数据库MyBatisGenerator操作
|
||||
| ├── zheng-wechat-mp-dao -- 数据库操作,MyBatisGenerator生成
|
||||
| ├── zheng-wechat-mp-service -- 业务逻辑
|
||||
| └── zheng-wechat-mp-admin -- 后台管理[端口:5551]
|
||||
├── zheng-api -- 接口系统
|
||||
|
@ -42,6 +43,7 @@ zheng
|
|||
* Spring Framework
|
||||
* SpringMVC: MVC框架
|
||||
* MyBatis: ORM框架
|
||||
* MyBatis-plus: Mybatis增强包
|
||||
* MyBatis Generator: 代码生成
|
||||
* Druid: 数据库连接池
|
||||
* Spring secutity|Shiro: 权限认证
|
||||
|
@ -62,6 +64,7 @@ zheng
|
|||
* Spring-boot
|
||||
* Swagger2: 接口文档
|
||||
* FastDFS: 分布式文件系统
|
||||
* sequence: 分布式高效ID生产 [http://git.oschina.net/yu120/sequence](http://git.oschina.net/yu120/sequence "sequence")
|
||||
|
||||
|
||||
# 前端技术:
|
||||
|
@ -115,7 +118,7 @@ zheng
|
|||
* ZooKeeper [http://www.apache.org/dyn/closer.cgi/zookeeper/](http://www.apache.org/dyn/closer.cgi/zookeeper/ "ZooKeeper")
|
||||
* Dubbo [http://dubbo.io/Download-zh.htm](http://dubbo.io/Download-zh.htm "Dubbo")
|
||||
* Jenkins [http://updates.jenkins-ci.org/download/war/](http://updates.jenkins-ci.org/download/war/ "Jenkins")
|
||||
* Dubbo [http://www.apache.org/dyn/closer.cgi/zookeeper/](http://dubbo.io/Download-zh.htm "Dubbo")
|
||||
* dubbo-admin-2.5.4-SNAPSHOT-jdk8 [http://download.csdn.net/download/mappingsunlight/9489736](http://download.csdn.net/download/mappingsunlight/9489736 "dubbo-admin-2.5.4-SNAPSHOT-jdk8")
|
||||
|
||||
# 数据模型
|
||||

|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
<version>${spring-security.version}</version>
|
||||
</dependency>
|
||||
<!-- mybatis -->
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
|
@ -84,11 +85,34 @@
|
|||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>${mybatis-spring.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.generator</groupId>
|
||||
<artifactId>mybatis-generator-core</artifactId>
|
||||
<version>${mybatis-generator.version}</version>
|
||||
</dependency>
|
||||
<!-- dubbo -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>2.5.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.sgroschupf</groupId>
|
||||
<artifactId>zkclient</artifactId>
|
||||
<version>0.1</version>
|
||||
</dependency>
|
||||
<!-- 缓存 -->
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
|
|
|
@ -43,14 +43,52 @@
|
|||
<property name="filters" value="stat" />
|
||||
</bean>
|
||||
|
||||
<!-- 为Mybatis创建SqlSessionFactory,同时指定数据源 -->
|
||||
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||
<!-- 为Mybatis创建SqlSessionFactory,同时指定数据源 --><!-- org.mybatis.spring.SqlSessionFactoryBean -->
|
||||
<!-- 注意:这里使用的是MP的MybatisSqlSessionFactoryBean,而不是Mybatis的,因为MP需要进行相应代理 -->
|
||||
<bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="configLocation" value="classpath:mybatis-config.xml" />
|
||||
<property name="mapperLocations" value="classpath*:**/mapper/*Mapper.xml" />
|
||||
<!-- 插件配置项 -->
|
||||
<property name="plugins">
|
||||
<array>
|
||||
<!-- 分页插件配置 -->
|
||||
<bean id="paginationInterceptor" class="com.baomidou.mybatisplus.plugins.PaginationInterceptor">
|
||||
<property name="dialectType" value="mysql" />
|
||||
</bean>
|
||||
</array>
|
||||
</property>
|
||||
<!-- 全局配置注入 -->
|
||||
<property name="globalConfig" ref="globalConfig" />
|
||||
</bean>
|
||||
<bean id="globalConfig" class="com.baomidou.mybatisplus.entity.GlobalConfiguration">
|
||||
<!--
|
||||
AUTO->`0`("数据库ID自增")
|
||||
INPUT->`1`(用户输入ID")
|
||||
ID_WORKER->`2`("全局唯一ID")
|
||||
UUID->`3`("全局唯一ID")
|
||||
-->
|
||||
<!-- <property name="idType" value="0" /> -->
|
||||
<!--
|
||||
MYSQL->`mysql`
|
||||
ORACLE->`oracle`
|
||||
DB2->`db2`
|
||||
H2->`h2`
|
||||
HSQL->`hsql`
|
||||
SQLITE->`sqlite`
|
||||
POSTGRE->`postgresql`
|
||||
SQLSERVER2005->`sqlserver2005`
|
||||
SQLSERVER->`sqlserver`
|
||||
-->
|
||||
<!-- Oracle需要添加该项 -->
|
||||
<!-- <property name="dbType" value="oracle" /> -->
|
||||
<!-- 全局表为下划线命名设置 true -->
|
||||
<!-- <property name="dbColumnUnderline" value="true" /> -->
|
||||
<property name="sqlInjector" ref="autosqlinjector"/>
|
||||
</bean>
|
||||
<bean id="autosqlinjector" class="com.baomidou.mybatisplus.mapper.AutoSqlInjector"/>
|
||||
<!-- Mapper接口所在包名,Spring会自动查找其下的Mapper -->
|
||||
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<property name="basePackage" value="**.mapper" />
|
||||
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
|
||||
</bean>
|
||||
|
|
|
@ -25,5 +25,7 @@
|
|||
<module>zheng-upms-server</module>
|
||||
<module>zheng-upms-app1</module>
|
||||
<module>zheng-upms-app2</module>
|
||||
<module>zheng-upms-rpc-api</module>
|
||||
<module>zheng-upms-rpc-service</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-upms</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>zheng-upms-rpc-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>zheng-upms-rpc-api</name>
|
||||
<url>http://www.zhangshuzheng.cn</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-upms-dao</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>zheng-upms-rpc-api</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,16 @@
|
|||
package com.zheng.upms.rpc.api;
|
||||
|
||||
/**
|
||||
* baseService接口
|
||||
* @author shuzheng
|
||||
* @date 2016年7月7日 上午9:58:23
|
||||
*/
|
||||
public interface BaseService<Mapper> {
|
||||
|
||||
/**
|
||||
* 获取基本操作mapper
|
||||
* @return
|
||||
*/
|
||||
Mapper getMapper();
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.zheng.upms.rpc.api;
|
||||
|
||||
import com.zheng.upms.dao.mapper.UpmsSystemMapper;
|
||||
|
||||
/**
|
||||
* 系统service接口
|
||||
* Created by shuzheng on 2016/12/18.
|
||||
*/
|
||||
public interface UpmsSystemService extends BaseService<UpmsSystemMapper> {
|
||||
|
||||
// 批量删除
|
||||
int deleteByPrimaryKeys(String ids);
|
||||
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-upms</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>zheng-upms-rpc-service</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>zheng-upms-rpc-service Maven Webapp</name>
|
||||
<url>http://www.zhangshuzheng.cn</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-upms-rpc-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<env>dev</env>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<env>test</env>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<env>prod</env>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>zheng-upms-rpc-service</finalName>
|
||||
<filters>
|
||||
<filter>src/main/resources/profiles/${env}.properties</filter>
|
||||
</filters>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- jetty插件 -->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<!--<version>9.0.0.v20130308</version>-->
|
||||
<version>9.2.7.v20150116</version>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>3</scanIntervalSeconds>
|
||||
<webApp>
|
||||
<contextPath>/</contextPath>
|
||||
</webApp>
|
||||
<httpConnector>
|
||||
<port>1112</port>
|
||||
</httpConnector>
|
||||
<reload>automatic</reload>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<!--是否跳过单元测试-->
|
||||
<skipTests>true</skipTests>
|
||||
<!--是否忽略单元测试错误-->
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,51 @@
|
|||
package com.zheng.upms.rpc.service.impl;
|
||||
|
||||
import com.zheng.upms.dao.mapper.UpmsSystemMapper;
|
||||
import com.zheng.upms.rpc.api.UpmsSystemService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 系统service实现
|
||||
* Created by shuzheng on 2016/12/18.
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class UpmsSystemServiceImpl implements UpmsSystemService {
|
||||
|
||||
private static Logger _log = LoggerFactory.getLogger(UpmsSystemServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private UpmsSystemMapper upmsSystemMapper;
|
||||
|
||||
@Override
|
||||
public UpmsSystemMapper getMapper() {
|
||||
return upmsSystemMapper;
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
@Override
|
||||
public int deleteByPrimaryKeys(String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return 0;
|
||||
}
|
||||
String[] idArray = ids.split("-");
|
||||
int count = 0;
|
||||
for (String id : idArray) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
count += upmsSystemMapper.deleteByPrimaryKey(Integer.parseInt(id));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<dubbo:application name="zheng-upms-rpc-service"/>
|
||||
|
||||
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"/>
|
||||
|
||||
<dubbo:protocol name="dubbo" port="20880"/>
|
||||
|
||||
<bean id="upmsSystemServiceImpl" class="com.zheng.upms.rpc.service.impl.UpmsSystemServiceImpl"/>
|
||||
<dubbo:service interface="com.zheng.upms.rpc.api.UpmsSystemService" ref="upmsSystemServiceImpl"/>
|
||||
</beans>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
env=${profile.env}
|
|
@ -0,0 +1,18 @@
|
|||
#off/fatal/error/warn/info/debug/all
|
||||
log4j.debug=false
|
||||
log4j.rootLogger=info, stdout
|
||||
|
||||
# Console output
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
|
||||
|
||||
#Spring logging configuration
|
||||
log4j.category.org.springframework = warn
|
||||
|
||||
#Druid logging configuration
|
||||
log4j.logger.druid.sql=warn,stdout
|
||||
log4j.logger.druid.sql.DataSource=warn,stdout
|
||||
log4j.logger.druid.sql.Connection=warn,stdout
|
||||
log4j.logger.druid.sql.Statement=warn,stdout
|
||||
log4j.logger.druid.sql.ResultSet=warn,stdout
|
|
@ -0,0 +1 @@
|
|||
profile.env=dev
|
|
@ -0,0 +1 @@
|
|||
profile.env=prod
|
|
@ -0,0 +1 @@
|
|||
profile.env=test
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
version="2.5">
|
||||
|
||||
<!-- 强制进行转码 -->
|
||||
<filter>
|
||||
<filter-name>CharacterEncodingFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>CharacterEncodingFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
<dispatcher>FORWARD</dispatcher>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- 默认的spring配置文件是在WEB-INF下的applicationContext.xml -->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
classpath*:applicationContext*.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- 日志配置文件 -->
|
||||
<context-param>
|
||||
<param-name>log4jConfigLocation</param-name>
|
||||
<param-value>classpath:log4j.properties</param-value>
|
||||
</context-param>
|
||||
|
||||
</web-app>
|
|
@ -17,7 +17,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-upms-service</artifactId>
|
||||
<artifactId>zheng-upms-rpc-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package com.zheng.upms.admin.controller;
|
||||
|
||||
import com.zheng.upms.dao.model.UpmsSystemExample;
|
||||
import com.zheng.upms.rpc.api.UpmsSystemService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 系统controller
|
||||
|
@ -15,9 +19,21 @@ public class SystemController {
|
|||
|
||||
private static Logger _log = LoggerFactory.getLogger(SystemController.class);
|
||||
|
||||
@Autowired
|
||||
private UpmsSystemService upmsSystemService;
|
||||
|
||||
@RequestMapping("/index")
|
||||
public String index() {
|
||||
return "/system/index";
|
||||
}
|
||||
|
||||
@RequestMapping("/list")
|
||||
@ResponseBody
|
||||
public Object list() {
|
||||
UpmsSystemExample upmsSystemExample = new UpmsSystemExample();
|
||||
upmsSystemExample.createCriteria()
|
||||
.andSystemIdGreaterThan(0);
|
||||
return upmsSystemService.getMapper().selectByExample(upmsSystemExample);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<dubbo:application name="zheng-upms-server"/>
|
||||
|
||||
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"/>
|
||||
|
||||
<dubbo:reference id="upmsSystemService" interface="com.zheng.upms.rpc.api.UpmsSystemService" />
|
||||
|
||||
</beans>
|
Loading…
Reference in New Issue