supplier V2.0.0版本发布
This commit is contained in:
1 parent
2b5d2c11ee
commit
d95d3b792a
1011 files changed
+29417
-16989
No files matched your search
@@ -0,0 +1,233 @@
|
||||
<?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>supplier</artifactId>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>supplier-api</artifactId>
|
||||
|
||||
<description>
|
||||
api服务入口
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<mybatisplus-spring-boot-starter.version>1.0.5</mybatisplus-spring-boot-starter.version>
|
||||
<shiro.version>1.4.0</shiro.version>
|
||||
<mybatis-plus.version>2.3</mybatis-plus.version>
|
||||
<fastjson.version>1.2.47</fastjson.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<ehcache.version>3.3.1</ehcache.version>
|
||||
<zxing.version>3.2.1</zxing.version>
|
||||
<druid.version>1.1.20</druid.version>
|
||||
<beetl.version>2.8.5</beetl.version>
|
||||
<swagger.version>2.9.2</swagger.version>
|
||||
<commons-lang3.version>3.7</commons-lang3.version>
|
||||
<ehcache.core.version>2.6.11</ehcache.core.version>
|
||||
<mysql-connector-java.version>8.0.11</mysql-connector-java.version>
|
||||
<jwt.version>0.9.0</jwt.version>
|
||||
<hutool.version>4.1.1</hutool.version>
|
||||
<mapstruct.version>1.3.1.Final</mapstruct.version>
|
||||
<version>3.5.0</version>
|
||||
<mybatis-plus-boot-starter.version>3.2.0</mybatis-plus-boot-starter.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-data-redis</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.commons</groupId>-->
|
||||
<!-- <artifactId>commons-pool2</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>wiki.xsx</groupId>
|
||||
<artifactId>spring-boot-starter-fast-redis</artifactId>
|
||||
<version>1.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||
<version>1.9.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.itmuch.security</groupId>-->
|
||||
<!-- <artifactId>light-security-spring-boot-starter</artifactId>-->
|
||||
<!-- <version>1.0.1-RELEASE</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba</groupId>-->
|
||||
<!-- <artifactId>druid</artifactId>-->
|
||||
<!-- <version>${druid.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql-connector-java.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>shaun-spring-boot-starter</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis-plus-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>${mybatis-plus-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!--mapStruct依赖-->
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>wx-java-pay-spring-boot-starter</artifactId>
|
||||
<version>3.5.4.B</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
|
||||
<version>3.5.5.B</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
|
||||
<repositories>
|
||||
<!--阿里云仓库-->
|
||||
<repository>
|
||||
<id>aliyun</id>
|
||||
<name>aliyun-maven</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>https://maven.aliyun.com/repository/spring</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>central</id>
|
||||
<name>maven-central</name>
|
||||
<url>http://central.maven.org/maven2/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
package co.yixiang;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @author hupeng <610796224@qq.com>
|
||||
*/
|
||||
@SpringBootApplication
|
||||
//@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@MapperScan(basePackages = {"co.yixiang.app.common.persistence.dao","co.yixiang.app.modular.*.dao"})
|
||||
public class ApiApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ApiApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ ========== ლ(´ڡ`ლ)゙ \n" +
|
||||
"\n移动端API启动成功 \n官网:https://www.yixiang.co 提供技术支持゙ \n");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package co.yixiang.app.common;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class R<M> {
|
||||
// 返回状态【0-成功,1-业务失败,999-表示系统异常】
|
||||
@JSONField(ordinal = 1)
|
||||
private int code;
|
||||
// 返回信息
|
||||
@JSONField(ordinal = 2)
|
||||
private String message;
|
||||
// 返回数据实体;
|
||||
@JSONField(ordinal = 3)
|
||||
private M data;
|
||||
|
||||
|
||||
private R(){}
|
||||
|
||||
|
||||
public static<M> R success(M m){
|
||||
R r = new R();
|
||||
r.setCode(0);
|
||||
r.setMessage("success");
|
||||
r.setData(m);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public static<M> R success(String msg){
|
||||
R r = new R();
|
||||
r.setCode(0);
|
||||
r.setMessage(msg);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public static<M> R serviceFail(String msg){
|
||||
R r = new R();
|
||||
r.setCode(1);
|
||||
r.setMessage(msg);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public static<M> R appFail(String msg){
|
||||
R r = new R();
|
||||
r.setCode(999);
|
||||
r.setMessage(msg);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public static<M> R error(int code,String msg){
|
||||
R r = new R();
|
||||
r.setCode(code);
|
||||
r.setMessage(msg);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package co.yixiang.app.common.api;
|
||||
|
||||
|
||||
public enum ApiCode {
|
||||
|
||||
SUCCESS(200, "操作成功"),
|
||||
|
||||
UNAUTHORIZED(401, "非法访问"),
|
||||
|
||||
NOT_PERMISSION(403, "没有权限"),
|
||||
|
||||
NOT_FOUND(404, "你请求的路径不存在"),
|
||||
|
||||
FAIL(500, "操作失败"),
|
||||
|
||||
SYSTEM_EXCEPTION(5000,"系统异常!"),
|
||||
|
||||
PARAMETER_EXCEPTION(5001,"请求参数校验异常"),
|
||||
|
||||
PARAMETER_PARSE_EXCEPTION(5002,"请求参数解析异常"),
|
||||
|
||||
HTTP_MEDIA_TYPE_EXCEPTION(5003,"HTTP Media 类型异常"),
|
||||
|
||||
SYSTEM_LOGIN_EXCEPTION(5005,"系统登录异常")
|
||||
|
||||
;
|
||||
|
||||
private final int code;
|
||||
private final String msg;
|
||||
|
||||
ApiCode(final int code, final String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static ApiCode getApiCode(int code) {
|
||||
ApiCode[] ecs = ApiCode.values();
|
||||
for (ApiCode ec : ecs) {
|
||||
if (ec.getCode() == code) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
package co.yixiang.app.common.api;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class ApiController {
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 请求成功
|
||||
* </p>
|
||||
*
|
||||
* @param data 数据内容
|
||||
* @param <T> 对象泛型
|
||||
* @return
|
||||
*/
|
||||
protected <T> ApiResult<T> ok(T data) {
|
||||
return ApiResult.ok(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 请求失败
|
||||
* </p>
|
||||
*
|
||||
* @param msg 提示内容
|
||||
* @return
|
||||
*/
|
||||
protected ApiResult<Object> fail(String msg) {
|
||||
return ApiResult.fail(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 请求失败
|
||||
* </p>
|
||||
*
|
||||
* @param apiCode 请求错误码
|
||||
* @return
|
||||
*/
|
||||
protected ApiResult<Object> fail(ApiCode apiCode) {
|
||||
return ApiResult.fail(apiCode);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package co.yixiang.app.common.api;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class ApiResult<T> implements Serializable {
|
||||
|
||||
private int code;
|
||||
|
||||
private T data;
|
||||
|
||||
private String msg;
|
||||
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date time;
|
||||
|
||||
public ApiResult() {
|
||||
|
||||
}
|
||||
|
||||
public static ApiResult result(boolean flag){
|
||||
if (flag){
|
||||
return ok();
|
||||
}
|
||||
return fail("");
|
||||
}
|
||||
|
||||
public static ApiResult result(ApiCode apiCode){
|
||||
return result(apiCode,null);
|
||||
}
|
||||
|
||||
public static ApiResult result(ApiCode apiCode,Object data){
|
||||
return result(apiCode,null,data);
|
||||
}
|
||||
|
||||
public static ApiResult result(ApiCode apiCode,String msg,Object data){
|
||||
String message = apiCode.getMsg();
|
||||
if (StringUtils.isNotBlank(msg)){
|
||||
message = msg;
|
||||
}
|
||||
return ApiResult.builder()
|
||||
.code(apiCode.getCode())
|
||||
.msg(message)
|
||||
.data(data)
|
||||
.time(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ApiResult ok(){
|
||||
return ok(null);
|
||||
}
|
||||
|
||||
public static ApiResult ok(Object data){
|
||||
return result(ApiCode.SUCCESS,data);
|
||||
}
|
||||
|
||||
public static ApiResult ok(String key,Object value){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put(key,value);
|
||||
return ok(map);
|
||||
}
|
||||
|
||||
public static ApiResult fail(ApiCode apiCode){
|
||||
return result(apiCode,null);
|
||||
}
|
||||
|
||||
public static ApiResult fail(String msg){
|
||||
return result(ApiCode.FAIL,msg,null);
|
||||
|
||||
}
|
||||
|
||||
public static ApiResult fail(ApiCode apiCode,Object data){
|
||||
if (ApiCode.SUCCESS == apiCode){
|
||||
throw new RuntimeException("失败结果状态码不能为" + ApiCode.SUCCESS.getCode());
|
||||
}
|
||||
return result(apiCode,data);
|
||||
|
||||
}
|
||||
|
||||
public static ApiResult fail(String key,Object value){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put(key,value);
|
||||
return result(ApiCode.FAIL,map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package co.yixiang.app.common.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.api.IErrorCode;
|
||||
import com.baomidou.mybatisplus.extension.exceptions.ApiException;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class Assert {
|
||||
|
||||
protected Assert() {
|
||||
// to do noting
|
||||
}
|
||||
|
||||
/**
|
||||
* 大于O
|
||||
*/
|
||||
public static void gtZero(Integer num, IErrorCode errorCode) {
|
||||
if (num == null || num <= 0) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 大于等于O
|
||||
*/
|
||||
public static void geZero(Integer num, IErrorCode errorCode) {
|
||||
if (num == null || num < 0) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* num1大于num2
|
||||
*/
|
||||
public static void gt(Integer num1, Integer num2, IErrorCode errorCode) {
|
||||
if (num1 <= num2) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* num1大于等于num2
|
||||
*/
|
||||
public static void ge(Integer num1, Integer num2, IErrorCode errorCode) {
|
||||
if (num1 < num2) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* obj1 eq obj2
|
||||
*/
|
||||
public static void eq(Object obj1, Object obj2, IErrorCode errorCode) {
|
||||
if (!obj1.equals(obj2)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isTrue(boolean condition, IErrorCode errorCode) {
|
||||
if (!condition) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isFalse(boolean condition, IErrorCode errorCode) {
|
||||
if (condition) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isNull(IErrorCode errorCode, Object... conditions) {
|
||||
if (ObjectUtils.isNotNull(conditions)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notNull(IErrorCode errorCode, Object... conditions) {
|
||||
if (ObjectUtils.isNull(conditions)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 失败结果
|
||||
* </p>
|
||||
*
|
||||
* @param errorCode 异常错误码
|
||||
*/
|
||||
public static void fail(IErrorCode errorCode) {
|
||||
throw new ApiException(errorCode);
|
||||
}
|
||||
|
||||
public static void fail(boolean condition, IErrorCode errorCode) {
|
||||
if (condition) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void fail(String message) {
|
||||
throw new ApiException(message);
|
||||
}
|
||||
|
||||
public static void fail(boolean condition, String message) {
|
||||
if (condition) {
|
||||
Assert.fail(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEmpty(Object[] array, IErrorCode errorCode) {
|
||||
if (ObjectUtils.isEmpty(array)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void noNullElements(Object[] array, IErrorCode errorCode) {
|
||||
if (array != null) {
|
||||
for (Object element : array) {
|
||||
if (element == null) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEmpty(Collection<?> collection, IErrorCode errorCode) {
|
||||
if (CollectionUtils.isNotEmpty(collection)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEmpty(Map<?, ?> map, IErrorCode errorCode) {
|
||||
if (ObjectUtils.isEmpty(map)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isInstanceOf(Class<?> type, Object obj, IErrorCode errorCode) {
|
||||
Assert.notNull(errorCode, type);
|
||||
if (!type.isInstance(obj)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isAssignable(Class<?> superType, Class<?> subType, IErrorCode errorCode) {
|
||||
Assert.notNull(errorCode, superType);
|
||||
if (subType == null || !superType.isAssignableFrom(subType)) {
|
||||
Assert.fail(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package co.yixiang.app.common.config;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import co.yixiang.app.common.config.properties.DruidProperties;
|
||||
//import co.yixiang.common.enums.DataSourceType;
|
||||
//import co.yixiang.framework.datasource.DynamicDataSource;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.sql.DataSource;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* druid 配置多数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidConfig
|
||||
{
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.datasource.druid.master")
|
||||
public DataSource masterDataSource(DruidProperties druidProperties)
|
||||
{
|
||||
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
return druidProperties.dataSource(dataSource);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.datasource.druid.slave")
|
||||
@ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
|
||||
public DataSource slaveDataSource(DruidProperties druidProperties)
|
||||
{
|
||||
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
return druidProperties.dataSource(dataSource);
|
||||
}
|
||||
|
||||
// @Bean(name = "dynamicDataSource")
|
||||
// @Primary
|
||||
// public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource)
|
||||
// {
|
||||
// Map<Object, Object> targetDataSources = new HashMap<>();
|
||||
// targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
||||
// targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
|
||||
// return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 去除监控页面底部的广告
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
|
||||
public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
|
||||
{
|
||||
// 获取web监控页面的参数
|
||||
DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
|
||||
// 提取common.js的配置路径
|
||||
String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
|
||||
String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
|
||||
final String filePath = "support/http/resources/js/common.js";
|
||||
// 创建filter进行过滤
|
||||
Filter filter = new Filter()
|
||||
{
|
||||
@Override
|
||||
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException
|
||||
{
|
||||
chain.doFilter(request, response);
|
||||
// 重置缓冲区,响应头不会被重置
|
||||
response.resetBuffer();
|
||||
// 获取common.js
|
||||
String text = Utils.readFromResource(filePath);
|
||||
// 正则替换banner, 除去底部的广告信息
|
||||
text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
||||
text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
||||
response.getWriter().write(text);
|
||||
}
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
}
|
||||
};
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(filter);
|
||||
registrationBean.addUrlPatterns(commonJsPattern);
|
||||
return registrationBean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package co.yixiang.app.common.config;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* MybatisPlus配置
|
||||
*
|
||||
*/
|
||||
@Configuration
|
||||
//@MapperScan(basePackages = {"co.yixiang.app.common.persistence.dao"})
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* mybatis-plus分页插件
|
||||
*/
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
//package co.yixiang.app.common.config;
|
||||
//
|
||||
//import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
//import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
//import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
//import org.springframework.cache.CacheManager;
|
||||
//import org.springframework.cache.annotation.CachingConfigurerSupport;
|
||||
//import org.springframework.cache.annotation.EnableCaching;
|
||||
//import org.springframework.cache.interceptor.KeyGenerator;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
//import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
//import org.springframework.data.redis.cache.RedisCacheWriter;
|
||||
//import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
//import org.springframework.data.redis.core.RedisTemplate;
|
||||
//import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
//import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
//import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.lang.reflect.Method;
|
||||
//import java.time.Duration;
|
||||
//
|
||||
///**
|
||||
// * @ClassName RedisConfig
|
||||
// * @Author hupeng <610796224@qq.com>
|
||||
// * @Date 2019/6/27
|
||||
// *
|
||||
// * 已经使用其他redis工具类,此地方配置的bean注释掉
|
||||
// **/
|
||||
//@Configuration
|
||||
//@EnableCaching // 开启缓存支持
|
||||
//public class RedisConfig extends CachingConfigurerSupport {
|
||||
// //@Resource
|
||||
// private LettuceConnectionFactory lettuceConnectionFactory;
|
||||
//
|
||||
// /**
|
||||
// * @description 自定义的缓存key的生成策略 若想使用这个key
|
||||
// * 只需要讲注解上keyGenerator的值设置为keyGenerator即可</br>
|
||||
// * @return 自定义策略生成的key
|
||||
// */
|
||||
// // @Bean
|
||||
// public KeyGenerator keyGenerator() {
|
||||
// return new KeyGenerator() {
|
||||
// @Override
|
||||
// public Object generate(Object target, Method method, Object... params) {
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
// sb.append(target.getClass().getName());
|
||||
// sb.append(method.getName());
|
||||
// for (Object obj : params) {
|
||||
// sb.append(obj.toString());
|
||||
// }
|
||||
// return sb.toString();
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * RedisTemplate配置
|
||||
// */
|
||||
// //@Bean
|
||||
// public RedisTemplate<String, Object> redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {
|
||||
// // 设置序列化
|
||||
// Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<Object>(Object.class);
|
||||
// ObjectMapper om = new ObjectMapper();
|
||||
// om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||
// om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
||||
// jackson2JsonRedisSerializer.setObjectMapper(om);
|
||||
// // 配置redisTemplate
|
||||
// RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
// redisTemplate.setConnectionFactory(lettuceConnectionFactory);
|
||||
// RedisSerializer<?> stringSerializer = new StringRedisSerializer();
|
||||
// redisTemplate.setKeySerializer(stringSerializer);// key序列化
|
||||
// redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);// value序列化
|
||||
// redisTemplate.setHashKeySerializer(stringSerializer);// Hash key序列化
|
||||
// redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);// Hash value序列化
|
||||
// redisTemplate.afterPropertiesSet();
|
||||
// return redisTemplate;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 缓存配置管理器
|
||||
// */
|
||||
// //@Bean
|
||||
// public CacheManager cacheManager(LettuceConnectionFactory factory) {
|
||||
// // 以锁写入的方式创建RedisCacheWriter对象
|
||||
// RedisCacheWriter writer = RedisCacheWriter.lockingRedisCacheWriter(factory);
|
||||
// /**
|
||||
// * 设置CacheManager的Value序列化方式为JdkSerializationRedisSerializer,
|
||||
// * 但其实RedisCacheConfiguration默认就是使用 StringRedisSerializer序列化key,
|
||||
// * JdkSerializationRedisSerializer序列化value, 所以以下注释代码就是默认实现,没必要写,直接注释掉
|
||||
// */
|
||||
// // RedisSerializationContext.SerializationPair pair =
|
||||
// // RedisSerializationContext.SerializationPair.fromSerializer(new
|
||||
// // JdkSerializationRedisSerializer(this.getClass().getClassLoader()));
|
||||
// // RedisCacheConfiguration config =
|
||||
// // RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair);
|
||||
// // 创建默认缓存配置对象
|
||||
// RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofHours(1)); // 设置缓存有效期一小时;
|
||||
// RedisCacheManager cacheManager = new RedisCacheManager(writer, config);
|
||||
// return cacheManager;
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,41 @@
|
||||
package co.yixiang.app.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* @ClassName SwaggerConfiguration
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/28
|
||||
**/
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfiguration {
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("co.yixiang.app.modular"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("供货商城API")
|
||||
.description("供货商城API")
|
||||
.termsOfServiceUrl("http://localhost:8009/")
|
||||
.contact("610896224@qq.com")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package co.yixiang.app.common.config.properties;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* druid 配置属性
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidProperties
|
||||
{
|
||||
@Value("${spring.datasource.druid.initialSize}")
|
||||
private int initialSize;
|
||||
|
||||
@Value("${spring.datasource.druid.minIdle}")
|
||||
private int minIdle;
|
||||
|
||||
@Value("${spring.datasource.druid.maxActive}")
|
||||
private int maxActive;
|
||||
|
||||
@Value("${spring.datasource.druid.maxWait}")
|
||||
private int maxWait;
|
||||
|
||||
@Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
|
||||
private int timeBetweenEvictionRunsMillis;
|
||||
|
||||
@Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
|
||||
private int minEvictableIdleTimeMillis;
|
||||
|
||||
@Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
|
||||
private int maxEvictableIdleTimeMillis;
|
||||
|
||||
@Value("${spring.datasource.druid.validationQuery}")
|
||||
private String validationQuery;
|
||||
|
||||
@Value("${spring.datasource.druid.testWhileIdle}")
|
||||
private boolean testWhileIdle;
|
||||
|
||||
@Value("${spring.datasource.druid.testOnBorrow}")
|
||||
private boolean testOnBorrow;
|
||||
|
||||
@Value("${spring.datasource.druid.testOnReturn}")
|
||||
private boolean testOnReturn;
|
||||
|
||||
public DruidDataSource dataSource(DruidDataSource datasource)
|
||||
{
|
||||
/** 配置初始化大小、最小、最大 */
|
||||
datasource.setInitialSize(initialSize);
|
||||
datasource.setMaxActive(maxActive);
|
||||
datasource.setMinIdle(minIdle);
|
||||
|
||||
/** 配置获取连接等待超时的时间 */
|
||||
datasource.setMaxWait(maxWait);
|
||||
|
||||
/** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
|
||||
datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
||||
|
||||
/** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
|
||||
datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
|
||||
datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
|
||||
|
||||
/**
|
||||
* 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
|
||||
*/
|
||||
datasource.setValidationQuery(validationQuery);
|
||||
/** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
|
||||
datasource.setTestWhileIdle(testWhileIdle);
|
||||
/** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||
datasource.setTestOnBorrow(testOnBorrow);
|
||||
/** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
|
||||
datasource.setTestOnReturn(testOnReturn);
|
||||
return datasource;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package co.yixiang.app.common.constant;
|
||||
|
||||
|
||||
public interface CacheKey {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package co.yixiang.app.common.constant;
|
||||
|
||||
|
||||
public interface CommonConstant {
|
||||
|
||||
/**
|
||||
* 默认页码为1
|
||||
*/
|
||||
Integer DEFAULT_PAGE_INDEX = 1;
|
||||
|
||||
/**
|
||||
* 默认页大小为10
|
||||
*/
|
||||
Integer DEFAULT_PAGE_SIZE = 10;
|
||||
|
||||
/**
|
||||
* 登录用户
|
||||
*/
|
||||
String LOGIN_SYS_USER = "loginSysUser";
|
||||
|
||||
/**
|
||||
* 登陆token
|
||||
*/
|
||||
String TOKEN = "token";
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
String REFRESH_TOKEN = "refresh_token";
|
||||
|
||||
/**
|
||||
* 初始密码
|
||||
*/
|
||||
String INIT_PWD = "123456";
|
||||
|
||||
/**
|
||||
* 默认头像
|
||||
*/
|
||||
String DEFAULT_HEAD_URL = "";
|
||||
|
||||
/**
|
||||
* 管理员角色名称
|
||||
*/
|
||||
String ADMIN_ROLE_NAME = "管理员";
|
||||
|
||||
String ADMIN_LOGIN = "adminLogin";
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package co.yixiang.app.common.constant;
|
||||
|
||||
public interface CommonRedisKey {
|
||||
|
||||
/**
|
||||
* 系统登录用户
|
||||
*/
|
||||
String LOGIN_SYS_USER = "login:sys:user:%s";
|
||||
/**
|
||||
* 系统登录token
|
||||
*/
|
||||
String LOGIN_TOKEN = "login:token";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package co.yixiang.app.common.constant;
|
||||
|
||||
|
||||
public interface DatePattern {
|
||||
|
||||
/**
|
||||
* 年-月-日
|
||||
*/
|
||||
String yyyy_MM_dd = "yyyy-MM-dd";
|
||||
/**
|
||||
* 年-月-日 时:分
|
||||
*/
|
||||
String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
|
||||
/**
|
||||
* 年-月-日 时:分:秒
|
||||
*/
|
||||
String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
|
||||
/**
|
||||
* 年-月-日 时:分:秒:毫秒
|
||||
*/
|
||||
String yyyy_MM_dd_HH_mm_ss_S = "yyyy-MM-dd HH:mm:ss.S";
|
||||
|
||||
/**
|
||||
* 时:分
|
||||
*/
|
||||
String HH_mm = "HH:mm";
|
||||
/**
|
||||
* 时:分:秒
|
||||
*/
|
||||
String HH_mm_ss = "HH:mm:ss";
|
||||
/**
|
||||
* 时:分:秒:毫秒
|
||||
*/
|
||||
String HH_mm_ss_S = "HH:mm:ss:S";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package co.yixiang.app.common.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@ApiModel("BaseEntity")
|
||||
public abstract class BaseEntity implements Serializable{
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package co.yixiang.app.common.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
|
||||
/**
|
||||
* @ClassName 自定义异常
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
@Getter
|
||||
public class BadRequestException extends RuntimeException{
|
||||
|
||||
private Integer status = BAD_REQUEST.value();
|
||||
|
||||
public BadRequestException(String msg){
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public BadRequestException(HttpStatus status,String msg){
|
||||
super(msg);
|
||||
this.status = status.value();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package co.yixiang.app.common.exception;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* @ClassName 自定义异常
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
public class EntityExistException extends RuntimeException {
|
||||
|
||||
public EntityExistException(Class clazz, Object... saveBodyParamsMap) {
|
||||
super(EntityExistException.generateMessage(clazz.getSimpleName(), toMap(String.class, String.class, saveBodyParamsMap)));
|
||||
}
|
||||
|
||||
private static String generateMessage(String entity, Map<String, String> saveBodyParams) {
|
||||
return StringUtils.capitalize(entity) +
|
||||
" 已存在 " +
|
||||
saveBodyParams;
|
||||
}
|
||||
|
||||
private static <K, V> Map<K, V> toMap(
|
||||
Class<K> keyType, Class<V> valueType, Object... entries) {
|
||||
if (entries.length % 2 == 1)
|
||||
throw new IllegalArgumentException("Invalid entries");
|
||||
return IntStream.range(0, entries.length / 2).map(i -> i * 2)
|
||||
.collect(HashMap::new,
|
||||
(m, i) -> m.put(keyType.cast(entries[i]), valueType.cast(entries[i + 1])),
|
||||
Map::putAll);
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
package co.yixiang.app.common.exception;
|
||||
|
||||
|
||||
import co.yixiang.app.common.R;
|
||||
import co.yixiang.app.common.utils.ThrowableUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.pac4j.core.exception.http.ForbiddenAction;
|
||||
import org.pac4j.core.exception.http.UnauthorizedAction;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName 全局异常处理
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
@Slf4j
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
/**
|
||||
* UnauthorizedAction相关异常
|
||||
*
|
||||
* @param exception 异常
|
||||
* @return 发生异常时的返回
|
||||
*/
|
||||
@ExceptionHandler(value = {UnauthorizedAction.class})
|
||||
@ResponseStatus(HttpStatus.UNAUTHORIZED)
|
||||
@ResponseBody
|
||||
public R error(UnauthorizedAction exception) {
|
||||
return R.error(401, "未授权");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* UnauthorizedAction相关异常
|
||||
*
|
||||
* @param exception 异常
|
||||
* @return 发生异常时的返回
|
||||
*/
|
||||
@ExceptionHandler(value = {ForbiddenAction.class})
|
||||
@ResponseStatus(HttpStatus.FORBIDDEN)
|
||||
@ResponseBody
|
||||
public R error(ForbiddenAction exception) {
|
||||
return R.error(403, "无权限");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @ExceptionHandler(value = {Exception.class})
|
||||
// @ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
// @ResponseBody
|
||||
// public R allError(Exception exception) {
|
||||
// return R.error(4000,exception.getMessage());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 处理所有接口数据验证异常
|
||||
* @param e
|
||||
* @returns
|
||||
*/
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
@ResponseBody
|
||||
public R handleMethodArgumentNotValidException(MethodArgumentNotValidException e){
|
||||
String[] str = e.getBindingResult().getAllErrors().get(0).getCodes()[1].split("\\.");
|
||||
StringBuffer msg = new StringBuffer(str[1]+":");
|
||||
msg.append(e.getBindingResult().getAllErrors().get(0).getDefaultMessage());
|
||||
return R.error(4001,msg.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理自定义异常
|
||||
* @param e
|
||||
* @return
|
||||
*/
|
||||
@ExceptionHandler(value = BadRequestException.class)
|
||||
public R badRequestException(BadRequestException e) {
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
return R.error(4002,e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理 EntityExist
|
||||
* @param e
|
||||
* @return
|
||||
*/
|
||||
@ExceptionHandler(value = EntityExistException.class)
|
||||
public R entityExistException(EntityExistException e) {
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
return R.error(4003,e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package co.yixiang.app.common.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName MyMetaHandler
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/9/10
|
||||
**/
|
||||
@Component
|
||||
public class MyMetaHandler implements MetaObjectHandler {
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
this.setFieldValByName("addTime", new Date(), metaObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.common.persistence.model.StoreAds;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 首页轮播广告 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface StoreAdsMapper extends BaseMapper<StoreAds> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreCart;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-10
|
||||
*/
|
||||
public interface StoreCartMapper extends BaseMapper<StoreCart> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreComment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品评论表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-15
|
||||
*/
|
||||
public interface StoreCommentMapper extends BaseMapper<StoreComment> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreCouponList;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 优惠券记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
public interface StoreCouponListMapper extends BaseMapper<StoreCouponList> {
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreCoupon;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.modular.shop.service.dto.CouponDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 优惠券主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
public interface StoreCouponMapper extends BaseMapper<StoreCoupon> {
|
||||
|
||||
@Select("select s.id,c.money from store_coupon_list s left join store_coupon c " +
|
||||
"on s.cid=c.id where s.id=#{id}")
|
||||
CouponDTO findLog(int id);
|
||||
|
||||
@Update("update store_coupon set use_num=use_num+1 where id=#{id}")
|
||||
void incUserNum(int id);
|
||||
|
||||
@Select("<script>select s.id,c.money,c.name,c.condition,c.use_end_time as useEndTime from store_coupon_list s left join store_coupon c " +
|
||||
"on s.cid=c.id where s.uid=#{userId} and s.status=0" +
|
||||
" <if test='orderTotalPrice > 0'>and c.condition <![CDATA[<= ]]> #{orderTotalPrice}</if>" +
|
||||
" and c.use_start_time <![CDATA[<= ]]> now() and c.use_end_time <![CDATA[>= ]]> now()</script>")
|
||||
List<CouponDTO> couponList(@Param("userId") int userId,
|
||||
@Param("orderTotalPrice") double orderTotalPrice);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.common.persistence.model.StoreGoodsAttr;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品关联的属性表(与商品相关) Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
public interface StoreGoodsAttrMapper extends BaseMapper<StoreGoodsAttr> {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.common.persistence.model.StoreGoodsAttribute;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品的属性表(独立) Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
public interface StoreGoodsAttributeMapper extends BaseMapper<StoreGoodsAttribute> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreGoodsCate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商城商品分类 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-08
|
||||
*/
|
||||
public interface StoreGoodsCateMapper extends BaseMapper<StoreGoodsCate> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.common.persistence.model.StoreGoodsCollect;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品收藏表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface StoreGoodsCollectMapper extends BaseMapper<StoreGoodsCollect> {
|
||||
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import co.yixiang.app.common.persistence.model.StoreGoods;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface StoreGoodsMapper extends BaseMapper<StoreGoods> {
|
||||
|
||||
@Results({
|
||||
@Result(property = "goodsId",column = "goods_id"),
|
||||
@Result(property = "goodsName",column = "goods_name"),
|
||||
@Result(property = "goodsSn",column = "goods_sn"),
|
||||
@Result(property = "goodsLogo",column = "goods_logo"),
|
||||
@Result(property = "shopPrice",column = "shop_price"),
|
||||
@Result(property = "marketPrice",column = "market_price")
|
||||
})
|
||||
@Select("select g.* from store_goods_collect c left join store_goods g " +
|
||||
"on c.goods_id=g.goods_id where c.user_id=#{userId}")
|
||||
List<StoreGoods> collectGoods(Page page, @Param("userId") int userId);
|
||||
|
||||
|
||||
@Update("update store_goods set sales_sum=sales_sum+#{goodsNum} " +
|
||||
"where goods_id=#{goodsId}")
|
||||
int incSaleNum(@Param("goodsId") int goodsId,
|
||||
@Param("goodsNum") int goodsNum);
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreMemberAddress;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商城会员收货地址 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
public interface StoreMemberAddressMapper extends BaseMapper<StoreMemberAddress> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.common.persistence.model.StoreMember;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface StoreMemberMapper extends BaseMapper<StoreMember> {
|
||||
@Update("update store_member set user_money=user_money-#{money} where id=#{userId}")
|
||||
int decUserMony(@Param("userId") int userId,@Param("money") double money);
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreOrderGoods;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单商品表与订单主表关联 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
public interface StoreOrderGoodsMapper extends BaseMapper<StoreOrderGoods> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreOrder;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-06-26
|
||||
*/
|
||||
public interface StoreOrderMapper extends BaseMapper<StoreOrder> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StorePointsMoneyLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 积分/余额日志(流水)表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-15
|
||||
*/
|
||||
public interface StorePointsMoneyLogMapper extends BaseMapper<StorePointsMoneyLog> {
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreSpecGoodsPrice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.modular.shop.service.dto.ItemDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品规格关联价格表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
public interface StoreSpecGoodsPriceMapper extends BaseMapper<StoreSpecGoodsPrice> {
|
||||
|
||||
@Select("select GROUP_CONCAT(`key` ORDER BY store_count desc SEPARATOR '_') as keystr" +
|
||||
" from store_spec_goods_price where goods_id=#{goodsId}")
|
||||
String goodsSpecKey(int goodsId);
|
||||
|
||||
@Select("<script> SELECT a.name,b.id,b.spec_id as specId,b.item FROM store_spec AS a " +
|
||||
"INNER JOIN store_spec_item AS b ON a.id = b.spec_id " +
|
||||
"WHERE b.id IN " +
|
||||
"<foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>" +
|
||||
"ORDER BY b.id </script>")
|
||||
List<ItemDTO> goodsSpec(List<String> keys);
|
||||
|
||||
@Update("update store_spec_goods_price set store_count=store_count-#{goodsNum} " +
|
||||
"where goods_id=#{goodsId} and `key`=#{specKey}")
|
||||
int decCount(@Param("goodsId") int goodsId,
|
||||
@Param("specKey") String specKey,@Param("goodsNum") int goodsNum);
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreSpecItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规格项 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
public interface StoreSpecItemMapper extends BaseMapper<StoreSpecItem> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreSpec;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品规格表(独立) Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
public interface StoreSpecMapper extends BaseMapper<StoreSpec> {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package co.yixiang.app.common.persistence.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.app.common.persistence.model.WechatNewsArticle;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 微信素材表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-05
|
||||
*/
|
||||
public interface WechatNewsArticleMapper extends BaseMapper<WechatNewsArticle> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreAdsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreAds">
|
||||
<id column="id" property="id" />
|
||||
<result column="video_url" property="videoUrl" />
|
||||
<result column="url" property="url" />
|
||||
<result column="type" property="type" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreCartMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreCart">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="session_id" property="sessionId" />
|
||||
<result column="goods_id" property="goodsId" />
|
||||
<result column="goods_sn" property="goodsSn" />
|
||||
<result column="goods_name" property="goodsName" />
|
||||
<result column="market_price" property="marketPrice" />
|
||||
<result column="goods_price" property="goodsPrice" />
|
||||
<result column="member_goods_price" property="memberGoodsPrice" />
|
||||
<result column="goods_num" property="goodsNum" />
|
||||
<result column="spec_key" property="specKey" />
|
||||
<result column="spec_key_name" property="specKeyName" />
|
||||
<result column="bar_code" property="barCode" />
|
||||
<result column="selected" property="selected" />
|
||||
<result column="add_time" property="addTime" />
|
||||
<result column="prom_type" property="promType" />
|
||||
<result column="prom_id" property="promId" />
|
||||
<result column="sku" property="sku" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreCommentMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreComment">
|
||||
<id column="comment_id" property="commentId" />
|
||||
<result column="goods_id" property="goodsId" />
|
||||
<result column="email" property="email" />
|
||||
<result column="username" property="username" />
|
||||
<result column="content" property="content" />
|
||||
<result column="add_time" property="addTime" />
|
||||
<result column="ip_address" property="ipAddress" />
|
||||
<result column="is_show" property="isShow" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="img" property="img" />
|
||||
<result column="order_id" property="orderId" />
|
||||
<result column="deliver_rank" property="deliverRank" />
|
||||
<result column="goods_rank" property="goodsRank" />
|
||||
<result column="service_rank" property="serviceRank" />
|
||||
<result column="zan_num" property="zanNum" />
|
||||
<result column="zan_userid" property="zanUserid" />
|
||||
<result column="is_anonymous" property="isAnonymous" />
|
||||
<result column="rec_id" property="recId" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreCouponListMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreCouponList">
|
||||
<id column="id" property="id" />
|
||||
<result column="cid" property="cid" />
|
||||
<result column="type" property="type" />
|
||||
<result column="uid" property="uid" />
|
||||
<result column="order_id" property="orderId" />
|
||||
<result column="get_order_id" property="getOrderId" />
|
||||
<result column="use_time" property="useTime" />
|
||||
<result column="code" property="code" />
|
||||
<result column="send_time" property="sendTime" />
|
||||
<result column="status" property="status" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreCouponMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreCoupon">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="type" property="type" />
|
||||
<result column="money" property="money" />
|
||||
<result column="condition" property="condition" />
|
||||
<result column="createnum" property="createnum" />
|
||||
<result column="send_num" property="sendNum" />
|
||||
<result column="use_num" property="useNum" />
|
||||
<result column="send_start_time" property="sendStartTime" />
|
||||
<result column="send_end_time" property="sendEndTime" />
|
||||
<result column="use_start_time" property="useStartTime" />
|
||||
<result column="use_end_time" property="useEndTime" />
|
||||
<result column="add_time" property="addTime" />
|
||||
<result column="status" property="status" />
|
||||
<result column="use_type" property="useType" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreGoodsAttrMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreGoodsAttr">
|
||||
<id column="goods_attr_id" property="goodsAttrId" />
|
||||
<result column="goods_id" property="goodsId" />
|
||||
<result column="attr_id" property="attrId" />
|
||||
<result column="attr_value" property="attrValue" />
|
||||
<result column="attr_price" property="attrPrice" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreGoodsAttributeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreGoodsAttribute">
|
||||
<id column="attr_id" property="attrId" />
|
||||
<result column="attr_name" property="attrName" />
|
||||
<result column="type_id" property="typeId" />
|
||||
<result column="attr_index" property="attrIndex" />
|
||||
<result column="attr_type" property="attrType" />
|
||||
<result column="attr_input_type" property="attrInputType" />
|
||||
<result column="attr_values" property="attrValues" />
|
||||
<result column="sort" property="sort" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreGoodsCateMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreGoodsCate">
|
||||
<id column="id" property="id" />
|
||||
<result column="pid" property="pid" />
|
||||
<result column="brand_id" property="brandId" />
|
||||
<result column="cate_title" property="cateTitle" />
|
||||
<result column="cate_desc" property="cateDesc" />
|
||||
<result column="img_url" property="imgUrl" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="status" property="status" />
|
||||
<result column="is_deleted" property="isDeleted" />
|
||||
<result column="create_at" property="createAt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreGoodsCollectMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreGoodsCollect">
|
||||
<id column="collect_id" property="collectId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="goods_id" property="goodsId" />
|
||||
<result column="add_time" property="addTime" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreGoodsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreGoods">
|
||||
<id column="goods_id" property="goodsId" />
|
||||
<result column="cate_id" property="cateId" />
|
||||
<result column="extend_cat_id" property="extendCatId" />
|
||||
<result column="goods_sn" property="goodsSn" />
|
||||
<result column="goods_name" property="goodsName" />
|
||||
<result column="click_count" property="clickCount" />
|
||||
<result column="brand_id" property="brandId" />
|
||||
<result column="store_count" property="storeCount" />
|
||||
<result column="comment_count" property="commentCount" />
|
||||
<result column="weight" property="weight" />
|
||||
<result column="volume" property="volume" />
|
||||
<result column="market_price" property="marketPrice" />
|
||||
<result column="shop_price" property="shopPrice" />
|
||||
<result column="cost_price" property="costPrice" />
|
||||
<result column="price_ladder" property="priceLadder" />
|
||||
<result column="keywords" property="keywords" />
|
||||
<result column="goods_remark" property="goodsRemark" />
|
||||
<result column="goods_content" property="goodsContent" />
|
||||
<result column="mobile_content" property="mobileContent" />
|
||||
<result column="goods_logo" property="goodsLogo" />
|
||||
<result column="is_virtual" property="isVirtual" />
|
||||
<result column="virtual_indate" property="virtualIndate" />
|
||||
<result column="virtual_limit" property="virtualLimit" />
|
||||
<result column="virtual_refund" property="virtualRefund" />
|
||||
<result column="is_on_sale" property="isOnSale" />
|
||||
<result column="is_free_shipping" property="isFreeShipping" />
|
||||
<result column="on_time" property="onTime" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="is_recommend" property="isRecommend" />
|
||||
<result column="is_new" property="isNew" />
|
||||
<result column="is_hot" property="isHot" />
|
||||
<result column="last_update" property="lastUpdate" />
|
||||
<result column="goods_type" property="goodsType" />
|
||||
<result column="spec_type" property="specType" />
|
||||
<result column="give_integral" property="giveIntegral" />
|
||||
<result column="exchange_integral" property="exchangeIntegral" />
|
||||
<result column="suppliers_id" property="suppliersId" />
|
||||
<result column="sales_sum" property="salesSum" />
|
||||
<result column="prom_type" property="promType" />
|
||||
<result column="prom_id" property="promId" />
|
||||
<result column="commission" property="commission" />
|
||||
<result column="spu" property="spu" />
|
||||
<result column="sku" property="sku" />
|
||||
<result column="template_id" property="templateId" />
|
||||
<result column="goods_video" property="goodsVideo" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreMemberAddressMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreMemberAddress">
|
||||
<id column="id" property="id" />
|
||||
<result column="mid" property="mid" />
|
||||
<result column="username" property="username" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="province" property="province" />
|
||||
<result column="city" property="city" />
|
||||
<result column="area" property="area" />
|
||||
<result column="city_info" property="cityInfo" />
|
||||
<result column="address" property="address" />
|
||||
<result column="status" property="status" />
|
||||
<result column="is_default" property="isDefault" />
|
||||
<result column="is_deleted" property="isDeleted" />
|
||||
<result column="create_at" property="createAt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreMemberMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreMember">
|
||||
<id column="id" property="id" />
|
||||
<result column="vip_no" property="vipNo" />
|
||||
<result column="openid" property="openid" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="password" property="password" />
|
||||
<result column="nickname" property="nickname" />
|
||||
<result column="headimg" property="headimg" />
|
||||
<result column="sex" property="sex" />
|
||||
<result column="level" property="level" />
|
||||
<result column="total_amount" property="totalAmount" />
|
||||
<result column="user_money" property="userMoney" />
|
||||
<result column="distribut_money" property="distributMoney" />
|
||||
<result column="frozen_money" property="frozenMoney" />
|
||||
<result column="underling_number" property="underlingNumber" />
|
||||
<result column="pay_points" property="payPoints" />
|
||||
<result column="address_id" property="addressId" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="status" property="status" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="create_at" property="createAt" />
|
||||
<result column="status_time" property="statusTime" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreOrderGoodsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreOrderGoods">
|
||||
<id column="rec_id" property="recId" />
|
||||
<result column="order_id" property="orderId" />
|
||||
<result column="goods_id" property="goodsId" />
|
||||
<result column="goods_name" property="goodsName" />
|
||||
<result column="goods_sn" property="goodsSn" />
|
||||
<result column="goods_num" property="goodsNum" />
|
||||
<result column="market_price" property="marketPrice" />
|
||||
<result column="goods_price" property="goodsPrice" />
|
||||
<result column="cost_price" property="costPrice" />
|
||||
<result column="member_goods_price" property="memberGoodsPrice" />
|
||||
<result column="give_integral" property="giveIntegral" />
|
||||
<result column="spec_key" property="specKey" />
|
||||
<result column="spec_key_name" property="specKeyName" />
|
||||
<result column="bar_code" property="barCode" />
|
||||
<result column="is_comment" property="isComment" />
|
||||
<result column="prom_type" property="promType" />
|
||||
<result column="prom_id" property="promId" />
|
||||
<result column="is_send" property="isSend" />
|
||||
<result column="delivery_id" property="deliveryId" />
|
||||
<result column="sku" property="sku" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreOrderMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreOrder">
|
||||
<id column="order_id" property="orderId" />
|
||||
<result column="store_id" property="storeId" />
|
||||
<result column="order_sn" property="orderSn" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="order_status" property="orderStatus" />
|
||||
<result column="shipping_status" property="shippingStatus" />
|
||||
<result column="pay_status" property="payStatus" />
|
||||
<result column="consignee" property="consignee" />
|
||||
<result column="country" property="country" />
|
||||
<result column="province" property="province" />
|
||||
<result column="city" property="city" />
|
||||
<result column="district" property="district" />
|
||||
<result column="twon" property="twon" />
|
||||
<result column="city_info" property="cityInfo" />
|
||||
<result column="address" property="address" />
|
||||
<result column="zipcode" property="zipcode" />
|
||||
<result column="mobile" property="mobile" />
|
||||
<result column="email" property="email" />
|
||||
<result column="receive_type" property="receiveType" />
|
||||
<result column="shipping_code" property="shippingCode" />
|
||||
<result column="shipping_name" property="shippingName" />
|
||||
<result column="pay_code" property="payCode" />
|
||||
<result column="pay_method" property="payMethod" />
|
||||
<result column="recharge_id" property="rechargeId" />
|
||||
<result column="pay_name" property="payName" />
|
||||
<result column="invoice_title" property="invoiceTitle" />
|
||||
<result column="taxpayer" property="taxpayer" />
|
||||
<result column="goods_price" property="goodsPrice" />
|
||||
<result column="shipping_price" property="shippingPrice" />
|
||||
<result column="user_money" property="userMoney" />
|
||||
<result column="coupon_price" property="couponPrice" />
|
||||
<result column="red_price" property="redPrice" />
|
||||
<result column="red_id" property="redId" />
|
||||
<result column="integral" property="integral" />
|
||||
<result column="integral_money" property="integralMoney" />
|
||||
<result column="order_amount" property="orderAmount" />
|
||||
<result column="total_amount" property="totalAmount" />
|
||||
<result column="add_time" property="addTime" />
|
||||
<result column="shipping_time" property="shippingTime" />
|
||||
<result column="confirm_time" property="confirmTime" />
|
||||
<result column="pay_time" property="payTime" />
|
||||
<result column="transaction_id" property="transactionId" />
|
||||
<result column="prom_id" property="promId" />
|
||||
<result column="prom_type" property="promType" />
|
||||
<result column="order_prom_id" property="orderPromId" />
|
||||
<result column="order_prom_amount" property="orderPromAmount" />
|
||||
<result column="edit_money" property="editMoney" />
|
||||
<result column="discount" property="discount" />
|
||||
<result column="user_note" property="userNote" />
|
||||
<result column="admin_note" property="adminNote" />
|
||||
<result column="parent_sn" property="parentSn" />
|
||||
<result column="is_distribut" property="isDistribut" />
|
||||
<result column="paid_money" property="paidMoney" />
|
||||
<result column="deleted_time" property="deletedTime" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="is_checkout" property="isCheckout" />
|
||||
<result column="give_points" property="givePoints" />
|
||||
<result column="unique_number" property="uniqueNumber" />
|
||||
<result column="store_type" property="storeType" />
|
||||
<result column="unique_qrcode" property="uniqueQrcode" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StorePointsMoneyLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StorePointsMoneyLog">
|
||||
<id column="id" property="id" />
|
||||
<result column="order_id" property="orderId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="title" property="title" />
|
||||
<result column="points_number" property="pointsNumber" />
|
||||
<result column="money_number" property="moneyNumber" />
|
||||
<result column="type" property="type" />
|
||||
<result column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreSpecGoodsPriceMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreSpecGoodsPrice">
|
||||
<id column="item_id" property="itemId" />
|
||||
<result column="goods_id" property="goodsId" />
|
||||
<result column="key" property="key" />
|
||||
<result column="key_name" property="keyName" />
|
||||
<result column="price" property="price" />
|
||||
<result column="market_price" property="marketPrice" />
|
||||
<result column="store_count" property="storeCount" />
|
||||
<result column="bar_code" property="barCode" />
|
||||
<result column="sku" property="sku" />
|
||||
<result column="spec_img" property="specImg" />
|
||||
<result column="prom_id" property="promId" />
|
||||
<result column="prom_type" property="promType" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreSpecItemMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreSpecItem">
|
||||
<id column="id" property="id" />
|
||||
<result column="spec_id" property="specId" />
|
||||
<result column="item" property="item" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.StoreSpecMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.StoreSpec">
|
||||
<id column="id" property="id" />
|
||||
<result column="type_id" property="typeId" />
|
||||
<result column="name" property="name" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="search_index" property="searchIndex" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="co.yixiang.app.common.persistence.dao.WechatNewsArticleMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="co.yixiang.app.common.persistence.model.WechatNewsArticle">
|
||||
<id column="id" property="id" />
|
||||
<result column="title" property="title" />
|
||||
<result column="local_url" property="localUrl" />
|
||||
<result column="show_cover_pic" property="showCoverPic" />
|
||||
<result column="author" property="author" />
|
||||
<result column="digest" property="digest" />
|
||||
<result column="content" property="content" />
|
||||
<result column="content_source_url" property="contentSourceUrl" />
|
||||
<result column="create_at" property="createAt" />
|
||||
<result column="create_by" property="createBy" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,122 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 首页轮播广告
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-05
|
||||
*/
|
||||
@TableName("store_ads")
|
||||
public class StoreAds extends Model<StoreAds> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 视频url
|
||||
*/
|
||||
@TableField("video_url")
|
||||
private String videoUrl;
|
||||
|
||||
/**
|
||||
* 轮播图片地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 类型1-视频 2-图片
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
private Long createTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getVideoUrl() {
|
||||
return videoUrl;
|
||||
}
|
||||
|
||||
public void setVideoUrl(String videoUrl) {
|
||||
this.videoUrl = videoUrl;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreAds{" +
|
||||
", id=" + id +
|
||||
", videoUrl=" + videoUrl +
|
||||
", url=" + url +
|
||||
", type=" + type +
|
||||
", sort=" + sort +
|
||||
", createTime=" + createTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-10
|
||||
*/
|
||||
@TableName("store_cart")
|
||||
@Data
|
||||
public class StoreCart extends Model<StoreCart> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 购物车表
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Integer userId;
|
||||
/**
|
||||
* session
|
||||
*/
|
||||
@TableField("session_id")
|
||||
private String sessionId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 商品货号
|
||||
*/
|
||||
@TableField("goods_sn")
|
||||
private String goodsSn;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@TableField("goods_name")
|
||||
private String goodsName;
|
||||
|
||||
@TableField("goods_logo")
|
||||
private String goodsLogo;
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
@TableField("market_price")
|
||||
private BigDecimal marketPrice;
|
||||
/**
|
||||
* 本店价(进货价)
|
||||
*/
|
||||
@TableField("goods_price")
|
||||
private BigDecimal goodsPrice;
|
||||
/**
|
||||
* 会员折扣价
|
||||
*/
|
||||
@TableField("member_goods_price")
|
||||
private BigDecimal memberGoodsPrice;
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
@TableField("goods_num")
|
||||
private Integer goodsNum;
|
||||
/**
|
||||
* 商品规格key 对应store_spec_goods_price 表
|
||||
*/
|
||||
@TableField("spec_key")
|
||||
private String specKey;
|
||||
/**
|
||||
* 商品规格组合名称
|
||||
*/
|
||||
@TableField("spec_key_name")
|
||||
private String specKeyName;
|
||||
/**
|
||||
* 商品条码
|
||||
*/
|
||||
@TableField("bar_code")
|
||||
private String barCode;
|
||||
/**
|
||||
* 购物车选中状态
|
||||
*/
|
||||
private Integer selected;
|
||||
/**
|
||||
* 加入购物车的时间
|
||||
*/
|
||||
@TableField(value = "add_time",fill = FieldFill.INSERT)
|
||||
private Date addTime;
|
||||
/**
|
||||
* 0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠
|
||||
*/
|
||||
@TableField("prom_type")
|
||||
private Integer promType;
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
@TableField("prom_id")
|
||||
private Integer promId;
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品评论表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-15
|
||||
*/
|
||||
@TableName("store_comment")
|
||||
public class StoreComment extends Model<StoreComment> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 评论id
|
||||
*/
|
||||
@TableId(value = "comment_id", type = IdType.AUTO)
|
||||
private Integer commentId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* email邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
@TableField("add_time")
|
||||
private Integer addTime;
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
@TableField("ip_address")
|
||||
private String ipAddress;
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
@TableField("is_show")
|
||||
private Integer isShow;
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
@TableField("parent_id")
|
||||
private Integer parentId;
|
||||
/**
|
||||
* 评论用户
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Integer userId;
|
||||
/**
|
||||
* 晒单图片
|
||||
*/
|
||||
private String img;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@TableField("order_id")
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 物流评价等级
|
||||
*/
|
||||
@TableField("deliver_rank")
|
||||
private Integer deliverRank;
|
||||
/**
|
||||
* 商品评价等级
|
||||
*/
|
||||
@TableField("goods_rank")
|
||||
private Integer goodsRank;
|
||||
/**
|
||||
* 商家服务态度评价等级
|
||||
*/
|
||||
@TableField("service_rank")
|
||||
private Integer serviceRank;
|
||||
/**
|
||||
* 被赞数
|
||||
*/
|
||||
@TableField("zan_num")
|
||||
private Integer zanNum;
|
||||
/**
|
||||
* 点赞用户id
|
||||
*/
|
||||
@TableField("zan_userid")
|
||||
private String zanUserid;
|
||||
/**
|
||||
* 是否匿名评价:0不是,1是
|
||||
*/
|
||||
@TableField("is_anonymous")
|
||||
private Integer isAnonymous;
|
||||
/**
|
||||
* 订单商品表ID
|
||||
*/
|
||||
@TableField("rec_id")
|
||||
private Integer recId;
|
||||
|
||||
|
||||
public Integer getCommentId() {
|
||||
return commentId;
|
||||
}
|
||||
|
||||
public void setCommentId(Integer commentId) {
|
||||
this.commentId = commentId;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Integer getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
public void setAddTime(Integer addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public Integer getIsShow() {
|
||||
return isShow;
|
||||
}
|
||||
|
||||
public void setIsShow(Integer isShow) {
|
||||
this.isShow = isShow;
|
||||
}
|
||||
|
||||
public Integer getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public Integer getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Integer orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Integer getDeliverRank() {
|
||||
return deliverRank;
|
||||
}
|
||||
|
||||
public void setDeliverRank(Integer deliverRank) {
|
||||
this.deliverRank = deliverRank;
|
||||
}
|
||||
|
||||
public Integer getGoodsRank() {
|
||||
return goodsRank;
|
||||
}
|
||||
|
||||
public void setGoodsRank(Integer goodsRank) {
|
||||
this.goodsRank = goodsRank;
|
||||
}
|
||||
|
||||
public Integer getServiceRank() {
|
||||
return serviceRank;
|
||||
}
|
||||
|
||||
public void setServiceRank(Integer serviceRank) {
|
||||
this.serviceRank = serviceRank;
|
||||
}
|
||||
|
||||
public Integer getZanNum() {
|
||||
return zanNum;
|
||||
}
|
||||
|
||||
public void setZanNum(Integer zanNum) {
|
||||
this.zanNum = zanNum;
|
||||
}
|
||||
|
||||
public String getZanUserid() {
|
||||
return zanUserid;
|
||||
}
|
||||
|
||||
public void setZanUserid(String zanUserid) {
|
||||
this.zanUserid = zanUserid;
|
||||
}
|
||||
|
||||
public Integer getIsAnonymous() {
|
||||
return isAnonymous;
|
||||
}
|
||||
|
||||
public void setIsAnonymous(Integer isAnonymous) {
|
||||
this.isAnonymous = isAnonymous;
|
||||
}
|
||||
|
||||
public Integer getRecId() {
|
||||
return recId;
|
||||
}
|
||||
|
||||
public void setRecId(Integer recId) {
|
||||
this.recId = recId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.commentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreComment{" +
|
||||
", commentId=" + commentId +
|
||||
", goodsId=" + goodsId +
|
||||
", email=" + email +
|
||||
", username=" + username +
|
||||
", content=" + content +
|
||||
", addTime=" + addTime +
|
||||
", ipAddress=" + ipAddress +
|
||||
", isShow=" + isShow +
|
||||
", parentId=" + parentId +
|
||||
", userId=" + userId +
|
||||
", img=" + img +
|
||||
", orderId=" + orderId +
|
||||
", deliverRank=" + deliverRank +
|
||||
", goodsRank=" + goodsRank +
|
||||
", serviceRank=" + serviceRank +
|
||||
", zanNum=" + zanNum +
|
||||
", zanUserid=" + zanUserid +
|
||||
", isAnonymous=" + isAnonymous +
|
||||
", recId=" + recId +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 优惠券主表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
@TableName("store_coupon")
|
||||
public class StoreCoupon extends Model<StoreCoupon> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 优惠券名字
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 发放类型 0下单赠送1 指定发放 2 免费领取 3线下发放
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 优惠券金额
|
||||
*/
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 使用条件,满多少金额
|
||||
*/
|
||||
private BigDecimal condition;
|
||||
/**
|
||||
* 发放数量
|
||||
*/
|
||||
private Integer createnum;
|
||||
/**
|
||||
* 已领取数量
|
||||
*/
|
||||
@TableField("send_num")
|
||||
private Integer sendNum;
|
||||
/**
|
||||
* 已使用数量
|
||||
*/
|
||||
@TableField("use_num")
|
||||
private Integer useNum;
|
||||
/**
|
||||
* 发放开始时间
|
||||
*/
|
||||
@TableField("send_start_time")
|
||||
private Integer sendStartTime;
|
||||
/**
|
||||
* 发放结束时间
|
||||
*/
|
||||
@TableField("send_end_time")
|
||||
private Integer sendEndTime;
|
||||
/**
|
||||
* 使用开始时间
|
||||
*/
|
||||
@TableField("use_start_time")
|
||||
private Date useStartTime;
|
||||
/**
|
||||
* 使用结束时间
|
||||
*/
|
||||
@TableField("use_end_time")
|
||||
private Date useEndTime;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
@TableField("add_time")
|
||||
private Integer addTime;
|
||||
/**
|
||||
* 状态:1有效,2无效
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 使用范围:0全店通用1指定商品可用2指定分类商品可用
|
||||
*/
|
||||
@TableField("use_type")
|
||||
private Integer useType;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BigDecimal getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(BigDecimal money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public BigDecimal getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public void setCondition(BigDecimal condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public Integer getCreatenum() {
|
||||
return createnum;
|
||||
}
|
||||
|
||||
public void setCreatenum(Integer createnum) {
|
||||
this.createnum = createnum;
|
||||
}
|
||||
|
||||
public Integer getSendNum() {
|
||||
return sendNum;
|
||||
}
|
||||
|
||||
public void setSendNum(Integer sendNum) {
|
||||
this.sendNum = sendNum;
|
||||
}
|
||||
|
||||
public Integer getUseNum() {
|
||||
return useNum;
|
||||
}
|
||||
|
||||
public void setUseNum(Integer useNum) {
|
||||
this.useNum = useNum;
|
||||
}
|
||||
|
||||
public Integer getSendStartTime() {
|
||||
return sendStartTime;
|
||||
}
|
||||
|
||||
public void setSendStartTime(Integer sendStartTime) {
|
||||
this.sendStartTime = sendStartTime;
|
||||
}
|
||||
|
||||
public Integer getSendEndTime() {
|
||||
return sendEndTime;
|
||||
}
|
||||
|
||||
public void setSendEndTime(Integer sendEndTime) {
|
||||
this.sendEndTime = sendEndTime;
|
||||
}
|
||||
|
||||
public Date getUseStartTime() {
|
||||
return useStartTime;
|
||||
}
|
||||
|
||||
public void setUseStartTime(Date useStartTime) {
|
||||
this.useStartTime = useStartTime;
|
||||
}
|
||||
|
||||
public Date getUseEndTime() {
|
||||
return useEndTime;
|
||||
}
|
||||
|
||||
public void setUseEndTime(Date useEndTime) {
|
||||
this.useEndTime = useEndTime;
|
||||
}
|
||||
|
||||
public Integer getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
public void setAddTime(Integer addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getUseType() {
|
||||
return useType;
|
||||
}
|
||||
|
||||
public void setUseType(Integer useType) {
|
||||
this.useType = useType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreCoupon{" +
|
||||
", id=" + id +
|
||||
", name=" + name +
|
||||
", type=" + type +
|
||||
", money=" + money +
|
||||
", condition=" + condition +
|
||||
", createnum=" + createnum +
|
||||
", sendNum=" + sendNum +
|
||||
", useNum=" + useNum +
|
||||
", sendStartTime=" + sendStartTime +
|
||||
", sendEndTime=" + sendEndTime +
|
||||
", useStartTime=" + useStartTime +
|
||||
", useEndTime=" + useEndTime +
|
||||
", addTime=" + addTime +
|
||||
", status=" + status +
|
||||
", useType=" + useType +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 优惠券记录表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
@TableName("store_coupon_list")
|
||||
public class StoreCouponList extends Model<StoreCouponList> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 优惠券 对应coupon表id
|
||||
*/
|
||||
private Integer cid;
|
||||
/**
|
||||
* 发放类型 1 按订单发放 2 注册 3 邀请 4 按用户发放
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer uid;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@TableField("order_id")
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 优惠券来自订单ID
|
||||
*/
|
||||
@TableField("get_order_id")
|
||||
private Integer getOrderId;
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
@TableField("use_time")
|
||||
private Integer useTime;
|
||||
/**
|
||||
* 优惠券兑换码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 发放时间
|
||||
*/
|
||||
@TableField("send_time")
|
||||
private Integer sendTime;
|
||||
/**
|
||||
* 0未使用1已使用2已过期
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public void setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Integer uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Integer getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Integer orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Integer getGetOrderId() {
|
||||
return getOrderId;
|
||||
}
|
||||
|
||||
public void setGetOrderId(Integer getOrderId) {
|
||||
this.getOrderId = getOrderId;
|
||||
}
|
||||
|
||||
public Integer getUseTime() {
|
||||
return useTime;
|
||||
}
|
||||
|
||||
public void setUseTime(Integer useTime) {
|
||||
this.useTime = useTime;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getSendTime() {
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
public void setSendTime(Integer sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreCouponList{" +
|
||||
", id=" + id +
|
||||
", cid=" + cid +
|
||||
", type=" + type +
|
||||
", uid=" + uid +
|
||||
", orderId=" + orderId +
|
||||
", getOrderId=" + getOrderId +
|
||||
", useTime=" + useTime +
|
||||
", code=" + code +
|
||||
", sendTime=" + sendTime +
|
||||
", status=" + status +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,660 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品主表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-05
|
||||
*/
|
||||
@TableName("store_goods")
|
||||
public class StoreGoods extends Model<StoreGoods> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableId(value = "goods_id", type = IdType.AUTO)
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
@TableField("cate_id")
|
||||
private Integer cateId;
|
||||
/**
|
||||
* 扩展分类id
|
||||
*/
|
||||
@TableField("extend_cat_id")
|
||||
private Integer extendCatId;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@TableField("goods_sn")
|
||||
private String goodsSn;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@TableField("goods_name")
|
||||
private String goodsName;
|
||||
/**
|
||||
* 点击数
|
||||
*/
|
||||
@TableField("click_count")
|
||||
private Integer clickCount;
|
||||
/**
|
||||
* 品牌id
|
||||
*/
|
||||
@TableField("brand_id")
|
||||
private Integer brandId;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@TableField("store_count")
|
||||
private Integer storeCount;
|
||||
/**
|
||||
* 商品评论数
|
||||
*/
|
||||
@TableField("comment_count")
|
||||
private Integer commentCount;
|
||||
/**
|
||||
* 商品重量克为单位
|
||||
*/
|
||||
private Integer weight;
|
||||
/**
|
||||
* 商品体积。单位立方米
|
||||
*/
|
||||
private Double volume;
|
||||
/**
|
||||
* 市场价(零售价)
|
||||
*/
|
||||
@TableField("market_price")
|
||||
private BigDecimal marketPrice;
|
||||
/**
|
||||
* 本店价(供货价)
|
||||
*/
|
||||
@TableField("shop_price")
|
||||
private BigDecimal shopPrice;
|
||||
/**
|
||||
* 商品成本价
|
||||
*/
|
||||
@TableField("cost_price")
|
||||
private BigDecimal costPrice;
|
||||
/**
|
||||
* 价格阶梯
|
||||
*/
|
||||
@TableField("price_ladder")
|
||||
private String priceLadder;
|
||||
/**
|
||||
* 商品关键词
|
||||
*/
|
||||
private String keywords;
|
||||
/**
|
||||
* 商品简单描述
|
||||
*/
|
||||
@TableField("goods_remark")
|
||||
private String goodsRemark;
|
||||
/**
|
||||
* 商品详细描述
|
||||
*/
|
||||
@TableField("goods_content")
|
||||
private String goodsContent;
|
||||
/**
|
||||
* 手机端商品详情
|
||||
*/
|
||||
@TableField("mobile_content")
|
||||
private String mobileContent;
|
||||
/**
|
||||
* 商品上传原始图(主图)
|
||||
*/
|
||||
@TableField("goods_logo")
|
||||
private String goodsLogo;
|
||||
/**
|
||||
* 是否为虚拟商品 1是,0否
|
||||
*/
|
||||
@TableField("is_virtual")
|
||||
private Integer isVirtual;
|
||||
/**
|
||||
* 虚拟商品有效期
|
||||
*/
|
||||
@TableField("virtual_indate")
|
||||
private Integer virtualIndate;
|
||||
/**
|
||||
* 虚拟商品购买上限
|
||||
*/
|
||||
@TableField("virtual_limit")
|
||||
private Integer virtualLimit;
|
||||
/**
|
||||
* 是否允许过期退款, 1是,0否
|
||||
*/
|
||||
@TableField("virtual_refund")
|
||||
private Integer virtualRefund;
|
||||
/**
|
||||
* 是否上架 0-未上架 1-销售中
|
||||
*/
|
||||
@TableField("is_on_sale")
|
||||
private Integer isOnSale;
|
||||
/**
|
||||
* 是否包邮0否1是
|
||||
*/
|
||||
@TableField("is_free_shipping")
|
||||
private Integer isFreeShipping;
|
||||
/**
|
||||
* 商品上架时间
|
||||
*/
|
||||
@TableField("on_time")
|
||||
private Integer onTime;
|
||||
/**
|
||||
* 商品排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 是否推荐0-未推荐 1-已推荐
|
||||
*/
|
||||
@TableField("is_recommend")
|
||||
private Integer isRecommend;
|
||||
/**
|
||||
* 是否新品0-不是 1-是
|
||||
*/
|
||||
@TableField("is_new")
|
||||
private Integer isNew;
|
||||
/**
|
||||
* 是否热卖
|
||||
*/
|
||||
@TableField("is_hot")
|
||||
private Integer isHot;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
@TableField("last_update")
|
||||
private Integer lastUpdate;
|
||||
/**
|
||||
* 商品所属类型id,取值表goods_type的id
|
||||
*/
|
||||
@TableField("goods_type")
|
||||
private Integer goodsType;
|
||||
/**
|
||||
* 商品规格类型,取值表goods_type的id
|
||||
*/
|
||||
@TableField("spec_type")
|
||||
private Integer specType;
|
||||
/**
|
||||
* 购买商品赠送积分
|
||||
*/
|
||||
@TableField("give_integral")
|
||||
private Integer giveIntegral;
|
||||
/**
|
||||
* 积分兑换:0不参与积分兑换,积分和现金的兑换比例见后台配置
|
||||
*/
|
||||
@TableField("exchange_integral")
|
||||
private Integer exchangeIntegral;
|
||||
/**
|
||||
* 供货商ID
|
||||
*/
|
||||
@TableField("suppliers_id")
|
||||
private Integer suppliersId;
|
||||
/**
|
||||
* 商品销量
|
||||
*/
|
||||
@TableField("sales_sum")
|
||||
private Integer salesSum;
|
||||
/**
|
||||
* 0默认1抢购2团购3优惠促销4预售5虚拟(5其实没用)6拼团
|
||||
*/
|
||||
@TableField("prom_type")
|
||||
private Integer promType;
|
||||
/**
|
||||
* 优惠活动id
|
||||
*/
|
||||
@TableField("prom_id")
|
||||
private Integer promId;
|
||||
/**
|
||||
* 佣金用于分销分成
|
||||
*/
|
||||
private BigDecimal commission;
|
||||
/**
|
||||
* SPU
|
||||
*/
|
||||
private String spu;
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
private String sku;
|
||||
/**
|
||||
* 运费模板ID
|
||||
*/
|
||||
@TableField("template_id")
|
||||
private Integer templateId;
|
||||
/**
|
||||
* 视频
|
||||
*/
|
||||
@TableField("goods_video")
|
||||
private String goodsVideo;
|
||||
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public Integer getCateId() {
|
||||
return cateId;
|
||||
}
|
||||
|
||||
public void setCateId(Integer cateId) {
|
||||
this.cateId = cateId;
|
||||
}
|
||||
|
||||
public Integer getExtendCatId() {
|
||||
return extendCatId;
|
||||
}
|
||||
|
||||
public void setExtendCatId(Integer extendCatId) {
|
||||
this.extendCatId = extendCatId;
|
||||
}
|
||||
|
||||
public String getGoodsSn() {
|
||||
return goodsSn;
|
||||
}
|
||||
|
||||
public void setGoodsSn(String goodsSn) {
|
||||
this.goodsSn = goodsSn;
|
||||
}
|
||||
|
||||
public String getGoodsName() {
|
||||
return goodsName;
|
||||
}
|
||||
|
||||
public void setGoodsName(String goodsName) {
|
||||
this.goodsName = goodsName;
|
||||
}
|
||||
|
||||
public Integer getClickCount() {
|
||||
return clickCount;
|
||||
}
|
||||
|
||||
public void setClickCount(Integer clickCount) {
|
||||
this.clickCount = clickCount;
|
||||
}
|
||||
|
||||
public Integer getBrandId() {
|
||||
return brandId;
|
||||
}
|
||||
|
||||
public void setBrandId(Integer brandId) {
|
||||
this.brandId = brandId;
|
||||
}
|
||||
|
||||
public Integer getStoreCount() {
|
||||
return storeCount;
|
||||
}
|
||||
|
||||
public void setStoreCount(Integer storeCount) {
|
||||
this.storeCount = storeCount;
|
||||
}
|
||||
|
||||
public Integer getCommentCount() {
|
||||
return commentCount;
|
||||
}
|
||||
|
||||
public void setCommentCount(Integer commentCount) {
|
||||
this.commentCount = commentCount;
|
||||
}
|
||||
|
||||
public Integer getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(Integer weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public Double getVolume() {
|
||||
return volume;
|
||||
}
|
||||
|
||||
public void setVolume(Double volume) {
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public BigDecimal getMarketPrice() {
|
||||
return marketPrice;
|
||||
}
|
||||
|
||||
public void setMarketPrice(BigDecimal marketPrice) {
|
||||
this.marketPrice = marketPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getShopPrice() {
|
||||
return shopPrice;
|
||||
}
|
||||
|
||||
public void setShopPrice(BigDecimal shopPrice) {
|
||||
this.shopPrice = shopPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getCostPrice() {
|
||||
return costPrice;
|
||||
}
|
||||
|
||||
public void setCostPrice(BigDecimal costPrice) {
|
||||
this.costPrice = costPrice;
|
||||
}
|
||||
|
||||
public String getPriceLadder() {
|
||||
return priceLadder;
|
||||
}
|
||||
|
||||
public void setPriceLadder(String priceLadder) {
|
||||
this.priceLadder = priceLadder;
|
||||
}
|
||||
|
||||
public String getKeywords() {
|
||||
return keywords;
|
||||
}
|
||||
|
||||
public void setKeywords(String keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public String getGoodsRemark() {
|
||||
return goodsRemark;
|
||||
}
|
||||
|
||||
public void setGoodsRemark(String goodsRemark) {
|
||||
this.goodsRemark = goodsRemark;
|
||||
}
|
||||
|
||||
public String getGoodsContent() {
|
||||
return goodsContent;
|
||||
}
|
||||
|
||||
public void setGoodsContent(String goodsContent) {
|
||||
this.goodsContent = goodsContent;
|
||||
}
|
||||
|
||||
public String getMobileContent() {
|
||||
return mobileContent;
|
||||
}
|
||||
|
||||
public void setMobileContent(String mobileContent) {
|
||||
this.mobileContent = mobileContent;
|
||||
}
|
||||
|
||||
public String getGoodsLogo() {
|
||||
return goodsLogo;
|
||||
}
|
||||
|
||||
public void setGoodsLogo(String goodsLogo) {
|
||||
this.goodsLogo = goodsLogo;
|
||||
}
|
||||
|
||||
public Integer getIsVirtual() {
|
||||
return isVirtual;
|
||||
}
|
||||
|
||||
public void setIsVirtual(Integer isVirtual) {
|
||||
this.isVirtual = isVirtual;
|
||||
}
|
||||
|
||||
public Integer getVirtualIndate() {
|
||||
return virtualIndate;
|
||||
}
|
||||
|
||||
public void setVirtualIndate(Integer virtualIndate) {
|
||||
this.virtualIndate = virtualIndate;
|
||||
}
|
||||
|
||||
public Integer getVirtualLimit() {
|
||||
return virtualLimit;
|
||||
}
|
||||
|
||||
public void setVirtualLimit(Integer virtualLimit) {
|
||||
this.virtualLimit = virtualLimit;
|
||||
}
|
||||
|
||||
public Integer getVirtualRefund() {
|
||||
return virtualRefund;
|
||||
}
|
||||
|
||||
public void setVirtualRefund(Integer virtualRefund) {
|
||||
this.virtualRefund = virtualRefund;
|
||||
}
|
||||
|
||||
public Integer getIsOnSale() {
|
||||
return isOnSale;
|
||||
}
|
||||
|
||||
public void setIsOnSale(Integer isOnSale) {
|
||||
this.isOnSale = isOnSale;
|
||||
}
|
||||
|
||||
public Integer getIsFreeShipping() {
|
||||
return isFreeShipping;
|
||||
}
|
||||
|
||||
public void setIsFreeShipping(Integer isFreeShipping) {
|
||||
this.isFreeShipping = isFreeShipping;
|
||||
}
|
||||
|
||||
public Integer getOnTime() {
|
||||
return onTime;
|
||||
}
|
||||
|
||||
public void setOnTime(Integer onTime) {
|
||||
this.onTime = onTime;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Integer getIsRecommend() {
|
||||
return isRecommend;
|
||||
}
|
||||
|
||||
public void setIsRecommend(Integer isRecommend) {
|
||||
this.isRecommend = isRecommend;
|
||||
}
|
||||
|
||||
public Integer getIsNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public void setIsNew(Integer isNew) {
|
||||
this.isNew = isNew;
|
||||
}
|
||||
|
||||
public Integer getIsHot() {
|
||||
return isHot;
|
||||
}
|
||||
|
||||
public void setIsHot(Integer isHot) {
|
||||
this.isHot = isHot;
|
||||
}
|
||||
|
||||
public Integer getLastUpdate() {
|
||||
return lastUpdate;
|
||||
}
|
||||
|
||||
public void setLastUpdate(Integer lastUpdate) {
|
||||
this.lastUpdate = lastUpdate;
|
||||
}
|
||||
|
||||
public Integer getGoodsType() {
|
||||
return goodsType;
|
||||
}
|
||||
|
||||
public void setGoodsType(Integer goodsType) {
|
||||
this.goodsType = goodsType;
|
||||
}
|
||||
|
||||
public Integer getSpecType() {
|
||||
return specType;
|
||||
}
|
||||
|
||||
public void setSpecType(Integer specType) {
|
||||
this.specType = specType;
|
||||
}
|
||||
|
||||
public Integer getGiveIntegral() {
|
||||
return giveIntegral;
|
||||
}
|
||||
|
||||
public void setGiveIntegral(Integer giveIntegral) {
|
||||
this.giveIntegral = giveIntegral;
|
||||
}
|
||||
|
||||
public Integer getExchangeIntegral() {
|
||||
return exchangeIntegral;
|
||||
}
|
||||
|
||||
public void setExchangeIntegral(Integer exchangeIntegral) {
|
||||
this.exchangeIntegral = exchangeIntegral;
|
||||
}
|
||||
|
||||
public Integer getSuppliersId() {
|
||||
return suppliersId;
|
||||
}
|
||||
|
||||
public void setSuppliersId(Integer suppliersId) {
|
||||
this.suppliersId = suppliersId;
|
||||
}
|
||||
|
||||
public Integer getSalesSum() {
|
||||
return salesSum;
|
||||
}
|
||||
|
||||
public void setSalesSum(Integer salesSum) {
|
||||
this.salesSum = salesSum;
|
||||
}
|
||||
|
||||
public Integer getPromType() {
|
||||
return promType;
|
||||
}
|
||||
|
||||
public void setPromType(Integer promType) {
|
||||
this.promType = promType;
|
||||
}
|
||||
|
||||
public Integer getPromId() {
|
||||
return promId;
|
||||
}
|
||||
|
||||
public void setPromId(Integer promId) {
|
||||
this.promId = promId;
|
||||
}
|
||||
|
||||
public BigDecimal getCommission() {
|
||||
return commission;
|
||||
}
|
||||
|
||||
public void setCommission(BigDecimal commission) {
|
||||
this.commission = commission;
|
||||
}
|
||||
|
||||
public String getSpu() {
|
||||
return spu;
|
||||
}
|
||||
|
||||
public void setSpu(String spu) {
|
||||
this.spu = spu;
|
||||
}
|
||||
|
||||
public String getSku() {
|
||||
return sku;
|
||||
}
|
||||
|
||||
public void setSku(String sku) {
|
||||
this.sku = sku;
|
||||
}
|
||||
|
||||
public Integer getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(Integer templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getGoodsVideo() {
|
||||
return goodsVideo;
|
||||
}
|
||||
|
||||
public void setGoodsVideo(String goodsVideo) {
|
||||
this.goodsVideo = goodsVideo;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.goodsId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreGoods{" +
|
||||
", goodsId=" + goodsId +
|
||||
", cateId=" + cateId +
|
||||
", extendCatId=" + extendCatId +
|
||||
", goodsSn=" + goodsSn +
|
||||
", goodsName=" + goodsName +
|
||||
", clickCount=" + clickCount +
|
||||
", brandId=" + brandId +
|
||||
", storeCount=" + storeCount +
|
||||
", commentCount=" + commentCount +
|
||||
", weight=" + weight +
|
||||
", volume=" + volume +
|
||||
", marketPrice=" + marketPrice +
|
||||
", shopPrice=" + shopPrice +
|
||||
", costPrice=" + costPrice +
|
||||
", priceLadder=" + priceLadder +
|
||||
", keywords=" + keywords +
|
||||
", goodsRemark=" + goodsRemark +
|
||||
", goodsContent=" + goodsContent +
|
||||
", mobileContent=" + mobileContent +
|
||||
", goodsLogo=" + goodsLogo +
|
||||
", isVirtual=" + isVirtual +
|
||||
", virtualIndate=" + virtualIndate +
|
||||
", virtualLimit=" + virtualLimit +
|
||||
", virtualRefund=" + virtualRefund +
|
||||
", isOnSale=" + isOnSale +
|
||||
", isFreeShipping=" + isFreeShipping +
|
||||
", onTime=" + onTime +
|
||||
", sort=" + sort +
|
||||
", isRecommend=" + isRecommend +
|
||||
", isNew=" + isNew +
|
||||
", isHot=" + isHot +
|
||||
", lastUpdate=" + lastUpdate +
|
||||
", goodsType=" + goodsType +
|
||||
", specType=" + specType +
|
||||
", giveIntegral=" + giveIntegral +
|
||||
", exchangeIntegral=" + exchangeIntegral +
|
||||
", suppliersId=" + suppliersId +
|
||||
", salesSum=" + salesSum +
|
||||
", promType=" + promType +
|
||||
", promId=" + promId +
|
||||
", commission=" + commission +
|
||||
", spu=" + spu +
|
||||
", sku=" + sku +
|
||||
", templateId=" + templateId +
|
||||
", goodsVideo=" + goodsVideo +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品关联的属性表(与商品相关)
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@TableName("store_goods_attr")
|
||||
public class StoreGoodsAttr extends Model<StoreGoodsAttr> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品属性id自增
|
||||
*/
|
||||
@TableId(value = "goods_attr_id", type = IdType.AUTO)
|
||||
private Integer goodsAttrId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 属性id
|
||||
*/
|
||||
@TableField("attr_id")
|
||||
private Integer attrId;
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
@TableField("attr_value")
|
||||
private String attrValue;
|
||||
/**
|
||||
* 属性价格
|
||||
*/
|
||||
@TableField("attr_price")
|
||||
private String attrPrice;
|
||||
|
||||
|
||||
public Integer getGoodsAttrId() {
|
||||
return goodsAttrId;
|
||||
}
|
||||
|
||||
public void setGoodsAttrId(Integer goodsAttrId) {
|
||||
this.goodsAttrId = goodsAttrId;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public Integer getAttrId() {
|
||||
return attrId;
|
||||
}
|
||||
|
||||
public void setAttrId(Integer attrId) {
|
||||
this.attrId = attrId;
|
||||
}
|
||||
|
||||
public String getAttrValue() {
|
||||
return attrValue;
|
||||
}
|
||||
|
||||
public void setAttrValue(String attrValue) {
|
||||
this.attrValue = attrValue;
|
||||
}
|
||||
|
||||
public String getAttrPrice() {
|
||||
return attrPrice;
|
||||
}
|
||||
|
||||
public void setAttrPrice(String attrPrice) {
|
||||
this.attrPrice = attrPrice;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.goodsAttrId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreGoodsAttr{" +
|
||||
", goodsAttrId=" + goodsAttrId +
|
||||
", goodsId=" + goodsId +
|
||||
", attrId=" + attrId +
|
||||
", attrValue=" + attrValue +
|
||||
", attrPrice=" + attrPrice +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品的属性表(独立)
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@TableName("store_goods_attribute")
|
||||
public class StoreGoodsAttribute extends Model<StoreGoodsAttribute> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 属性id
|
||||
*/
|
||||
@TableId(value = "attr_id", type = IdType.AUTO)
|
||||
private Integer attrId;
|
||||
/**
|
||||
* 属性名称
|
||||
*/
|
||||
@TableField("attr_name")
|
||||
private String attrName;
|
||||
/**
|
||||
* 属性分类id(商品模型id)
|
||||
*/
|
||||
@TableField("type_id")
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 0不需要检索 1关键字检索 2范围检索
|
||||
*/
|
||||
@TableField("attr_index")
|
||||
private Integer attrIndex;
|
||||
/**
|
||||
* 0唯一属性 1单选属性 2复选属性
|
||||
*/
|
||||
@TableField("attr_type")
|
||||
private Integer attrType;
|
||||
/**
|
||||
* 0 手工录入 1从列表中选择 2多行文本框
|
||||
*/
|
||||
@TableField("attr_input_type")
|
||||
private Integer attrInputType;
|
||||
/**
|
||||
* 可选值列表
|
||||
*/
|
||||
@TableField("attr_values")
|
||||
private String attrValues;
|
||||
/**
|
||||
* 属性排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
|
||||
public Integer getAttrId() {
|
||||
return attrId;
|
||||
}
|
||||
|
||||
public void setAttrId(Integer attrId) {
|
||||
this.attrId = attrId;
|
||||
}
|
||||
|
||||
public String getAttrName() {
|
||||
return attrName;
|
||||
}
|
||||
|
||||
public void setAttrName(String attrName) {
|
||||
this.attrName = attrName;
|
||||
}
|
||||
|
||||
public Integer getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Integer typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public Integer getAttrIndex() {
|
||||
return attrIndex;
|
||||
}
|
||||
|
||||
public void setAttrIndex(Integer attrIndex) {
|
||||
this.attrIndex = attrIndex;
|
||||
}
|
||||
|
||||
public Integer getAttrType() {
|
||||
return attrType;
|
||||
}
|
||||
|
||||
public void setAttrType(Integer attrType) {
|
||||
this.attrType = attrType;
|
||||
}
|
||||
|
||||
public Integer getAttrInputType() {
|
||||
return attrInputType;
|
||||
}
|
||||
|
||||
public void setAttrInputType(Integer attrInputType) {
|
||||
this.attrInputType = attrInputType;
|
||||
}
|
||||
|
||||
public String getAttrValues() {
|
||||
return attrValues;
|
||||
}
|
||||
|
||||
public void setAttrValues(String attrValues) {
|
||||
this.attrValues = attrValues;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.attrId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreGoodsAttribute{" +
|
||||
", attrId=" + attrId +
|
||||
", attrName=" + attrName +
|
||||
", typeId=" + typeId +
|
||||
", attrIndex=" + attrIndex +
|
||||
", attrType=" + attrType +
|
||||
", attrInputType=" + attrInputType +
|
||||
", attrValues=" + attrValues +
|
||||
", sort=" + sort +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商城商品分类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-08
|
||||
*/
|
||||
@TableName("store_goods_cate")
|
||||
public class StoreGoodsCate extends Model<StoreGoodsCate> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 上级分类编号
|
||||
*/
|
||||
private Long pid;
|
||||
/**
|
||||
* 品牌ID
|
||||
*/
|
||||
@TableField("brand_id")
|
||||
private Long brandId;
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
@TableField("cate_title")
|
||||
private String cateTitle;
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
@TableField("cate_desc")
|
||||
private String cateDesc;
|
||||
/**
|
||||
* 缩略图url
|
||||
*/
|
||||
@TableField("img_url")
|
||||
private String imgUrl;
|
||||
/**
|
||||
* 商品分类排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品状态(1有效,0无效)
|
||||
*/
|
||||
private Long status;
|
||||
/**
|
||||
* 删除状态(1删除,0未删除)
|
||||
*/
|
||||
@TableField("is_deleted")
|
||||
private Long isDeleted;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_at")
|
||||
private Date createAt;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(Long pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public Long getBrandId() {
|
||||
return brandId;
|
||||
}
|
||||
|
||||
public void setBrandId(Long brandId) {
|
||||
this.brandId = brandId;
|
||||
}
|
||||
|
||||
public String getCateTitle() {
|
||||
return cateTitle;
|
||||
}
|
||||
|
||||
public void setCateTitle(String cateTitle) {
|
||||
this.cateTitle = cateTitle;
|
||||
}
|
||||
|
||||
public String getCateDesc() {
|
||||
return cateDesc;
|
||||
}
|
||||
|
||||
public void setCateDesc(String cateDesc) {
|
||||
this.cateDesc = cateDesc;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public Long getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Long sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Long status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getIsDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
public void setIsDeleted(Long isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
public Date getCreateAt() {
|
||||
return createAt;
|
||||
}
|
||||
|
||||
public void setCreateAt(Date createAt) {
|
||||
this.createAt = createAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreGoodsCate{" +
|
||||
", id=" + id +
|
||||
", pid=" + pid +
|
||||
", brandId=" + brandId +
|
||||
", cateTitle=" + cateTitle +
|
||||
", cateDesc=" + cateDesc +
|
||||
", imgUrl=" + imgUrl +
|
||||
", sort=" + sort +
|
||||
", status=" + status +
|
||||
", isDeleted=" + isDeleted +
|
||||
", createAt=" + createAt +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品收藏表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@TableName("store_goods_collect")
|
||||
public class StoreGoodsCollect extends Model<StoreGoodsCollect> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
@TableId(value = "collect_id", type = IdType.AUTO)
|
||||
private Integer collectId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Integer userId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
@TableField(value = "add_time",fill = FieldFill.INSERT)
|
||||
private Date addTime;
|
||||
|
||||
|
||||
public Integer getCollectId() {
|
||||
return collectId;
|
||||
}
|
||||
|
||||
public void setCollectId(Integer collectId) {
|
||||
this.collectId = collectId;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public Date getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
public void setAddTime(Date addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.collectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreGoodsCollect{" +
|
||||
", collectId=" + collectId +
|
||||
", userId=" + userId +
|
||||
", goodsId=" + goodsId +
|
||||
", addTime=" + addTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商城会员信息
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-06-17
|
||||
*/
|
||||
@TableName("store_member")
|
||||
public class StoreMember extends Model<StoreMember> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* vip编号
|
||||
*/
|
||||
@TableField("vip_no")
|
||||
private String vipNo;
|
||||
/**
|
||||
* 会员微信OPENID
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
|
||||
/**
|
||||
* 会员手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 会员昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 会员头像
|
||||
*/
|
||||
private String headimg;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 会员级别
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 消费累计额度 用于用户等级
|
||||
*/
|
||||
@TableField("total_amount")
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 用户金额
|
||||
*/
|
||||
@TableField("user_money")
|
||||
private BigDecimal userMoney;
|
||||
/**
|
||||
* 累积分佣金额
|
||||
*/
|
||||
@TableField("distribut_money")
|
||||
private BigDecimal distributMoney;
|
||||
/**
|
||||
* 冻结金额
|
||||
*/
|
||||
@TableField("frozen_money")
|
||||
private Double frozenMoney;
|
||||
/**
|
||||
* 用户下线总数
|
||||
*/
|
||||
@TableField("underling_number")
|
||||
private Integer underlingNumber;
|
||||
/**
|
||||
* 消费积分(可用积分)
|
||||
*/
|
||||
@TableField("pay_points")
|
||||
private Integer payPoints;
|
||||
|
||||
/**
|
||||
* 默认收货地址
|
||||
*/
|
||||
@TableField("address_id")
|
||||
private Integer addressId;
|
||||
/**
|
||||
* 会员个性签名
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 会员状态0待审核 1-已审核 2-已拒绝
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_at")
|
||||
private Date createAt;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@TableField("status_time")
|
||||
private Long statusTime;
|
||||
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getVipNo() {
|
||||
return vipNo;
|
||||
}
|
||||
|
||||
public void setVipNo(String vipNo) {
|
||||
this.vipNo = vipNo;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
public void setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getUserMoney() {
|
||||
return userMoney;
|
||||
}
|
||||
|
||||
public void setUserMoney(BigDecimal userMoney) {
|
||||
this.userMoney = userMoney;
|
||||
}
|
||||
|
||||
public BigDecimal getDistributMoney() {
|
||||
return distributMoney;
|
||||
}
|
||||
|
||||
public void setDistributMoney(BigDecimal distributMoney) {
|
||||
this.distributMoney = distributMoney;
|
||||
}
|
||||
|
||||
public Double getFrozenMoney() {
|
||||
return frozenMoney;
|
||||
}
|
||||
|
||||
public void setFrozenMoney(Double frozenMoney) {
|
||||
this.frozenMoney = frozenMoney;
|
||||
}
|
||||
|
||||
public Integer getUnderlingNumber() {
|
||||
return underlingNumber;
|
||||
}
|
||||
|
||||
public void setUnderlingNumber(Integer underlingNumber) {
|
||||
this.underlingNumber = underlingNumber;
|
||||
}
|
||||
|
||||
public Integer getPayPoints() {
|
||||
return payPoints;
|
||||
}
|
||||
|
||||
public void setPayPoints(Integer payPoints) {
|
||||
this.payPoints = payPoints;
|
||||
}
|
||||
|
||||
|
||||
public Integer getAddressId() {
|
||||
return addressId;
|
||||
}
|
||||
|
||||
public void setAddressId(Integer addressId) {
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getCreateAt() {
|
||||
return createAt;
|
||||
}
|
||||
|
||||
public void setCreateAt(Date createAt) {
|
||||
this.createAt = createAt;
|
||||
}
|
||||
|
||||
public Long getStatusTime() {
|
||||
return statusTime;
|
||||
}
|
||||
|
||||
public void setStatusTime(Long statusTime) {
|
||||
this.statusTime = statusTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreMember{" +
|
||||
"id=" + id +
|
||||
", vipNo=" + vipNo +
|
||||
", openid=" + openid +
|
||||
", phone=" + phone +
|
||||
", password=" + password +
|
||||
", nickname=" + nickname +
|
||||
", headimg=" + headimg +
|
||||
", sex=" + sex +
|
||||
", level=" + level +
|
||||
", totalAmount=" + totalAmount +
|
||||
", userMoney=" + userMoney +
|
||||
", distributMoney=" + distributMoney +
|
||||
", frozenMoney=" + frozenMoney +
|
||||
", underlingNumber=" + underlingNumber +
|
||||
", payPoints=" + payPoints +
|
||||
", addressId=" + addressId +
|
||||
", remark=" + remark +
|
||||
", status=" + status +
|
||||
", createTime=" + createTime +
|
||||
", createAt=" + createAt +
|
||||
", statusTime=" + statusTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商城会员收货地址
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
@TableName("store_member_address")
|
||||
public class StoreMemberAddress extends Model<StoreMemberAddress> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private Long mid;
|
||||
/**
|
||||
* 收货人姓名
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 收货手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 收货地址省份
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 收货地址城市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 收货地址区域
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* 城市信息
|
||||
*/
|
||||
@TableField("city_info")
|
||||
private String cityInfo;
|
||||
/**
|
||||
* 收货详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 状态(0无效, 1新快递)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 默认收货地址
|
||||
*/
|
||||
@TableField("is_default")
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 删除状态(1删除,0未删除)
|
||||
*/
|
||||
@TableField("is_deleted")
|
||||
private Long isDeleted;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_at")
|
||||
private Date createAt;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getMid() {
|
||||
return mid;
|
||||
}
|
||||
|
||||
public void setMid(Long mid) {
|
||||
this.mid = mid;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getCityInfo() {
|
||||
return cityInfo;
|
||||
}
|
||||
|
||||
public void setCityInfo(String cityInfo) {
|
||||
this.cityInfo = cityInfo;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getIsDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(Integer isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
public Long getIsDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
public void setIsDeleted(Long isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
public Date getCreateAt() {
|
||||
return createAt;
|
||||
}
|
||||
|
||||
public void setCreateAt(Date createAt) {
|
||||
this.createAt = createAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreMemberAddress{" +
|
||||
", id=" + id +
|
||||
", mid=" + mid +
|
||||
", username=" + username +
|
||||
", phone=" + phone +
|
||||
", province=" + province +
|
||||
", city=" + city +
|
||||
", area=" + area +
|
||||
", cityInfo=" + cityInfo +
|
||||
", address=" + address +
|
||||
", status=" + status +
|
||||
", isDefault=" + isDefault +
|
||||
", isDeleted=" + isDeleted +
|
||||
", createAt=" + createAt +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单主表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-06-26
|
||||
*/
|
||||
@TableName("store_order")
|
||||
@Data
|
||||
public class StoreOrder extends Model<StoreOrder> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@TableId(value = "order_id", type = IdType.AUTO)
|
||||
private Integer orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@TableField("order_sn")
|
||||
private String orderSn;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Integer userId;
|
||||
/**
|
||||
* 订单状态 0-未确认 1-已确认(已收货) 2-已评价
|
||||
*/
|
||||
@TableField("order_status")
|
||||
private Integer orderStatus;
|
||||
/**
|
||||
* 发货状态 0-未发货 1-已发货 2-退货中 3-退货完成
|
||||
*/
|
||||
@TableField("shipping_status")
|
||||
private Integer shippingStatus;
|
||||
/**
|
||||
* 支付状态 0-未支付 1-已支付
|
||||
*/
|
||||
@TableField("pay_status")
|
||||
private Integer payStatus;
|
||||
/**
|
||||
* 收货人
|
||||
*/
|
||||
private String consignee;
|
||||
/**
|
||||
* 国家
|
||||
*/
|
||||
private Integer country;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private Integer province;
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private Integer city;
|
||||
/**
|
||||
* 县区
|
||||
*/
|
||||
private Integer district;
|
||||
/**
|
||||
* 乡镇
|
||||
*/
|
||||
private Integer twon;
|
||||
/**
|
||||
* 地区地址
|
||||
*/
|
||||
@TableField("city_info")
|
||||
private String cityInfo;
|
||||
/**
|
||||
* 地址详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 邮政编码
|
||||
*/
|
||||
private String zipcode;
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 邮件
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 收货方式 1-物流/快递 2-自取
|
||||
*/
|
||||
@TableField("receive_type")
|
||||
private Integer receiveType;
|
||||
/**
|
||||
* 物流code 单号
|
||||
*/
|
||||
@TableField("shipping_code")
|
||||
private String shippingCode;
|
||||
/**
|
||||
* 物流名称
|
||||
*/
|
||||
@TableField("shipping_name")
|
||||
private String shippingName;
|
||||
/**
|
||||
* 支付code
|
||||
*/
|
||||
@TableField("pay_code")
|
||||
private String payCode;
|
||||
/**
|
||||
* 支付方式1-微信2-余额3-转账
|
||||
*/
|
||||
@TableField("pay_method")
|
||||
private Integer payMethod;
|
||||
/**
|
||||
* 支付方式为转账的转账id
|
||||
*/
|
||||
@TableField("recharge_id")
|
||||
private Integer rechargeId;
|
||||
/**
|
||||
* 支付方式名称
|
||||
*/
|
||||
@TableField("pay_name")
|
||||
private String payName;
|
||||
/**
|
||||
* 发票抬头
|
||||
*/
|
||||
@TableField("invoice_title")
|
||||
private String invoiceTitle;
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxpayer;
|
||||
/**
|
||||
* 商品总价
|
||||
*/
|
||||
@TableField("goods_price")
|
||||
private BigDecimal goodsPrice;
|
||||
/**
|
||||
* 邮费
|
||||
*/
|
||||
@TableField("shipping_price")
|
||||
private BigDecimal shippingPrice;
|
||||
/**
|
||||
* 使用余额
|
||||
*/
|
||||
@TableField("user_money")
|
||||
private BigDecimal userMoney;
|
||||
/**
|
||||
* 优惠券抵扣
|
||||
*/
|
||||
@TableField("coupon_price")
|
||||
private BigDecimal couponPrice;
|
||||
|
||||
/**
|
||||
* 使用积分
|
||||
*/
|
||||
private Integer integral;
|
||||
/**
|
||||
* 使用积分抵多少钱
|
||||
*/
|
||||
@TableField("integral_money")
|
||||
private BigDecimal integralMoney;
|
||||
/**
|
||||
* 应付款金额
|
||||
*/
|
||||
@TableField("order_amount")
|
||||
private BigDecimal orderAmount;
|
||||
/**
|
||||
* 订单总价
|
||||
*/
|
||||
@TableField("total_amount")
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@TableField(value = "add_time",fill = FieldFill.INSERT)
|
||||
private Date addTime;
|
||||
/**
|
||||
* 最后新发货时间
|
||||
*/
|
||||
@TableField("shipping_time")
|
||||
private Integer shippingTime;
|
||||
/**
|
||||
* 收货确认时间
|
||||
*/
|
||||
@TableField("confirm_time")
|
||||
private Integer confirmTime;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@TableField("pay_time")
|
||||
private Integer payTime;
|
||||
/**
|
||||
* 第三方平台交易流水号
|
||||
*/
|
||||
@TableField("transaction_id")
|
||||
private String transactionId;
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
@TableField("prom_id")
|
||||
private Integer promId;
|
||||
/**
|
||||
* 订单类型:0普通订单4预售订单5虚拟订单6拼团订单
|
||||
*/
|
||||
@TableField("prom_type")
|
||||
private Integer promType;
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
@TableField("order_prom_id")
|
||||
private Integer orderPromId;
|
||||
/**
|
||||
* 活动优惠金额
|
||||
*/
|
||||
@TableField("order_prom_amount")
|
||||
private BigDecimal orderPromAmount;
|
||||
@TableField("edit_money")
|
||||
private String editMoney;
|
||||
/**
|
||||
* 价格调整(会员折扣金额)
|
||||
*/
|
||||
private BigDecimal discount;
|
||||
/**
|
||||
* 用户备注
|
||||
*/
|
||||
@TableField("user_note")
|
||||
private String userNote;
|
||||
/**
|
||||
* 管理员备注
|
||||
*/
|
||||
@TableField("admin_note")
|
||||
private String adminNote;
|
||||
/**
|
||||
* 父单单号
|
||||
*/
|
||||
@TableField("parent_sn")
|
||||
private String parentSn;
|
||||
/**
|
||||
* 0-普通订单 1-未分成 2-已分成
|
||||
*/
|
||||
@TableField("is_distribut")
|
||||
private Integer isDistribut;
|
||||
/**
|
||||
* 订金
|
||||
*/
|
||||
@TableField("paid_money")
|
||||
private BigDecimal paidMoney;
|
||||
/**
|
||||
* 删除|取消时间
|
||||
*/
|
||||
@TableField("deleted_time")
|
||||
private Integer deletedTime;
|
||||
/**
|
||||
* 用户假删除标识,1:删除,0未删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import co.yixiang.app.modular.shop.service.dto.CartAttrDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单商品表与订单主表关联
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
@TableName("store_order_goods")
|
||||
@Data
|
||||
public class StoreOrderGoods extends Model<StoreOrderGoods> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 表id自增
|
||||
*/
|
||||
@TableId(value = "rec_id", type = IdType.AUTO)
|
||||
private Integer recId;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@TableField("order_id")
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@TableField("goods_name")
|
||||
private String goodsName;
|
||||
|
||||
@TableField("goods_logo")
|
||||
private String goodsLogo;
|
||||
/**
|
||||
* 商品货号
|
||||
*/
|
||||
@TableField("goods_sn")
|
||||
private String goodsSn;
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
@TableField("goods_num")
|
||||
private Integer goodsNum;
|
||||
/**
|
||||
* 市场价
|
||||
*/
|
||||
@TableField("market_price")
|
||||
private BigDecimal marketPrice;
|
||||
/**
|
||||
* 本店价(供货价)
|
||||
*/
|
||||
@TableField("goods_price")
|
||||
private BigDecimal goodsPrice;
|
||||
/**
|
||||
* 商品成本价
|
||||
*/
|
||||
@TableField("cost_price")
|
||||
private BigDecimal costPrice;
|
||||
/**
|
||||
* 会员折扣价
|
||||
*/
|
||||
@TableField("member_goods_price")
|
||||
private BigDecimal memberGoodsPrice;
|
||||
/**
|
||||
* 购买商品赠送积分
|
||||
*/
|
||||
@TableField("give_integral")
|
||||
private Integer giveIntegral;
|
||||
/**
|
||||
* 商品规格key
|
||||
*/
|
||||
@TableField("spec_key")
|
||||
private String specKey;
|
||||
/**
|
||||
* 规格对应的中文名字
|
||||
*/
|
||||
@TableField("spec_key_name")
|
||||
private String specKeyName;
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
@TableField("bar_code")
|
||||
private String barCode;
|
||||
/**
|
||||
* 是否评价
|
||||
*/
|
||||
@TableField("is_comment")
|
||||
private Integer isComment;
|
||||
/**
|
||||
* 0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售
|
||||
*/
|
||||
@TableField("prom_type")
|
||||
private Integer promType;
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
@TableField("prom_id")
|
||||
private Integer promId;
|
||||
/**
|
||||
* 0未发货,1已发货,2已换货,3已退货
|
||||
*/
|
||||
@TableField("is_send")
|
||||
private Integer isSend;
|
||||
/**
|
||||
* 发货单ID
|
||||
*/
|
||||
@TableField("delivery_id")
|
||||
private Integer deliveryId;
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<CartAttrDTO> specList;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 积分/余额日志(流水)表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-15
|
||||
*/
|
||||
@TableName("store_points_money_log")
|
||||
public class StorePointsMoneyLog extends Model<StorePointsMoneyLog> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 日志id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的订单id 充值d订单或者消费订单
|
||||
*/
|
||||
@TableField("order_id")
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 所有者的用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Integer userId;
|
||||
/**
|
||||
* 积分或者红包日志标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 积分变动数量,亿级
|
||||
*/
|
||||
@TableField("points_number")
|
||||
private Integer pointsNumber;
|
||||
/**
|
||||
* 红包变动数量,亿级
|
||||
*/
|
||||
@TableField("money_number")
|
||||
private BigDecimal moneyNumber;
|
||||
/**
|
||||
* 会员红包或者积分变动类型:1支入,2-支出
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 添加时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
//@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
|
||||
private Integer createTime;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Integer orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getPointsNumber() {
|
||||
return pointsNumber;
|
||||
}
|
||||
|
||||
public void setPointsNumber(Integer pointsNumber) {
|
||||
this.pointsNumber = pointsNumber;
|
||||
}
|
||||
|
||||
public BigDecimal getMoneyNumber() {
|
||||
return moneyNumber;
|
||||
}
|
||||
|
||||
public void setMoneyNumber(BigDecimal moneyNumber) {
|
||||
this.moneyNumber = moneyNumber;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Integer createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StorePointsMoneyLog{" +
|
||||
", id=" + id +
|
||||
", orderId=" + orderId +
|
||||
", userId=" + userId +
|
||||
", title=" + title +
|
||||
", pointsNumber=" + pointsNumber +
|
||||
", moneyNumber=" + moneyNumber +
|
||||
", type=" + type +
|
||||
", createTime=" + createTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品规格表(独立)
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@TableName("store_spec")
|
||||
public class StoreSpec extends Model<StoreSpec> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规格表
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 规格类型
|
||||
*/
|
||||
@TableField("type_id")
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 规格名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 是否需要检索:1是,0否
|
||||
*/
|
||||
@TableField("search_index")
|
||||
private Integer searchIndex;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Integer typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Integer getSearchIndex() {
|
||||
return searchIndex;
|
||||
}
|
||||
|
||||
public void setSearchIndex(Integer searchIndex) {
|
||||
this.searchIndex = searchIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreSpec{" +
|
||||
", id=" + id +
|
||||
", typeId=" + typeId +
|
||||
", name=" + name +
|
||||
", sort=" + sort +
|
||||
", searchIndex=" + searchIndex +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品规格关联价格表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@TableName("store_spec_goods_price")
|
||||
public class StoreSpecGoodsPrice extends Model<StoreSpecGoodsPrice> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规格商品id
|
||||
*/
|
||||
@TableId(value = "item_id", type = IdType.AUTO)
|
||||
private Long itemId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 规格键名
|
||||
*/
|
||||
@TableField("`key`")
|
||||
private String key;
|
||||
/**
|
||||
* 规格键名中文
|
||||
*/
|
||||
@TableField("key_name")
|
||||
private String keyName;
|
||||
/**
|
||||
* 价格(供货价格)
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 零售价格
|
||||
*/
|
||||
@TableField("market_price")
|
||||
private Double marketPrice;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@TableField("store_count")
|
||||
private Integer storeCount;
|
||||
/**
|
||||
* 商品条形码
|
||||
*/
|
||||
@TableField("bar_code")
|
||||
private String barCode;
|
||||
/**
|
||||
* SKU
|
||||
*/
|
||||
private String sku;
|
||||
/**
|
||||
* 规格商品主图
|
||||
*/
|
||||
@TableField("spec_img")
|
||||
private String specImg;
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
@TableField("prom_id")
|
||||
private Integer promId;
|
||||
/**
|
||||
* 参加活动类型
|
||||
*/
|
||||
@TableField("prom_type")
|
||||
private Integer promType;
|
||||
|
||||
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Integer getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(Integer goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKeyName() {
|
||||
return keyName;
|
||||
}
|
||||
|
||||
public void setKeyName(String keyName) {
|
||||
this.keyName = keyName;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Double getMarketPrice() {
|
||||
return marketPrice;
|
||||
}
|
||||
|
||||
public void setMarketPrice(Double marketPrice) {
|
||||
this.marketPrice = marketPrice;
|
||||
}
|
||||
|
||||
public Integer getStoreCount() {
|
||||
return storeCount;
|
||||
}
|
||||
|
||||
public void setStoreCount(Integer storeCount) {
|
||||
this.storeCount = storeCount;
|
||||
}
|
||||
|
||||
public String getBarCode() {
|
||||
return barCode;
|
||||
}
|
||||
|
||||
public void setBarCode(String barCode) {
|
||||
this.barCode = barCode;
|
||||
}
|
||||
|
||||
public String getSku() {
|
||||
return sku;
|
||||
}
|
||||
|
||||
public void setSku(String sku) {
|
||||
this.sku = sku;
|
||||
}
|
||||
|
||||
public String getSpecImg() {
|
||||
return specImg;
|
||||
}
|
||||
|
||||
public void setSpecImg(String specImg) {
|
||||
this.specImg = specImg;
|
||||
}
|
||||
|
||||
public Integer getPromId() {
|
||||
return promId;
|
||||
}
|
||||
|
||||
public void setPromId(Integer promId) {
|
||||
this.promId = promId;
|
||||
}
|
||||
|
||||
public Integer getPromType() {
|
||||
return promType;
|
||||
}
|
||||
|
||||
public void setPromType(Integer promType) {
|
||||
this.promType = promType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.itemId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreSpecGoodsPrice{" +
|
||||
", itemId=" + itemId +
|
||||
", goodsId=" + goodsId +
|
||||
", key=" + key +
|
||||
", keyName=" + keyName +
|
||||
", price=" + price +
|
||||
", marketPrice=" + marketPrice +
|
||||
", storeCount=" + storeCount +
|
||||
", barCode=" + barCode +
|
||||
", sku=" + sku +
|
||||
", specImg=" + specImg +
|
||||
", promId=" + promId +
|
||||
", promType=" + promType +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规格项
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-07
|
||||
*/
|
||||
@TableName("store_spec_item")
|
||||
public class StoreSpecItem extends Model<StoreSpecItem> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规格项id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
@TableField("spec_id")
|
||||
private Integer specId;
|
||||
/**
|
||||
* 规格项
|
||||
*/
|
||||
private String item;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getSpecId() {
|
||||
return specId;
|
||||
}
|
||||
|
||||
public void setSpecId(Integer specId) {
|
||||
this.specId = specId;
|
||||
}
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(String item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StoreSpecItem{" +
|
||||
", id=" + id +
|
||||
", specId=" + specId +
|
||||
", item=" + item +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
package co.yixiang.app.common.persistence.model;
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 微信素材表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-05
|
||||
*/
|
||||
@TableName("wechat_news_article")
|
||||
public class WechatNewsArticle extends Model<WechatNewsArticle> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 素材标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 永久素材显示URL
|
||||
*/
|
||||
@TableField("local_url")
|
||||
private String localUrl;
|
||||
/**
|
||||
* 是否显示封面 0不显示,1 显示
|
||||
*/
|
||||
@TableField("show_cover_pic")
|
||||
private Integer showCoverPic;
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
private String author;
|
||||
/**
|
||||
* 摘要内容
|
||||
*/
|
||||
private String digest;
|
||||
/**
|
||||
* 图文内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 图文消息原文地址
|
||||
*/
|
||||
@TableField("content_source_url")
|
||||
private String contentSourceUrl;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_at")
|
||||
private Date createAt;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("create_by")
|
||||
private Long createBy;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getLocalUrl() {
|
||||
return localUrl;
|
||||
}
|
||||
|
||||
public void setLocalUrl(String localUrl) {
|
||||
this.localUrl = localUrl;
|
||||
}
|
||||
|
||||
public Integer getShowCoverPic() {
|
||||
return showCoverPic;
|
||||
}
|
||||
|
||||
public void setShowCoverPic(Integer showCoverPic) {
|
||||
this.showCoverPic = showCoverPic;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getDigest() {
|
||||
return digest;
|
||||
}
|
||||
|
||||
public void setDigest(String digest) {
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContentSourceUrl() {
|
||||
return contentSourceUrl;
|
||||
}
|
||||
|
||||
public void setContentSourceUrl(String contentSourceUrl) {
|
||||
this.contentSourceUrl = contentSourceUrl;
|
||||
}
|
||||
|
||||
public Date getCreateAt() {
|
||||
return createAt;
|
||||
}
|
||||
|
||||
public void setCreateAt(Date createAt) {
|
||||
this.createAt = createAt;
|
||||
}
|
||||
|
||||
public Long getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(Long createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WechatNewsArticle{" +
|
||||
", id=" + id +
|
||||
", title=" + title +
|
||||
", localUrl=" + localUrl +
|
||||
", showCoverPic=" + showCoverPic +
|
||||
", author=" + author +
|
||||
", digest=" + digest +
|
||||
", content=" + content +
|
||||
", contentSourceUrl=" + contentSourceUrl +
|
||||
", createAt=" + createAt +
|
||||
", createBy=" + createBy +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package co.yixiang.app.common.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
||||
public interface BaseService<T> extends IService<T> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package co.yixiang.app.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import co.yixiang.app.common.service.BaseService;
|
||||
import co.yixiang.app.common.web.param.OrderQueryParam;
|
||||
import co.yixiang.app.common.web.param.QueryParam;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> implements BaseService<T> {
|
||||
|
||||
protected Page setPageParam(QueryParam queryParam) {
|
||||
return setPageParam(queryParam,null);
|
||||
}
|
||||
|
||||
protected Page setPageParam(QueryParam queryParam, OrderItem defaultOrder) {
|
||||
Page page = new Page();
|
||||
// 设置当前页码
|
||||
page.setCurrent(queryParam.getCurrent());
|
||||
// 设置页大小
|
||||
page.setSize(queryParam.getSize());
|
||||
/**
|
||||
* 如果是queryParam是OrderQueryParam,并且不为空,则使用前端排序
|
||||
* 否则使用默认排序
|
||||
*/
|
||||
if (queryParam instanceof OrderQueryParam){
|
||||
OrderQueryParam orderQueryParam = (OrderQueryParam) queryParam;
|
||||
List<OrderItem> orderItems = orderQueryParam.getOrders();
|
||||
if (CollectionUtils.isEmpty(orderItems)){
|
||||
page.setOrders(Arrays.asList(defaultOrder));
|
||||
}else{
|
||||
page.setOrders(orderItems);
|
||||
}
|
||||
}else{
|
||||
page.setOrders(Arrays.asList(defaultOrder));
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package co.yixiang.app.common.utils;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||
*/
|
||||
public class JsonUtils {
|
||||
private static final ObjectMapper JSON = new ObjectMapper();
|
||||
|
||||
static {
|
||||
JSON.setSerializationInclusion(Include.NON_NULL);
|
||||
JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public static String toJson(Object obj) {
|
||||
try {
|
||||
return JSON.writeValueAsString(obj);
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package co.yixiang.app.common.utils;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName OrderUtil
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/9/13
|
||||
**/
|
||||
public class OrderUtil {
|
||||
|
||||
/**
|
||||
* 时间戳订单号
|
||||
* @return
|
||||
*/
|
||||
public static String orderSn(){
|
||||
Date date = DateUtil.date();
|
||||
return DateUtil.format(date,"yyyyMMddHHmmssSSS");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取精确到秒的时间戳
|
||||
* @param date
|
||||
* @return
|
||||
**/
|
||||
public static int getSecondTimestampTwo(){
|
||||
String timestamp = String.valueOf(new Date().getTime()/1000);
|
||||
return Integer.valueOf(timestamp);
|
||||
}
|
||||
|
||||
|
||||
public static int orderStatus(int payStatus,int shippingStatus,int orderStatus){
|
||||
//todo 0-待付款 1-已付款,待发货 2-已发货,待收货 3-退货中 4-退货完成 5-待评价 6-已评价
|
||||
int status = 0;
|
||||
|
||||
if(payStatus == 1 && shippingStatus == 0 && orderStatus == 0){
|
||||
status = 1;
|
||||
}else if(shippingStatus == 1 && orderStatus == 0){
|
||||
status = 2;
|
||||
}else if(shippingStatus == 2) {
|
||||
status = 3;
|
||||
}else if(shippingStatus == 3) {
|
||||
status = 4;
|
||||
}else if (orderStatus == 1){
|
||||
status = 5;
|
||||
}else if (orderStatus == 2){
|
||||
status = 6;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package co.yixiang.app.common.utils;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName 异常工具
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
public class ThrowableUtil {
|
||||
|
||||
/**
|
||||
* 获取堆栈信息
|
||||
* @param throwable
|
||||
* @return
|
||||
*/
|
||||
public static String getStackTrace(Throwable throwable){
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
try {
|
||||
throwable.printStackTrace(pw);
|
||||
return sw.toString();
|
||||
} finally {
|
||||
pw.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package co.yixiang.app.common.utils;
|
||||
|
||||
|
||||
import co.yixiang.app.modular.shop.service.dto.CateDTO;
|
||||
import co.yixiang.app.modular.shop.service.dto.CateDTO;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName TreeUtil
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/9/8
|
||||
**/
|
||||
public class TreeUtil {
|
||||
/**
|
||||
* 获得指定节点下所有归档
|
||||
* @param list
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
public static List<CateDTO> list2TreeConverter(List<CateDTO> list, int parentId) {
|
||||
List<CateDTO> returnList = new ArrayList<>();
|
||||
|
||||
for (CateDTO res : list) {
|
||||
//判断对象是否为根节点
|
||||
|
||||
if (res.getPid() == parentId) {
|
||||
//该节点为根节点,开始递归
|
||||
|
||||
recursionFn(list, res); //通过递归为节点设置childList
|
||||
|
||||
returnList.add(res);
|
||||
}
|
||||
}
|
||||
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
* 通过递归,给指定t节点设置childList
|
||||
* @param list
|
||||
* @param t
|
||||
*/
|
||||
public static void recursionFn(List<CateDTO> list, CateDTO t) {
|
||||
//只能获取当前t节点的子节点集,并不是所有子节点集
|
||||
List<CateDTO> childsList = getChildList(list, t);
|
||||
//设置他的子集对象集
|
||||
t.setChildsList(childsList);
|
||||
|
||||
//迭代子集对象集
|
||||
for (CateDTO nextChild : childsList) { //遍历完,则退出递归
|
||||
|
||||
//判断子集对象是否还有子节点
|
||||
if (!CollectionUtils.isEmpty(childsList)) {
|
||||
//有下一个子节点,继续递归
|
||||
recursionFn(list, nextChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得指定节点下的所有子节点
|
||||
* @param list
|
||||
* @param t
|
||||
* @return
|
||||
*/
|
||||
public static List<CateDTO> getChildList(List<CateDTO> list, CateDTO t) {
|
||||
List<CateDTO> childsList = new ArrayList<CateDTO>();
|
||||
//遍历集合元素,如果元素的Parentid==指定元素的id,则说明是该元素的子节点
|
||||
for (CateDTO t1 : list) {
|
||||
if (t1.getPid() == t.getId() ) {
|
||||
childsList.add(t1);
|
||||
}
|
||||
}
|
||||
|
||||
return childsList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否还有下一个子节点
|
||||
* @param list
|
||||
* @param t
|
||||
*/
|
||||
public static boolean hasChild(List<CateDTO> list, CateDTO t) {
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
|
||||
package co.yixiang.app.common.web.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/docs")
|
||||
@ApiIgnore
|
||||
public class ApiDocController extends BaseController {
|
||||
|
||||
/**
|
||||
* swaggerUI
|
||||
*/
|
||||
@GetMapping("")
|
||||
public String swaggerUI(){
|
||||
return "redirect:/swagger-ui.html";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
package co.yixiang.app.common.web.controller;
|
||||
|
||||
import co.yixiang.app.common.api.ApiController;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public abstract class BaseController extends ApiController {
|
||||
|
||||
/**
|
||||
* 获取当前请求
|
||||
*
|
||||
* @return request
|
||||
*/
|
||||
public HttpServletRequest getRequest() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
}
|
||||
/**
|
||||
* 获取当前请求
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public HttpServletResponse getResponse() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
package co.yixiang.app.common.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel("ID参数")
|
||||
public class IdParam implements Serializable {
|
||||
private static final long serialVersionUID = -5353973980674510450L;
|
||||
|
||||
@NotBlank(message="ID不能为空")
|
||||
private String id;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
package co.yixiang.app.common.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel("主键状态VO")
|
||||
public class IdStatusParam implements Serializable {
|
||||
private static final long serialVersionUID = -7581307955242965701L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("状态,1:启用 0:禁用")
|
||||
private Integer status;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "IdStatusVo{" +
|
||||
"id='" + id + '\'' +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
package co.yixiang.app.common.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@ApiModel("名称参数")
|
||||
public class NameParam implements Serializable {
|
||||
private static final long serialVersionUID = -3710501706034574149L;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NameParam{" +
|
||||
"name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
package co.yixiang.app.common.web.param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("可排序查询参数对象")
|
||||
public abstract class OrderQueryParam extends QueryParam{
|
||||
private static final long serialVersionUID = 57714391204790143L;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private List<OrderItem> orders;
|
||||
|
||||
public void defaultOrder(OrderItem orderItem){
|
||||
this.defaultOrders(Arrays.asList(orderItem));
|
||||
}
|
||||
|
||||
public void defaultOrders(List<OrderItem> orderItems){
|
||||
if (CollectionUtils.isEmpty(orderItems)){
|
||||
return;
|
||||
}
|
||||
this.orders = orderItems;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
|
||||
package co.yixiang.app.common.web.param;
|
||||
|
||||
import co.yixiang.app.common.constant.CommonConstant;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel("查询参数对象")
|
||||
public abstract class QueryParam implements Serializable{
|
||||
private static final long serialVersionUID = -3263921252635611410L;
|
||||
|
||||
@ApiModelProperty(value = "页码,默认为1")
|
||||
private Integer current = CommonConstant.DEFAULT_PAGE_INDEX;
|
||||
@ApiModelProperty(value = "页大小,默认为10")
|
||||
private Integer size = CommonConstant.DEFAULT_PAGE_SIZE;
|
||||
@ApiModelProperty(value = "搜索字符串")
|
||||
private String keyword;
|
||||
|
||||
public void setCurrent(Integer current) {
|
||||
if (current == null || current <= 0){
|
||||
this.current = CommonConstant.DEFAULT_PAGE_INDEX;
|
||||
}else{
|
||||
this.current = current;
|
||||
}
|
||||
}
|
||||
|
||||
public void setSize(Integer size) {
|
||||
if (size == null || size <= 0){
|
||||
this.size = CommonConstant.DEFAULT_PAGE_SIZE;
|
||||
}else{
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
|
||||
package co.yixiang.app.common.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
@ApiModel("ID-NAME-VO")
|
||||
public class CommonIdName {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public CommonIdName(String id, String name) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public CommonIdName() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CommonIdName [id=" + id + ", name=" + name + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
|
||||
|
||||
package co.yixiang.app.common.web.vo;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ApiModel("分页")
|
||||
public class Paging<T> implements Serializable {
|
||||
private static final long serialVersionUID = -1683800405530086022L;
|
||||
|
||||
@ApiModelProperty("总行数")
|
||||
@JSONField(name = "total")
|
||||
@JsonProperty("total")
|
||||
private long total = 0;
|
||||
|
||||
@ApiModelProperty("数据列表")
|
||||
@JSONField(name = "records")
|
||||
@JsonProperty("records")
|
||||
private List<T> records = Collections.emptyList();
|
||||
|
||||
public Paging() {
|
||||
}
|
||||
|
||||
public Paging(IPage page) {
|
||||
this.total = page.getTotal();
|
||||
this.records = page.getRecords();
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<T> getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
public void setRecords(List<T> records) {
|
||||
this.records = records;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Paging{" +
|
||||
"total=" + total +
|
||||
", records=" + records +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
package co.yixiang.app.modular.auth.controller;
|
||||
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
||||
import co.yixiang.app.common.R;
|
||||
import co.yixiang.app.common.persistence.model.StoreMember;
|
||||
import co.yixiang.app.modular.member.service.IMemberService;
|
||||
import co.yixiang.app.modular.member.service.vo.LoginVO;
|
||||
import com.baomidou.shaun.core.profile.TokenProfile;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.shaun.core.mgt.SecurityManager;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @ClassName 登陆授权
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "认证授权模块", tags = "认证授权模块", description = "认证授权模块")
|
||||
public class AuthController {
|
||||
private final IMemberService memberService;
|
||||
private final WxMaService wxService;
|
||||
private final SecurityManager securityManager;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 小程序登陆,颁发token,暂时模拟openid
|
||||
*
|
||||
* @return token字符串
|
||||
*/
|
||||
@PostMapping("/oauth/access_token")
|
||||
@ApiOperation(value = "获取token",notes = "获取token")
|
||||
public R loginReturnToken(@Validated @RequestBody LoginVO loginVO) {
|
||||
Boolean isProduct = false; //true 开启真实小程序环境
|
||||
String openid = "orIMY4xGhMmipwFZoSL1vOhUNFZ0";
|
||||
WxMaUserInfo userInfo = null;
|
||||
try{
|
||||
if(isProduct){
|
||||
WxMaJscode2SessionResult session = wxService.getUserService()
|
||||
.getSessionInfo(loginVO.getCode());
|
||||
log.info(session.getSessionKey());
|
||||
log.info(session.getOpenid());
|
||||
// //TODO 可以增加自己的逻辑,关联业务相关数据
|
||||
//
|
||||
String sessionKey = session.getSessionKey();
|
||||
openid = session.getOpenid();
|
||||
// 解密用户信息
|
||||
userInfo = wxService.getUserService()
|
||||
.getUserInfo(sessionKey, loginVO.getEncrypted_data(), loginVO.getIv());
|
||||
|
||||
}
|
||||
|
||||
StoreMember member = memberService.login(openid);
|
||||
//User user = null;
|
||||
if(member == null){
|
||||
//新用户插入数据
|
||||
StoreMember newMember = new StoreMember();
|
||||
newMember.setOpenid(userInfo.getOpenId());
|
||||
newMember.setNickname(userInfo.getNickName());
|
||||
newMember.setHeadimg(userInfo.getAvatarUrl());
|
||||
newMember.setSex(userInfo.getGender());
|
||||
newMember.setCreateTime(new Date());
|
||||
memberService.save(newMember);
|
||||
member = newMember;
|
||||
}
|
||||
|
||||
final TokenProfile profile = new TokenProfile();
|
||||
profile.setId(member.getId().toString());
|
||||
profile.setUsername(member.getNickname());
|
||||
profile.addRole("user_role");
|
||||
final String token = securityManager.login(profile);
|
||||
|
||||
//String token ="";
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("access_token",token);
|
||||
return R.success(map);
|
||||
} catch (WxErrorException e) {
|
||||
log.error(e.getMessage());
|
||||
return R.error(4000,e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package co.yixiang.app.modular.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
public interface EntityMapper<D, E> {
|
||||
|
||||
/**
|
||||
* DTO转Entity
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
E toEntity(D dto);
|
||||
|
||||
/**
|
||||
* Entity转DTO
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
D toDto(E entity);
|
||||
|
||||
/**
|
||||
* DTO集合转Entity集合
|
||||
* @param dtoList
|
||||
* @return
|
||||
*/
|
||||
List <E> toEntity(List<D> dtoList);
|
||||
|
||||
/**
|
||||
* Entity集合转DTO集合
|
||||
* @param entityList
|
||||
* @return
|
||||
*/
|
||||
List <D> toDto(List<E> entityList);
|
||||
}
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2021
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:本软件为www.yixiang.co开发研制
|
||||
*/
|
||||
package co.yixiang.app.modular.member.controller;
|
||||
|
||||
|
||||
import co.yixiang.app.common.R;
|
||||
import co.yixiang.app.common.persistence.model.StoreMember;
|
||||
import co.yixiang.app.modular.member.service.IMemberService;
|
||||
import co.yixiang.app.modular.member.service.dto.MemberDTO;
|
||||
import co.yixiang.app.modular.member.service.impl.AddressServiceImpl;
|
||||
import co.yixiang.app.modular.member.service.mapper.MemberMapper;
|
||||
import co.yixiang.app.modular.member.service.vo.AddressVO;
|
||||
import co.yixiang.app.modular.shop.service.impl.GoodsServiceImpl;
|
||||
import co.yixiang.app.modular.shop.service.impl.OrderServiceImpl;
|
||||
import co.yixiang.app.modular.shop.service.mapper.GoodsMapper;
|
||||
import co.yixiang.app.modular.shop.service.vo.PageVO;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.shaun.core.annotation.HasRole;
|
||||
import com.baomidou.shaun.core.context.ProfileHolder;
|
||||
import com.baomidou.shaun.core.profile.TokenProfile;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName 个人中心
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/6/27
|
||||
**/
|
||||
|
||||
@HasRole("user_role")
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "个人中心", tags = "个人中心模块", description = "个人中心")
|
||||
public class UserController {
|
||||
private final IMemberService memberService;
|
||||
private final MemberMapper memberMapper;
|
||||
private final AddressServiceImpl addressService;
|
||||
private final GoodsServiceImpl goodsService;
|
||||
private final GoodsMapper goodsMapper;
|
||||
private final OrderServiceImpl orderService;
|
||||
|
||||
@GetMapping(value = "/shop/user-my-info")
|
||||
@ApiOperation(value = "我的个人信息",notes = "我的个人信息")
|
||||
public R userInfo(){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
StoreMember member = memberService.getById(userId);
|
||||
MemberDTO memberDTO = memberMapper.toDto(member);
|
||||
Map<String,Integer> mapCount = orderService.countInfo(userId);
|
||||
memberDTO.setCountInfo(mapCount);
|
||||
return R.success(memberDTO);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/shop/user-my-address")
|
||||
@ApiOperation(value = "我的地址列表",notes = "我的地址列表")
|
||||
public R addressList(@RequestParam(value = "page",defaultValue = "0") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
PageVO pageVO = new PageVO();
|
||||
pageVO.setPage(page);
|
||||
pageVO.setLimit(limit);
|
||||
return R.success(addressService.getList(pageVO,userId));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/shop/user-address-add-edit")
|
||||
@ApiOperation(value = "添加或修改地址",notes = "添加或修改地址")
|
||||
public R addAndEditAdress(@Validated @RequestBody AddressVO addressVO){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
boolean result = addressService.addAndEdit(addressVO,userId);
|
||||
if(result){
|
||||
return R.success("操作成功");
|
||||
}else{
|
||||
return R.error(4000,"操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "/shop/user-address-del")
|
||||
@ApiOperation(value = "删除地址",notes = "删除地址")
|
||||
public R delAddress(@Validated @RequestBody String jsonStr){
|
||||
int addressId = Integer.valueOf(JSON.parseObject(jsonStr).get("address_id").toString());
|
||||
boolean result = addressService.removeById(addressId);
|
||||
if(result){
|
||||
return R.success("操作成功");
|
||||
}else{
|
||||
return R.error(4000,"操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/shop/user-my-coupons")
|
||||
@ApiOperation(value = "我的优惠券",notes = "我的优惠券")
|
||||
public R myCoupons(@RequestParam(value = "orderTotalPrice",defaultValue = "0") double orderTotalPrice){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
return R.success(memberService.couponList(userId,orderTotalPrice));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/shop/user-my-collects")
|
||||
@ApiOperation(value = "我的收藏列表",notes = "我的收藏列表")
|
||||
public R myCollect(@RequestParam(value = "page",defaultValue = "0") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
PageVO pageVO = new PageVO();
|
||||
pageVO.setPage(page);
|
||||
pageVO.setLimit(limit);
|
||||
return R.success(goodsMapper.toDto(goodsService
|
||||
.collectGoods(pageVO.getPage(),pageVO.getLimit(),userId)));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/shop/user-order-list")
|
||||
@ApiOperation(value = "订单列表",notes = "订单列表")
|
||||
public R orderList(@RequestParam(value = "status",defaultValue = "0") int status,
|
||||
@RequestParam(value = "page",defaultValue = "1") int page,
|
||||
@RequestParam(value = "page_num",defaultValue = "10") int limit){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
return R.success(orderService.orderList(status,userId,page,limit));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/shop/user-order-detail")
|
||||
@ApiOperation(value = "订单详情",notes = "订单详情")
|
||||
public R orderDetail(@RequestParam(value = "order_id",defaultValue = "0") String orderId){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
return R.success(orderService.orderDetail(orderId,userId));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/shop/user-order-handle")
|
||||
@ApiOperation(value = "订单操作",notes = "订单操作")
|
||||
public R handleOrder(@Validated @RequestBody String jsonStr){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
int orderId = Integer.valueOf(JSON.parseObject(jsonStr).get("order_id").toString());
|
||||
int type = Integer.valueOf(JSON.parseObject(jsonStr).get("type").toString());
|
||||
orderService.orderHandle(orderId,type,userId);
|
||||
return R.success("操作成功");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/shop/user-points-money-logs")
|
||||
@ApiOperation(value = "获取积分或者余额流水",notes = "获取积分或者余额流水")
|
||||
public R pointsMoneyLogs(@RequestParam(value = "type",defaultValue = "1") int type,
|
||||
@RequestParam(value = "page",defaultValue = "1") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||
TokenProfile profile = ProfileHolder.getProfile();
|
||||
int userId = Integer.valueOf(profile.getId());
|
||||
return R.success(orderService.pointsMoneyLogs(type,userId,page,limit));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@GetMapping(value = "/super")
|
||||
@PreAuthorize("hasAllRoles('user','admin')")
|
||||
@ApiOperation(value = "超管测试信息",notes = "超管测试信息")
|
||||
public R superInfo(){
|
||||
return R.success("超级管理员才可以访问的权限");
|
||||
}
|
||||
**/
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package co.yixiang.app.modular.member.service;
|
||||
|
||||
|
||||
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreMemberAddress;
|
||||
import co.yixiang.app.modular.member.service.vo.AddressVO;
|
||||
import co.yixiang.app.modular.shop.service.vo.PageVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import co.yixiang.app.modular.member.service.dto.AddressDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAddressService extends IService<StoreMemberAddress> {
|
||||
|
||||
List<AddressDTO> getList(PageVO pageVO, int userId);
|
||||
|
||||
boolean addAndEdit(AddressVO addressVO, int userId);
|
||||
|
||||
AddressDTO findDefault(int userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package co.yixiang.app.modular.member.service;
|
||||
|
||||
|
||||
|
||||
|
||||
import co.yixiang.app.common.persistence.model.StoreMember;
|
||||
import co.yixiang.app.modular.shop.service.dto.CouponDTO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import co.yixiang.app.common.persistence.model.StoreMember;
|
||||
import co.yixiang.app.modular.member.service.dto.MemberDTO;
|
||||
import co.yixiang.app.modular.shop.service.dto.CouponDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IMemberService extends IService<StoreMember> {
|
||||
StoreMember login(String openid);
|
||||
|
||||
List<MemberDTO> memeberList();
|
||||
|
||||
List<CouponDTO> couponList(int userId, double orderTotalPrice);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package co.yixiang.app.modular.member.service.dto;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商城会员收货地址
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-09-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AddressDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 收货人姓名
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 收货手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
private String cityInfo;
|
||||
|
||||
private String address;
|
||||
|
||||
private Integer isDefault;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package co.yixiang.app.modular.member.service.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Data
|
||||
public class MemberDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Integer storeId;
|
||||
|
||||
/**
|
||||
* unionid唯一标识
|
||||
*/
|
||||
private String unionid;
|
||||
/**
|
||||
* 会员手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 会员昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 会员头像
|
||||
*/
|
||||
private String headimg;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 会员级别
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 消费累计额度 用于用户等级
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 用户金额
|
||||
*/
|
||||
private BigDecimal userMoney;
|
||||
|
||||
/**
|
||||
* 冻结金额
|
||||
*/
|
||||
private Double frozenMoney;
|
||||
|
||||
|
||||
/**
|
||||
* 消费积分(可用积分)
|
||||
*/
|
||||
private Integer payPoints;
|
||||
|
||||
/**
|
||||
* 默认收货地址
|
||||
*/
|
||||
private Integer addressId;
|
||||
/**
|
||||
* 会员个性签名
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 会员状态0待审核 1-已审核 2-已拒绝
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private Map<String,Integer> countInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loaded 100 of 1011 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user