李明
|
用户服务的分析
用户服务接口创建
<?xml version="1.0" encoding="UTF-8"?><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"> <parent> <artifactId>ms-server</artifactId> <groupId>com.idig8</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>com.idig8</groupId> <artifactId>user-thrift-service-api</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.10.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build></project>
namespace java com.idig8.thrift.userstruct UserInfo{ 1:i32 id, 2:string username, 3:string password, 4:string realName, 5:string mobile, 6:string email }service UserService{ UserInfo getUserById(1:i32 id) UserInfo getUserByName(1:string username); void regiserUser(1:UserInfo userInfo); }
thrift --gen java -out ../src/main/java user-service.thrift
因自动生成源码太多,直接看文章头的连接地址下载吧
image.png
# mac下 cur_dir = 'pwd' docker stop idig8-mysql docker rm idig8-mysql docker run --name idig8-mysql -v ${cur_dir}/conf:/etc/mysql/conf.d -v ${cur_dir}/data:/var/lib/mysql -p 3306:3306 -e MY_ROOT_PASSWORD=root -d mysql:latest
PS:老铁可能感觉很乱,我把思路从头到尾说一下
|
2019-01-28 00:09:08