Commit cd440901 by Mark

更新模板到renren-fast3.0

parent e60b6e65
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.iml
.idea
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
...@@ -32,4 +32,31 @@ longtext=String ...@@ -32,4 +32,31 @@ longtext=String
date=Date date=Date
datetime=Date datetime=Date
timestamp=Date timestamp=Date
\ No newline at end of file
NUMBER=Integer
INT=Integer
INTEGER=Integer
BINARY_INTEGER=Integer
LONG=String
FLOAT=Float
BINARY_FLOAT=Float
DOUBLE=Double
BINARY_DOUBLE=Double
DECIMAL=BigDecimal
CHAR=String
VARCHAR=String
VARCHAR2=String
NVARCHAR=String
NVARCHAR2=String
CLOB=String
BLOB=String
DATE=Date
DATETIME=Date
TIMESTAMP=Date
TIMESTAMP(6)=Date
int8=Long
int4=Integer
int2=Integer
numeric=BigDecimal
\ No newline at end of file
...@@ -49,7 +49,7 @@ public class ${className}Controller { ...@@ -49,7 +49,7 @@ public class ${className}Controller {
@RequestMapping("/info/{${pk.attrname}}") @RequestMapping("/info/{${pk.attrname}}")
@RequiresPermissions("${moduleName}:${pathName}:info") @RequiresPermissions("${moduleName}:${pathName}:info")
public R info(@PathVariable("${pk.attrname}") ${pk.attrType} ${pk.attrname}){ public R info(@PathVariable("${pk.attrname}") ${pk.attrType} ${pk.attrname}){
${className}Entity ${classname} = ${classname}Service.selectById(${pk.attrname}); ${className}Entity ${classname} = ${classname}Service.getById(${pk.attrname});
return R.ok().put("${classname}", ${classname}); return R.ok().put("${classname}", ${classname});
} }
...@@ -60,7 +60,7 @@ public class ${className}Controller { ...@@ -60,7 +60,7 @@ public class ${className}Controller {
@RequestMapping("/save") @RequestMapping("/save")
@RequiresPermissions("${moduleName}:${pathName}:save") @RequiresPermissions("${moduleName}:${pathName}:save")
public R save(@RequestBody ${className}Entity ${classname}){ public R save(@RequestBody ${className}Entity ${classname}){
${classname}Service.insert(${classname}); ${classname}Service.save(${classname});
return R.ok(); return R.ok();
} }
...@@ -71,7 +71,7 @@ public class ${className}Controller { ...@@ -71,7 +71,7 @@ public class ${className}Controller {
@RequestMapping("/update") @RequestMapping("/update")
@RequiresPermissions("${moduleName}:${pathName}:update") @RequiresPermissions("${moduleName}:${pathName}:update")
public R update(@RequestBody ${className}Entity ${classname}){ public R update(@RequestBody ${className}Entity ${classname}){
${classname}Service.updateById(${classname}); ${classname}Service.updateById(${classname});
return R.ok(); return R.ok();
} }
...@@ -82,7 +82,7 @@ public class ${className}Controller { ...@@ -82,7 +82,7 @@ public class ${className}Controller {
@RequestMapping("/delete") @RequestMapping("/delete")
@RequiresPermissions("${moduleName}:${pathName}:delete") @RequiresPermissions("${moduleName}:${pathName}:delete")
public R delete(@RequestBody ${pk.attrType}[] ${pk.attrname}s){ public R delete(@RequestBody ${pk.attrType}[] ${pk.attrname}s){
${classname}Service.deleteBatchIds(Arrays.asList(${pk.attrname}s)); ${classname}Service.removeByIds(Arrays.asList(${pk.attrname}s));
return R.ok(); return R.ok();
} }
......
package ${package}.${moduleName}.dao; package ${package}.${moduleName}.dao;
import ${package}.${moduleName}.entity.${className}Entity; import ${package}.${moduleName}.entity.${className}Entity;
import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
......
package ${package}.${moduleName}.entity; package ${package}.${moduleName}.entity;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotation.TableName;
#if(${hasBigDecimal}) #if(${hasBigDecimal})
import java.math.BigDecimal; import java.math.BigDecimal;
#end #end
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
* ${comments} * ${comments}
...@@ -16,6 +17,7 @@ import java.util.Date; ...@@ -16,6 +17,7 @@ import java.util.Date;
* @email ${email} * @email ${email}
* @date ${datetime} * @date ${datetime}
*/ */
@Data
@TableName("${tableName}") @TableName("${tableName}")
public class ${className}Entity implements Serializable { public class ${className}Entity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -30,18 +32,4 @@ public class ${className}Entity implements Serializable { ...@@ -30,18 +32,4 @@ public class ${className}Entity implements Serializable {
private $column.attrType $column.attrname; private $column.attrType $column.attrname;
#end #end
#foreach ($column in $columns)
/**
* 设置:${column.comments}
*/
public void set${column.attrName}($column.attrType $column.attrname) {
this.$column.attrname = $column.attrname;
}
/**
* 获取:${column.comments}
*/
public $column.attrType get${column.attrName}() {
return $column.attrname;
}
#end
} }
package ${package}.${moduleName}.service; package ${package}.${moduleName}.service;
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import ${mainPath}.common.utils.PageUtils; import ${mainPath}.common.utils.PageUtils;
import ${package}.${moduleName}.entity.${className}Entity; import ${package}.${moduleName}.entity.${className}Entity;
......
...@@ -2,9 +2,9 @@ package ${package}.${moduleName}.service.impl; ...@@ -2,9 +2,9 @@ package ${package}.${moduleName}.service.impl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ${mainPath}.common.utils.PageUtils; import ${mainPath}.common.utils.PageUtils;
import ${mainPath}.common.utils.Query; import ${mainPath}.common.utils.Query;
...@@ -18,12 +18,12 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${clas ...@@ -18,12 +18,12 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${clas
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
Page<${className}Entity> page = this.selectPage( IPage<${className}Entity> page = this.page(
new Query<${className}Entity>(params).getPage(), new Query<${className}Entity>().getPage(params),
new EntityWrapper<${className}Entity>() new QueryWrapper<${className}Entity>()
); );
return new PageUtils(page); return new PageUtils(page);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment