Commit 9d73358e authored by shiyu's avatar shiyu

目录更改

parent 20f6cf05
package com.wwdz.ch.admin.dao;
package com.wwdz.ch.admin.entity;
import java.io.Serializable;
import java.math.BigDecimal;
......
package com.wwdz.ch.admin.dao;
package com.wwdz.ch.admin.entity;
import com.qiniu.util.StringUtils;
import com.wwdz.ch.db.domain.BidRecord;
......
package com.wwdz.ch.admin.dao;
package com.wwdz.ch.admin.entity;
import java.io.Serializable;
import java.util.List;
......
package com.wwdz.ch.admin.dao;
package com.wwdz.ch.admin.entity;
import com.alibaba.druid.support.json.JSONUtils;
import com.wwdz.ch.db.domain.Category;
......
package com.wwdz.ch.admin.dao;
package com.wwdz.ch.admin.entity;
import com.qiniu.util.StringUtils;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.domain.Item;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Objects;
......
package com.wwdz.ch.admin.dao;
package com.wwdz.ch.admin.entity;
import java.io.Serializable;
import java.math.BigDecimal;
......
package com.wwdz.ch.admin.service;
import static com.wwdz.ch.admin.util.AdminResponseCode.GOODS_NAME_EXIST;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -10,8 +7,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.wwdz.ch.admin.dao.ItemVo;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.admin.entity.ItemVo;
import com.wwdz.ch.db.domain.*;
import com.wwdz.ch.db.service.*;
import org.slf4j.Logger;
......@@ -23,8 +19,6 @@ import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.admin.util.AdminResponseUtil;
import com.wwdz.ch.admin.util.CatVo;
import com.wwdz.ch.core.qcode.QCodeService;
import com.wwdz.ch.core.util.ResponseUtil;
......
......@@ -9,8 +9,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import com.wwdz.ch.admin.dao.OrderAmtsVo;
import com.wwdz.ch.admin.dao.UserOrderCntVo;
import com.wwdz.ch.admin.entity.OrderAmtsVo;
import com.wwdz.ch.admin.entity.UserOrderCntVo;
import com.wwdz.ch.admin.util.AuthSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -8,8 +8,7 @@ import java.util.Map;
import javax.validation.constraints.NotNull;
import com.wwdz.ch.admin.annotation.RequiresPermissionsDesc;
import com.wwdz.ch.admin.dao.CategoryVo;
import com.wwdz.ch.admin.dao.ItemVo;
import com.wwdz.ch.admin.entity.ItemVo;
import com.wwdz.ch.admin.service.AdminDataAuthService;
import com.wwdz.ch.admin.service.AdminGoodsService;
import com.wwdz.ch.admin.util.AuthSupport;
......@@ -33,7 +32,6 @@ import com.alibaba.fastjson.JSONObject;
import com.wwdz.ch.core.util.ResponseUtil;
import com.wwdz.ch.core.validator.Order;
import com.wwdz.ch.core.validator.Sort;
import com.wwdz.ch.db.domain.DtsGoods;
@RestController
@RequestMapping("/admin/goods")
......
package com.wwdz.ch.admin.web;
import com.wwdz.ch.admin.dao.BidRecordVo;
import com.wwdz.ch.admin.entity.BidRecordVo;
import com.wwdz.ch.admin.util.AuthSupport;
import com.wwdz.ch.core.type.ListResult;
import com.wwdz.ch.core.type.SimpleResult;
......
......@@ -9,7 +9,7 @@ import java.util.stream.Collectors;
import javax.validation.constraints.NotNull;
import com.wwdz.ch.admin.annotation.RequiresPermissionsDesc;
import com.wwdz.ch.admin.dao.CategoryVo;
import com.wwdz.ch.admin.entity.CategoryVo;
import com.wwdz.ch.admin.util.AuthSupport;
import com.wwdz.ch.core.type.ListResult;
import com.wwdz.ch.db.domain.Category;
......@@ -28,7 +28,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.util.ResponseUtil;
import com.wwdz.ch.core.validator.Order;
import com.wwdz.ch.core.validator.Sort;
......
<?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>
<!--defaultModelType="flat" 大数据字段,不分表 -->
<context id="Mysql" targetRuntime="MyBatis3" defaultModelType="flat">
<property name="autoDelimitKeywords" value="true" />
<property name="beginningDelimiter" value="`" />
<property name="endingDelimiter" value="`" />
<property name="javaFileEncoding" value="utf-8" />
<plugin type="org.mybatis.generator.plugins.SerializablePlugin" />
<plugin type="org.mybatis.generator.plugins.ToStringPlugin" />
<!-- 自动生成equals方法和hashcode方法 -->
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"/>
<!-- 非官方插件 https://github.com/itfsw/mybatis-generator-plugin -->
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin">
<!-- 这里配置的是全局逻辑删除列和逻辑删除值,当然在table中配置的值会覆盖该全局配置 -->
<!-- 逻辑删除列类型只能为数字、字符串或者布尔类型 -->
<property name="logicalDeleteColumn" value="deleted"/>
<!-- 逻辑删除-已删除值 -->
<property name="logicalDeleteValue" value="1"/>
<!-- 逻辑删除-未删除值 -->
<property name="logicalUnDeleteValue" value="0"/>
</plugin>
<plugin type="com.wwdz.ch.db.mybatis.GeneratorPlugin">
</plugin>
<!-- 注释 -->
<!-- 使用自定义的插件 -->
<!-- <commentGenerator type="com.jbp.db.mybatis.MyCommentGenerator">
</commentGenerator>-->
<commentGenerator >
<property name="suppressAllComments" value="true"/>
<property name="suppressDate" value="true" />
</commentGenerator>
<!--数据库链接地址账号密码-->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://pc-bp18q94o1mukb67hy.mysql.polardb.rds.aliyuncs.com:3306/video_dev?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC&amp;verifyServerCertificate=false&amp;useSSL=false"
userId="video_dev"
password="VS1xaA37hyu1wJSw"/>
<!-- 类型转换 -->
<javaTypeResolver>
<!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!--生成Model类存放位置-->
<javaModelGenerator targetPackage="com.wwdz.ch.db.domain" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.wwdz.ch.db.dao" targetProject="src/main/resources"/>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.dao"
targetProject="src/main/java"/>
<table tableName="business_return" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
</context>
</generatorConfiguration>
......@@ -48,6 +48,18 @@
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>4.1.5</version>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version>
</dependency>
</dependencies>
......
package com.wwdz.ch.db.mybatis;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.Field;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.TopLevelClass;
import org.mybatis.generator.internal.util.StringUtility;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* GeneratorPlugin
*
* 生成代码加上lombok注解
*/
public class GeneratorPlugin extends PluginAdapter {
private final static String name = "shiyu";
@Override
public boolean validate(List<String> list) {
return true;
}
@Override
public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
// 添加import
topLevelClass.addImportedType("lombok.Data");
// 添加注解
topLevelClass.addAnnotation("@Data");
if (StringUtility.stringHasValue(introspectedTable.getRemarks())) {
topLevelClass.addJavaDocLine("/**");
topLevelClass.addJavaDocLine(" * " + introspectedTable.getRemarks());
topLevelClass.addJavaDocLine(" *");
topLevelClass.addJavaDocLine(" * @author " + name);
topLevelClass.addJavaDocLine(" * @date " + new SimpleDateFormat("yyyy/MM/dd").format(new Date()));
topLevelClass.addJavaDocLine(" */");
} else {
topLevelClass.addJavaDocLine("/**");
topLevelClass.addJavaDocLine(" * @author " + name);
topLevelClass.addJavaDocLine(" * @date " + new SimpleDateFormat("yyyy/MM/dd").format(new Date()));
topLevelClass.addJavaDocLine(" */");
}
return true;
}
@Override
public boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
field.addJavaDocLine("/**");
field.addJavaDocLine(" * " + introspectedColumn.getRemarks());
field.addJavaDocLine(" */");
}
return true;
}
@Override
public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
// 不生成get方法
return false;
}
@Override
public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
// 不生成set方法
return false;
}
}
package com.wwdz.ch.db.mybatis;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class MyBatisGeneratorRun {
public static void main(String[] args) throws Exception{
MyBatisGeneratorRun app = new MyBatisGeneratorRun();
app.generator();
System.out.println(System.getProperty("user.dir"));
}
public void generator() throws Exception{
List<String> warnings = new ArrayList<String>();
boolean overwrite = true;
InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("mybatis-generator/generatorConfig_new.xml");
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConfiguration(resourceAsStream);
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
myBatisGenerator.generate(null);
for(String warning : warnings){
System.out.println(warning);
}
}
}
package com.wwdz.ch.db.mybatis;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.dom.java.Field;
import org.mybatis.generator.api.dom.java.InnerClass;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.internal.DefaultCommentGenerator;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
public class MyCommentGenerator extends DefaultCommentGenerator {
private Properties properties;
private Properties systemPro;
private boolean suppressDate;
private boolean suppressAllComments;
private String currentDateStr;
public MyCommentGenerator() {
super();
properties = new Properties();
systemPro = System.getProperties();
suppressDate = false;
suppressAllComments = false;
currentDateStr = (new SimpleDateFormat("yyyy-MM-dd")).format(new Date());
}
public void addFieldComment(Field field, IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn) {
if (suppressAllComments) {
return;
}
StringBuilder sb = new StringBuilder();
field.addJavaDocLine("/**");
sb.append(" * ");
sb.append(introspectedColumn.getRemarks());
field.addJavaDocLine(sb.toString().replace("\n", " "));
field.addJavaDocLine(" */");
}
public void addFieldComment(Field field, IntrospectedTable introspectedTable) {
}
public void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable) {
}
public void addGetterComment(Method method, IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn) {
}
public void addSetterComment(Method method, IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn) {
}
public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete) {
}
public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable) {
}
}
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