生成文件

This commit is contained in:
winLsy
2018-02-05 18:07:41 +08:00
parent 95c719fe17
commit b24230d290
25 changed files with 811 additions and 86 deletions
@@ -8,4 +8,9 @@ mybatisStart.properties
- `db.password`=`studyj2e`
- `mybatisGenerator.pojoPackage`=`pojoPackage`
- `mybatisGenerator.daoPackage`=`daoPackage`
- `mybatisGenerator.tablesPrefix`=`upms`
- `mybatisGenerator.tablesPrefix`=`upms`
安装
```bash
mvn install -Dmaven.plugin.skip=true
```
@@ -7,6 +7,7 @@ import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import java.lang.reflect.Field;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -19,7 +20,7 @@ public class GeneratorServiceAndControllerMojo extends AbstractMojo {
public void execute() throws MojoExecutionException, MojoFailureException {
//获取项目的绝对路径
String projectPath =null;
Map pluginContext = getPluginContext();
Map<String,Object> pluginContext = getPluginContext();
Set set = pluginContext.entrySet();
Iterator iterator = set.iterator();
while (iterator.hasNext()){
@@ -38,7 +38,7 @@ public class GeneratorServiceController {
PropertiesUtil.getProperty("mybatisGenerator.serviceImplPackage"));
mybatisGenerator.setControllerPackage(
PropertiesUtil.getProperty("mybatisGenerator.controllerPackage"));
mybatisGenerator.setControllerPackage(
mybatisGenerator.setPrimaryKeyType(
PropertiesUtil.getProperty("mybatisGenerator.primaryKeyType"));
mybatisGenerator.setIsOverWrite(
PropertiesUtil.getProperty("mybatisGenerator.isOverWrite"));
@@ -69,7 +69,7 @@ public class GeneratorServiceController {
String varPojoName = "";
String[] strings = tableName.split("_");
for (int i = 0; i < strings.length; i++) {
String string = strings[0];
String string = strings[i];
char c = string.charAt(0);
String s = String.valueOf(c);
String upperCase = s.toUpperCase();
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by maven-plugin-tools 3.2 on 2018-02-05 -->
<plugin>
<name>mybatis-generator-extend</name>
<description>mybatis-generator-extend-maven-plugin</description>
<groupId>com.micro.fast</groupId>
<artifactId>mybatis-generator-extend-maven-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<goalPrefix>mybatis-generator-extend</goalPrefix>
<isolatedRealm>false</isolatedRealm>
<inheritedByDefault>true</inheritedByDefault>
<mojos>
<mojo>
<goal>generateFiles</goal>
<requiresDirectInvocation>false</requiresDirectInvocation>
<requiresProject>true</requiresProject>
<requiresReports>false</requiresReports>
<aggregator>false</aggregator>
<requiresOnline>false</requiresOnline>
<inheritedByDefault>true</inheritedByDefault>
<implementation>com.micro.fast.mybatis.generator.extend.mojo.MybatisGeneratorExtendMojo</implementation>
<language>java</language>
<instantiationStrategy>per-lookup</instantiationStrategy>
<executionStrategy>once-per-session</executionStrategy>
<threadSafe>false</threadSafe>
<parameters/>
</mojo>
<mojo>
<goal>generateSC</goal>
<requiresDirectInvocation>false</requiresDirectInvocation>
<requiresProject>true</requiresProject>
<requiresReports>false</requiresReports>
<aggregator>false</aggregator>
<requiresOnline>false</requiresOnline>
<inheritedByDefault>true</inheritedByDefault>
<implementation>com.micro.fast.mybatis.generator.extend.mojo.GeneratorServiceAndControllerMojo</implementation>
<language>java</language>
<instantiationStrategy>per-lookup</instantiationStrategy>
<executionStrategy>once-per-session</executionStrategy>
<threadSafe>false</threadSafe>
<parameters/>
</mojo>
</mojos>
<dependencies>
<dependency>
<groupId>com.micro.fast</groupId>
<artifactId>boot-starter-util</artifactId>
<type>jar</type>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<type>jar</type>
<version>20.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<type>jar</type>
<version>3.5</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<type>jar</type>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<type>jar</type>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.hashids</groupId>
<artifactId>hashids</artifactId>
<type>jar</type>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<type>jar</type>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<type>jar</type>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<type>jar</type>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<type>jar</type>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<type>jar</type>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<type>jar</type>
<version>2.3.27-incubating</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<type>jar</type>
<version>5.1.44</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<type>jar</type>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<type>jar</type>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<type>jar</type>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<type>jar</type>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-plexus</artifactId>
<type>jar</type>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<type>jar</type>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-classworlds</artifactId>
<type>jar</type>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-bean</artifactId>
<type>jar</type>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
<type>jar</type>
<version>2.1.7</version>
</dependency>
</dependencies>
</plugin>
@@ -25,7 +25,7 @@ import java.util.List;
public class ${pojoName}Controller {
@Autowired
private ${pojoName}Service<${pojoName},${mybatisGenerator.primaryKeyType}> ${pojoName}Service;
private ${pojoName}Service<${pojoName},${mybatisGenerator.primaryKeyType}> ${varPojoName}Service;
@ApiOperation("添加信息")
@PostMapping
+6 -1
View File
@@ -94,6 +94,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.micro.fast</groupId>
<artifactId>mybatis-generator-extend-maven-plugin</artifactId>
<version>${micro.fast.version}</version>
</plugin>
<!--生成mybatis dao 层 sql mapper的插件-->
<plugin>
<groupId>org.mybatis.generator</groupId>
@@ -101,7 +106,7 @@
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
<overwrite>false</overwrite>
</configuration>
</plugin>
<!--将lib目录下的文件编译时打包-->
@@ -0,0 +1,65 @@
package com.micro.fast.ucenter.controller;
import com.micro.fast.boot.starter.common.response.BaseConst;
import com.micro.fast.boot.starter.common.response.ServerResponse;
import com.micro.fast.ucenter.pojo.UcenterOauth;
import com.micro.fast.ucenter.service.UcenterOauthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
*
* @author lsy
*/
@Api("ucenterOauth")
@RestController
@RequestMapping("ucenterOauth")
public class UcenterOauthController {
@Autowired
private UcenterOauthService<UcenterOauth,Integer> ucenterOauthService;
@ApiOperation("添加信息")
@PostMapping
public ServerResponse addUcenterOauth(@Valid UcenterOauth ucenterOauth) throws BindException {
return ucenterOauthService.add(ucenterOauth);
}
@ApiOperation("根据id查询详细信息")
@GetMapping("/{id}")
public ServerResponse getUcenterOauthById(
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
return ucenterOauthService.getById(Integer.valueOf(id));
}
@ApiOperation("根据条件分页查询")
@GetMapping
public ServerResponse getUcenterOauthByCondition(UcenterOauth ucenterOauth,
@RequestParam(defaultValue = "1",required = false) int pageNum,
@RequestParam(defaultValue = "10",required = false)int pageSize,
@RequestParam(required = false) String orderBy){
return ucenterOauthService.getByCondition(ucenterOauth,pageNum,pageSize,orderBy);
}
@ApiOperation("修改信息")
@PutMapping("/{id}")
public ServerResponse updateUcenterOauth(UcenterOauth ucenterOauth,
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
ucenterOauth.setId(Integer.valueOf(id));
return ucenterOauthService.update(ucenterOauth);
}
@ApiOperation("根据id删除,传入数组")
@DeleteMapping
public ServerResponse deleteUcenterOauth(@NotEmpty(message = BaseConst.BASEMSG_PREFIX+"请传入ids") List<Integer> ids){
return ucenterOauthService.deleteByIds(ids);
}
}
@@ -0,0 +1,65 @@
package com.micro.fast.ucenter.controller;
import com.micro.fast.boot.starter.common.response.BaseConst;
import com.micro.fast.boot.starter.common.response.ServerResponse;
import com.micro.fast.ucenter.pojo.UcenterUser;
import com.micro.fast.ucenter.service.UcenterUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
*
* @author lsy
*/
@Api("ucenterUser")
@RestController
@RequestMapping("ucenterUser")
public class UcenterUserController {
@Autowired
private UcenterUserService<UcenterUser,Integer> ucenterUserService;
@ApiOperation("添加信息")
@PostMapping
public ServerResponse addUcenterUser(@Valid UcenterUser ucenterUser) throws BindException {
return ucenterUserService.add(ucenterUser);
}
@ApiOperation("根据id查询详细信息")
@GetMapping("/{id}")
public ServerResponse getUcenterUserById(
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
return ucenterUserService.getById(Integer.valueOf(id));
}
@ApiOperation("根据条件分页查询")
@GetMapping
public ServerResponse getUcenterUserByCondition(UcenterUser ucenterUser,
@RequestParam(defaultValue = "1",required = false) int pageNum,
@RequestParam(defaultValue = "10",required = false)int pageSize,
@RequestParam(required = false) String orderBy){
return ucenterUserService.getByCondition(ucenterUser,pageNum,pageSize,orderBy);
}
@ApiOperation("修改信息")
@PutMapping("/{id}")
public ServerResponse updateUcenterUser(UcenterUser ucenterUser,
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
ucenterUser.setId(Integer.valueOf(id));
return ucenterUserService.update(ucenterUser);
}
@ApiOperation("根据id删除,传入数组")
@DeleteMapping
public ServerResponse deleteUcenterUser(@NotEmpty(message = BaseConst.BASEMSG_PREFIX+"请传入ids") List<Integer> ids){
return ucenterUserService.deleteByIds(ids);
}
}
@@ -0,0 +1,65 @@
package com.micro.fast.ucenter.controller;
import com.micro.fast.boot.starter.common.response.BaseConst;
import com.micro.fast.boot.starter.common.response.ServerResponse;
import com.micro.fast.ucenter.pojo.UcenterUserDetails;
import com.micro.fast.ucenter.service.UcenterUserDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
*
* @author lsy
*/
@Api("ucenterUserDetails")
@RestController
@RequestMapping("ucenterUserDetails")
public class UcenterUserDetailsController {
@Autowired
private UcenterUserDetailsService<UcenterUserDetails,Integer> ucenterUserDetailsService;
@ApiOperation("添加信息")
@PostMapping
public ServerResponse addUcenterUserDetails(@Valid UcenterUserDetails ucenterUserDetails) throws BindException {
return ucenterUserDetailsService.add(ucenterUserDetails);
}
@ApiOperation("根据id查询详细信息")
@GetMapping("/{id}")
public ServerResponse getUcenterUserDetailsById(
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
return ucenterUserDetailsService.getById(Integer.valueOf(id));
}
@ApiOperation("根据条件分页查询")
@GetMapping
public ServerResponse getUcenterUserDetailsByCondition(UcenterUserDetails ucenterUserDetails,
@RequestParam(defaultValue = "1",required = false) int pageNum,
@RequestParam(defaultValue = "10",required = false)int pageSize,
@RequestParam(required = false) String orderBy){
return ucenterUserDetailsService.getByCondition(ucenterUserDetails,pageNum,pageSize,orderBy);
}
@ApiOperation("修改信息")
@PutMapping("/{id}")
public ServerResponse updateUcenterUserDetails(UcenterUserDetails ucenterUserDetails,
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
ucenterUserDetails.setId(Integer.valueOf(id));
return ucenterUserDetailsService.update(ucenterUserDetails);
}
@ApiOperation("根据id删除,传入数组")
@DeleteMapping
public ServerResponse deleteUcenterUserDetails(@NotEmpty(message = BaseConst.BASEMSG_PREFIX+"请传入ids") List<Integer> ids){
return ucenterUserDetailsService.deleteByIds(ids);
}
}
@@ -0,0 +1,65 @@
package com.micro.fast.ucenter.controller;
import com.micro.fast.boot.starter.common.response.BaseConst;
import com.micro.fast.boot.starter.common.response.ServerResponse;
import com.micro.fast.ucenter.pojo.UcenterUserLog;
import com.micro.fast.ucenter.service.UcenterUserLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
*
* @author lsy
*/
@Api("ucenterUserLog")
@RestController
@RequestMapping("ucenterUserLog")
public class UcenterUserLogController {
@Autowired
private UcenterUserLogService<UcenterUserLog,Integer> ucenterUserLogService;
@ApiOperation("添加信息")
@PostMapping
public ServerResponse addUcenterUserLog(@Valid UcenterUserLog ucenterUserLog) throws BindException {
return ucenterUserLogService.add(ucenterUserLog);
}
@ApiOperation("根据id查询详细信息")
@GetMapping("/{id}")
public ServerResponse getUcenterUserLogById(
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
return ucenterUserLogService.getById(Integer.valueOf(id));
}
@ApiOperation("根据条件分页查询")
@GetMapping
public ServerResponse getUcenterUserLogByCondition(UcenterUserLog ucenterUserLog,
@RequestParam(defaultValue = "1",required = false) int pageNum,
@RequestParam(defaultValue = "10",required = false)int pageSize,
@RequestParam(required = false) String orderBy){
return ucenterUserLogService.getByCondition(ucenterUserLog,pageNum,pageSize,orderBy);
}
@ApiOperation("修改信息")
@PutMapping("/{id}")
public ServerResponse updateUcenterUserLog(UcenterUserLog ucenterUserLog,
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
ucenterUserLog.setId(Integer.valueOf(id));
return ucenterUserLogService.update(ucenterUserLog);
}
@ApiOperation("根据id删除,传入数组")
@DeleteMapping
public ServerResponse deleteUcenterUserLog(@NotEmpty(message = BaseConst.BASEMSG_PREFIX+"请传入ids") List<Integer> ids){
return ucenterUserLogService.deleteByIds(ids);
}
}
@@ -0,0 +1,65 @@
package com.micro.fast.ucenter.controller;
import com.micro.fast.boot.starter.common.response.BaseConst;
import com.micro.fast.boot.starter.common.response.ServerResponse;
import com.micro.fast.ucenter.pojo.UcenterUserOauth;
import com.micro.fast.ucenter.service.UcenterUserOauthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
*
* @author lsy
*/
@Api("ucenterUserOauth")
@RestController
@RequestMapping("ucenterUserOauth")
public class UcenterUserOauthController {
@Autowired
private UcenterUserOauthService<UcenterUserOauth,Integer> ucenterUserOauthService;
@ApiOperation("添加信息")
@PostMapping
public ServerResponse addUcenterUserOauth(@Valid UcenterUserOauth ucenterUserOauth) throws BindException {
return ucenterUserOauthService.add(ucenterUserOauth);
}
@ApiOperation("根据id查询详细信息")
@GetMapping("/{id}")
public ServerResponse getUcenterUserOauthById(
@PathVariable(value = "id") @NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
return ucenterUserOauthService.getById(Integer.valueOf(id));
}
@ApiOperation("根据条件分页查询")
@GetMapping
public ServerResponse getUcenterUserOauthByCondition(UcenterUserOauth ucenterUserOauth,
@RequestParam(defaultValue = "1",required = false) int pageNum,
@RequestParam(defaultValue = "10",required = false)int pageSize,
@RequestParam(required = false) String orderBy){
return ucenterUserOauthService.getByCondition(ucenterUserOauth,pageNum,pageSize,orderBy);
}
@ApiOperation("修改信息")
@PutMapping("/{id}")
public ServerResponse updateUcenterUserOauth(UcenterUserOauth ucenterUserOauth,
@NotBlank(message = BaseConst.BASEMSG_PREFIX+"请传入id") String id){
ucenterUserOauth.setId(Integer.valueOf(id));
return ucenterUserOauthService.update(ucenterUserOauth);
}
@ApiOperation("根据id删除,传入数组")
@DeleteMapping
public ServerResponse deleteUcenterUserOauth(@NotEmpty(message = BaseConst.BASEMSG_PREFIX+"请传入ids") List<Integer> ids){
return ucenterUserOauthService.deleteByIds(ids);
}
}
@@ -0,0 +1,10 @@
package com.micro.fast.ucenter.service;
import com.micro.fast.common.service.SsmService;
/**
* @author lsy
*/
public interface UcenterOauthService<T,ID> extends SsmService<T,ID>{
}
@@ -0,0 +1,10 @@
package com.micro.fast.ucenter.service;
import com.micro.fast.common.service.SsmService;
/**
* @author lsy
*/
public interface UcenterUserDetailsService<T,ID> extends SsmService<T,ID>{
}
@@ -0,0 +1,10 @@
package com.micro.fast.ucenter.service;
import com.micro.fast.common.service.SsmService;
/**
* @author lsy
*/
public interface UcenterUserLogService<T,ID> extends SsmService<T,ID>{
}
@@ -0,0 +1,10 @@
package com.micro.fast.ucenter.service;
import com.micro.fast.common.service.SsmService;
/**
* @author lsy
*/
public interface UcenterUserOauthService<T,ID> extends SsmService<T,ID>{
}
@@ -0,0 +1,10 @@
package com.micro.fast.ucenter.service;
import com.micro.fast.common.service.SsmService;
/**
* @author lsy
*/
public interface UcenterUserService<T,ID> extends SsmService<T,ID>{
}
@@ -0,0 +1,28 @@
package com.micro.fast.ucenter.service.impl;
import com.micro.fast.common.service.impl.SsmServiceImpl;
import com.micro.fast.ucenter.dao.UcenterOauthMapper;
import com.micro.fast.ucenter.pojo.UcenterOauth;
import com.micro.fast.ucenter.service.UcenterOauthService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author lsy
*/
@Service
public class UcenterOauthServiceImpl extends SsmServiceImpl<UcenterOauth,Integer,UcenterOauthMapper>
implements UcenterOauthService<UcenterOauth,Integer>,InitializingBean {
@Autowired
private UcenterOauthMapper mapper;
/**
* 在这个bean初始化完成后覆盖父类的mapper
*/
@Override
public void afterPropertiesSet() throws Exception {
super.setMapper(this.mapper);
}
}
@@ -0,0 +1,28 @@
package com.micro.fast.ucenter.service.impl;
import com.micro.fast.common.service.impl.SsmServiceImpl;
import com.micro.fast.ucenter.dao.UcenterUserDetailsMapper;
import com.micro.fast.ucenter.pojo.UcenterUserDetails;
import com.micro.fast.ucenter.service.UcenterUserDetailsService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author lsy
*/
@Service
public class UcenterUserDetailsServiceImpl extends SsmServiceImpl<UcenterUserDetails,Integer,UcenterUserDetailsMapper>
implements UcenterUserDetailsService<UcenterUserDetails,Integer>,InitializingBean {
@Autowired
private UcenterUserDetailsMapper mapper;
/**
* 在这个bean初始化完成后覆盖父类的mapper
*/
@Override
public void afterPropertiesSet() throws Exception {
super.setMapper(this.mapper);
}
}
@@ -0,0 +1,28 @@
package com.micro.fast.ucenter.service.impl;
import com.micro.fast.common.service.impl.SsmServiceImpl;
import com.micro.fast.ucenter.dao.UcenterUserLogMapper;
import com.micro.fast.ucenter.pojo.UcenterUserLog;
import com.micro.fast.ucenter.service.UcenterUserLogService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author lsy
*/
@Service
public class UcenterUserLogServiceImpl extends SsmServiceImpl<UcenterUserLog,Integer,UcenterUserLogMapper>
implements UcenterUserLogService<UcenterUserLog,Integer>,InitializingBean {
@Autowired
private UcenterUserLogMapper mapper;
/**
* 在这个bean初始化完成后覆盖父类的mapper
*/
@Override
public void afterPropertiesSet() throws Exception {
super.setMapper(this.mapper);
}
}
@@ -0,0 +1,28 @@
package com.micro.fast.ucenter.service.impl;
import com.micro.fast.common.service.impl.SsmServiceImpl;
import com.micro.fast.ucenter.dao.UcenterUserOauthMapper;
import com.micro.fast.ucenter.pojo.UcenterUserOauth;
import com.micro.fast.ucenter.service.UcenterUserOauthService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author lsy
*/
@Service
public class UcenterUserOauthServiceImpl extends SsmServiceImpl<UcenterUserOauth,Integer,UcenterUserOauthMapper>
implements UcenterUserOauthService<UcenterUserOauth,Integer>,InitializingBean {
@Autowired
private UcenterUserOauthMapper mapper;
/**
* 在这个bean初始化完成后覆盖父类的mapper
*/
@Override
public void afterPropertiesSet() throws Exception {
super.setMapper(this.mapper);
}
}
@@ -0,0 +1,28 @@
package com.micro.fast.ucenter.service.impl;
import com.micro.fast.common.service.impl.SsmServiceImpl;
import com.micro.fast.ucenter.dao.UcenterUserMapper;
import com.micro.fast.ucenter.pojo.UcenterUser;
import com.micro.fast.ucenter.service.UcenterUserService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author lsy
*/
@Service
public class UcenterUserServiceImpl extends SsmServiceImpl<UcenterUser,Integer,UcenterUserMapper>
implements UcenterUserService<UcenterUser,Integer>,InitializingBean {
@Autowired
private UcenterUserMapper mapper;
/**
* 在这个bean初始化完成后覆盖父类的mapper
*/
@Override
public void afterPropertiesSet() throws Exception {
super.setMapper(this.mapper);
}
}
@@ -1,77 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!--导入属性配置-->
<properties resource="mybatisGenerator.properties"></properties>
<!--指定特定数据库的jdbc驱动jar包的位置-->
<classPathEntry location="${db.driverLocation}"/>
<context id="default" targetRuntime="MyBatis3" defaultModelType="flat">
<!--java文件的编码设置-->
<property name="javaFileEncoding" value="UTF-8"/>
<!-- 由于beginningDelimiter和endingDelimiter的默认值为双引号("),在Mysql中不能这么写,所以还要将这两个默认值改为` -->
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<!-- 为生成的Java模型创建一个toString方法 -->
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
<!-- 对生成的pojo集成serializable接口-->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin" ></plugin>
<!-- optional,旨在创建class时,对注释进行控制 -->
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--jdbc的数据库连接 -->
<jdbcConnection
driverClass="${db.driverClassName}"
connectionURL="${db.url}"
userId="${db.username}"
password="${db.password}">
</jdbcConnection>
<!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制-->
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
targetPackage 指定生成的model生成所在的包名
targetProject 指定在该项目下所在的路径
-->
<javaModelGenerator targetPackage="com.micro.fast.ucenter.pojo" targetProject="./src/main/java">
<!-- 是否允许子包,即targetPackage.schemaName.tableName -->
<property name="enableSubPackages" value="false"/>
<!-- 是否对model添加 构造函数 -->
<property name="constructorBased" value="true"/>
<!-- 是否对类CHAR类型的列的数据进行trim操作 -->
<property name="trimStrings" value="true"/>
<!-- 建立的Model对象是否 不可改变 即生成的Model对象不会有 setter方法,只有构造方法 -->
<property name="immutable" value="false"/>
</javaModelGenerator>
<!--mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
<!--<sqlMapGenerator targetPackage="mappers" targetProject=".\src\main\resources">-->
<sqlMapGenerator targetPackage="mappers" targetProject="./src/main/resources">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口
-->
<!-- targetPackage:mapper接口dao生成的位置 -->
<!--<javaClientGenerator type="XMLMAPPER" targetPackage="com.mmall.dao" targetProject=".\src\main\java">-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.micro.fast.ucenter.dao" targetProject="./src/main/java" >
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<table tableName="ucenter_oauth" domainObjectName="UcenterOauth" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user" domainObjectName="UcenterUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user_details" domainObjectName="UcenterUserDetails" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user_log" domainObjectName="UcenterUserLog" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user_oauth" domainObjectName="UcenterUserOauth" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!--指定特定数据库的jdbc驱动jar包的位置-->
<classPathEntry location="E:/lsDev/tools/mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar"/>
<context id="default" targetRuntime="MyBatis3" defaultModelType="flat">
<!--java文件的编码设置-->
<property name="javaFileEncoding" value="UTF-8"/>
<!-- 由于beginningDelimiter和endingDelimiter的默认值为双引号("),在Mysql中不能这么写,所以还要将这两个默认值改为` -->
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<!-- 为生成的Java模型创建一个toString方法 -->
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
<!-- 对生成的pojo集成serializable接口-->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin" ></plugin>
<!-- optional,旨在创建class时,对注释进行控制 -->
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--jdbc的数据库连接 -->
<jdbcConnection
driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&amp;chracterEncoding=utf-8&amp;useSSL=false"
userId="root"
password="studyj2e">
</jdbcConnection>
<!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制-->
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
targetPackage 指定生成的model生成所在的包名
targetProject 指定在该项目下所在的路径
-->
<javaModelGenerator targetPackage="com.micro.fast.ucenter.pojo" targetProject="./src/main/java">
<!-- 是否允许子包,即targetPackage.schemaName.tableName -->
<property name="enableSubPackages" value="false"/>
<!-- 是否对model添加 构造函数 -->
<property name="constructorBased" value="true"/>
<!-- 是否对类CHAR类型的列的数据进行trim操作 -->
<property name="trimStrings" value="true"/>
<!-- 建立的Model对象是否 不可改变 即生成的Model对象不会有 setter方法,只有构造方法 -->
<property name="immutable" value="false"/>
</javaModelGenerator>
<!--mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
<!--<sqlMapGenerator targetPackage="mappers" targetProject=".\src\main\resources">-->
<sqlMapGenerator targetPackage="mappers" targetProject="./src/main/resources">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口
-->
<!-- targetPackage:mapper接口dao生成的位置 -->
<!--<javaClientGenerator type="XMLMAPPER" targetPackage="com.mmall.dao" targetProject=".\src\main\java">-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.micro.fast.ucenter.dao" targetProject="./src/main/java" >
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<table tableName="ucenter_user_details" domainObjectName="UcenterUserDetails" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_oauth" domainObjectName="UcenterOauth" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user_log" domainObjectName="UcenterUserLog" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user" domainObjectName="UcenterUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="ucenter_user_oauth" domainObjectName="UcenterUserOauth" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
@@ -1,5 +1,5 @@
db.driverLocation=/root/mysql-connector-java-5.1.40-bin.jar
db.driverLocation=E:/lsDev/tools/mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
db.url=jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&amp;chracterEncoding=utf-8&amp;useSSL=false
db.username=root
db.password=studyj2e
@@ -0,0 +1,15 @@
#mybatisGeneratorExtendÅäÖÃÎļþ
db.driverLocation=E:/lsDev/tools/mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
db.username=root
db.password=studyj2e
mybatisGenerator.pojoPackage=com.micro.fast.ucenter.pojo
mybatisGenerator.daoPackage=com.micro.fast.ucenter.dao
mybatisGenerator.tablesPrefix=ucenter
# Éú³Éservice²ãcontroller²ã
mybatisGenerator.servicePackage=com.micro.fast.ucenter.service
mybatisGenerator.controllerPackage=com.micro.fast.ucenter.controller
mybatisGenerator.serviceImplPackage=com.micro.fast.ucenter.service.impl
mybatisGenerator.primaryKeyType=Integer
mybatisGenerator.isOverWrite=false
@@ -1,9 +1,15 @@
#mybatisGeneratorExtendÅäÖÃÎļþ
db.driverLocation=/root/mysql-connector-java-5.1.40-bin.jar
db.driverLocation=E:/lsDev/tools/mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
db.username=root
db.password=studyj2e
mybatisGenerator.pojoPackage=com.micro.fast.upms.pojo
mybatisGenerator.daoPackage=com.micro.fast.upms.dao
mybatisGenerator.tablesPrefix=persistent
mybatisGenerator.tablesPrefix=persistent
# Éú³Éservice²ãcontroller²ã
mybatisGenerator.servicePackage=com.micro.fast.upms.service
mybatisGenerator.controllerPackage=com.micro.fast.upms.controller
mybatisGenerator.serviceImplPackage=com.micro.fast.upms.service.impl
mybatisGenerator.primaryKeyType=Integer
mybatisGenerator.isOverWrite=false