master
宣庆姣 2 years ago
parent 868520e697
commit 467425f01a

10
.gitignore vendored

@ -1,10 +0,0 @@
# Created by .ignore support plugin (hsz.mobi)
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen
target

@ -1,11 +0,0 @@
FROM nginx:alpine
COPY uidocker/conf.d /etc/nginx/conf.d
COPY src/main/ui /var/www/royalpay
COPY uidocker/upstream.conf.tpl /opt/upstream.conf.tpl
EXPOSE 80
CMD envsubst < /opt/upstream.conf.tpl > /etc/nginx/conf.d/upstream.conf && cat /etc/nginx/conf.d/upstream.conf && exec nginx -g 'daemon off;'

@ -1,137 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!--编码字符集-->
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java"/>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="FileLength">
<property name="max" value="1000"/>
<property name="severity" value="error"/>
</module>
<!--检查项规则配置-->
<module name="TreeWalker">
<!-- 命名检查 -->
<module name="AbbreviationAsWordInName"/>
<module name="AbstractClassName">
<property name="ignoreModifier" value="true"/>
</module>
<module name="CatchParameterName"/>
<module name="ClassTypeParameterName"/>
<module name="ConstantName"/>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[a-zA-Z]$"/>
</module>
<module name="LambdaParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="severity" value="error"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z]([a-zA-Z0-9])*$"/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[a-zA-Z]$"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][_a-zA-Z0-9]+$"/>
</module>
<module name="StaticVariableName">
<property name="format" value="^[a-z](_?[a-zA-Z0-9]+)*$"/>
</module>
<module name="TypeName">
<property name="format" value="^[A-Z](_?[a-zA-Z0-9]+)*$"/>
</module>
<module name="TypeName">
<property name="format"
value="^I_[a-zA-Z0-9]*$"/>
<property name="tokens"
value="INTERFACE_DEF"/>
</module>
<!--
空格检查,该检查是为了增加代码的可读性、可维护性
-->
<module name="EmptyForInitializerPad">
<property name="option" value="nospace"/>
</module>
<module name="EmptyForIteratorPad">
<property name="option" value="space"/>
</module>
<module name="EmptyLineSeparator">
<property name="tokens" value="VARIABLE_DEF, METHOD_DEF"/>
</module>
<module name="MethodParamPad">
<property name="tokens" value="METHOD_DEF"/>
<property name="option" value="nospace"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="NoLineWrap">
<property name="tokens" value="IMPORT"/>
</module>
<module name="NoWhitespaceAfter">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="SingleSpaceSeparator"/>
<module name="TypecastParenPad">
<property name="option" value="space"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI, TYPECAST, LITERAL_ELSE"/>
</module>
<module name="WhitespaceAround">
<!-- else、catch、finally、赋值符、运算符、连接符-->
<property name="tokens" value="ASSIGN, BOR, BOR_ASSIGN, EQUAL, GE, GT, LAMBDA, LAND, LE, LITERAL_CATCH, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_SYNCHRONIZED, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
</module>
<!--
Size检查依然是解决可读性
方法体大小、文件大小等
-->
<module name="AnonInnerLength">
<property name="max" value="80"/>
<property name="severity" value="error"/>
</module>
<module name="ExecutableStatementCount"/>
<module name="MethodCount">
<property name="maxTotal" value="30"/>
<property name="severity" value="error"/>
</module>
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF"/>
<property name="max" value="80"/>
<property name="countEmpty" value="false"/>
<property name="severity" value="error"/>
</module>
<module name="OuterTypeNumber"/>
<module name="ParameterNumber"/>
<!-- NeedBraces 检查是否应该使用括号的地方没有加括号
tokens: 定义检查的类型 -->
<module name="NeedBraces">
<property name="severity" value="error"/>
</module>
<!-- if-else嵌套语句个数 最多4层 -->
<module name="NestedIfDepth">
<property name="max" value="3"/>
<property name="severity" value="error"/>
</module>
</module>
</module>

@ -1,62 +0,0 @@
#! /bin/bash
# @author:haloo#
#@func:pre-commit#
## cp ./checkstyle/pre-commit ./.git/hooks/
echo 避免NPE是程序员的基本修养
echo 开始style checking
wd=`pwd`
echo "当前工作目录:$wd"
# check-style版本号
check_style_version="checkstyle-8.38-all.jar"
check_style_xml_name="GeekCheckStyle.xml"
check_jar_path="$wd/checkstyle/$check_style_version"
check_xml_path="$wd/checkstyle/$check_style_xml_name"
## 清空temp文件
rm -f temp
is_err=0
errorCount=0
warnCount=0
## 查找add到git 缓冲区中,以.java后缀的文件
for file in `git status --porcelain | sed s/^...// | grep '\.java$'`; do
path="$wd/$file"
echo "检查文件: $path"
re=`java -jar $check_jar_path -c $check_xml_path $path >> temp`
warn=`cat temp | grep "WARN"`
if [[ $warn = *"WARN"* ]];then
echo "${warn}"
needle="WARN"
number_of_occurrences=$(grep -o "$needle" <<< "$warn" | wc -l)
((warnCount = warnCount + number_of_occurrences))
is_err=1
fi
err=`cat temp | grep "ERROR"`
if [[ $err = *"ERROR"* ]];then
echo "${err}"
needle="ERROR"
number_of_occurrences=$(grep -o "$needle" <<< "$err" | wc -l)
((errorCount = errorCount + number_of_occurrences))
is_err=1
fi
done
echo "检查完成,祝你好运"
rm -f temp
if [ $is_err -ne 0 ];then
echo "出现了 $errorCount 个error"
echo "出现了 $warnCount 个warn"
echo "请先符合style才能提交"
exit 1
fi
echo "No Bug ,It is Good!!"
exit 0

Binary file not shown.

Binary file not shown.

@ -1,15 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQC72cPSVWP66+5iDU+Yyg6ODfjDeb+nty90e5UtESIB1YOn4qaq
gjPiNgDZUDpaUhHKCW95U/V3pQi2FBbIj16z8uAAxVe+Uz45NlWhBIT9+4PY57oF
yLkaVCr/6Kwir/ql28cvwkhkbrQ2veOpGd7/W8UpMjWMyNuZGelEibmBKQIDAQAB
AoGABdjpd4qg6had/P9dEux3N4TH0Y3goV/aYk3Wfuihnlz/FCLB/VzAMLJtpFYS
+uzDEP7qMWSjp23Dr6dAbk3ILNQgogrJ4a4z9Uq9fVYt8lBo/T98hjR1xSXDJEQS
FsUw8XRbYGFOFxnLzlTjLix1b6+gmTJsKihbETMXBKRl/WECQQDkf0LRjoDCME4H
kgLzm4dq5iCPdJNQLOZT+xJsQy72/RNdnlbYJVO0E9NSo1oIpFtKA2C8z/BTnAUk
5nuLeac/AkEA0nYN1i4TZCyaB0MbGIgFU/dc7aIY/5QIY4oGrs//3CnqLDxU0Doa
yFEQAaZTINa7hy4aZqtPl7rdeYBPFwRllwJBAOIrCRNtbwtHTuT1ZJCGQKrR8Cau
p+WzG6TCnoCkm0cERvfic2lswQY8nW5tm/9z15xR7Z3WYLYRd5IHxP/QQXcCQQC1
fDveUAlEvvlr/cAl3VXK3Gp0OO4Zpsu9Gk88+/yFHFflIXl5vkFOMCj/YzAYB1Pa
9DSsCFowW2GU3sJU9OOtAkBB8WLs1AGsBRdMy9b2ucfeeCDjMip5deLCwX9jii/p
Am5f2ajaEkr60blSbG4sbK/EKZ2uENUZzKqcIje83TB8
-----END RSA PRIVATE KEY-----

@ -1 +0,0 @@
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB

@ -1,102 +0,0 @@
[
{
"code": "hangzhou",
"name": "杭州海关",
"target": [
"HANGZHOU_ZONGSHU"
]
},
{
"code": "guangzhou",
"name": "广州海关",
"target": [
"ZONGSHU"
]
},
{
"code": "zhengzhou",
"name": "河南保税物流中心",
"target": [
"ZHENGZHOU"
]
},
{
"code": "xinzheng",
"name": "新郑综合保税区(空港)",
"target": [
"HENAN",
"ZONGSHU"
]
},
{
"code": "chongqing",
"name": "重庆海关",
"target": [
"ZONGSHU"
]
},
{
"code": "ningbo",
"name": "宁波",
"target": [
"NINGBO"
]
},
{
"code": "shengzhen",
"name": "深圳海关",
"target": [
"SHENZHEN_ZS",
"ZONGSHU"
]
},
{
"code": "shanghai",
"name": "上海海关",
"target": [
"SHANGHAI_CBT"
]
},
{
"code": "xian",
"name": "西安海关",
"target": [
"ZONGSHU"
]
},
{
"code": "NANSHAGJ",
"name": "南沙国检",
"target": [
"NANSHAGJ"
]
},
{
"code": "tianjin",
"name": "天津海关",
"target": [
"ZONGSHU"
]
},
{
"code": "hefei",
"name": "合肥海关",
"target": [
"ZONGSHU"
]
},
{
"code": "suzhou",
"name": "苏州海关",
"target": [
"ZONGSHU"
]
},
{
"code": "guangzhouhuangpu",
"name": "广州黄埔海关",
"target": [
"GUANGZHOU_HUANGPU"
]
}
]

Binary file not shown.

@ -1,2 +0,0 @@
cp checkstyle/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commit

@ -0,0 +1,38 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>kafka</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>4.9.4</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-tools</artifactId>
<version>4.9.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,65 @@
package com.dalong.kafka.producer;
import org.apache.kafka.clients.consumer.*;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import java.time.Duration;
import java.util.*;
public class CustomConsumer {
public static void main(String[] args) {
// 基础配置
Properties properties=new Properties();
properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092");
properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,"XXDD8");
properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"latest");
//自动提交时异步提交
properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true");
//设置分区策略
properties.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,"org.apache.kafka.clients.consumer.RoundRobinAssignor");
// properties.setProperty(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,"");
// properties.setProperty(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,"");
KafkaConsumer kafkaConsumer=new KafkaConsumer(properties);
kafkaConsumer.subscribe(Arrays.asList("dalong1"));
while (true) {
ConsumerRecords records = kafkaConsumer.poll(Duration.ofMillis(0));
if (!records.isEmpty()) {
System.out.println("======>partition:!isEmpty");
Set<TopicPartition> partitions= records.partitions();
for(TopicPartition partition:partitions){
List<ConsumerRecord<String,String>> recordStringList= records.records(partition);//每次poll的时候是取多个分区的数据
//分区获取数据
Iterator<ConsumerRecord<String,String>> iterator= recordStringList.iterator();
//kafka offset是按分区去维护的
while (iterator.hasNext()){
ConsumerRecord<String,String> consumerRecord= iterator.next();
int par= consumerRecord.partition();
long offset= consumerRecord.offset();
String v= consumerRecord.value();
String k=consumerRecord.key();
System.out.println("======>partition:"+partition+"===par:"+par+"====>k:"+k+"=====v:"+v+"===offset:"+offset);
}
}
// System.out.println("============"+records.count()+"==================");
// Iterator<ConsumerRecord> iterator = records.iterator();
// while (iterator.hasNext()) {
// ConsumerRecord consumerRecord = iterator.next();
// int p = consumerRecord.partition();
// long offset = consumerRecord.offset();
// System.out.println("=====>key: " + consumerRecord.key() + "===>partition:" + p + "==offset:" + offset+"=="+consumerRecord.value());
// }
}
}
}
}

@ -0,0 +1,48 @@
package com.dalong.kafka.producer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.serialization.StringDeserializer;
import java.time.Duration;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;
public class CustomConsumer2 {
public static void main(String[] args) {
// 基础配置
Properties properties=new Properties();
properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092");
properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,"XXDD6");
properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"latest");
//自动提交时异步提交
properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true");
//设置分区策略
properties.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,"org.apache.kafka.clients.consumer.RoundRobinAssignor");
// properties.setProperty(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,"");
// properties.setProperty(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,"");
KafkaConsumer kafkaConsumer=new KafkaConsumer(properties);
kafkaConsumer.subscribe(Arrays.asList("dalong1"));
while (true) {
ConsumerRecords records = kafkaConsumer.poll(Duration.ofMillis(0));
if (!records.isEmpty()) {
System.out.println("============》"+records.count()+"《==================");
Iterator<ConsumerRecord> iterator = records.iterator();
while (iterator.hasNext()) {
ConsumerRecord consumerRecord = iterator.next();
int p = consumerRecord.partition();
long offset = consumerRecord.offset();
System.out.println("=====》》key: " + consumerRecord.key() + "===>partition:" + p + "==offset:" + offset+"=="+consumerRecord.value());
}
}
}
}
}

@ -0,0 +1,48 @@
package com.dalong.kafka.producer;
import org.apache.kafka.clients.consumer.*;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import java.time.Duration;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;
public class CustomConsumer3 {
public static void main(String[] args) {
// 基础配置
Properties properties=new Properties();
properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092");
properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,"XXDD6");
properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"latest");
//自动提交时异步提交
properties.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG,"true");
//设置分区策略
properties.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,"org.apache.kafka.clients.consumer.RoundRobinAssignor");
// properties.setProperty(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG,"");
// properties.setProperty(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,"");
KafkaConsumer kafkaConsumer=new KafkaConsumer(properties);
kafkaConsumer.subscribe(Arrays.asList("dalong1"));
while (true) {
ConsumerRecords records = kafkaConsumer.poll(Duration.ofMillis(0));
if (!records.isEmpty()) {
System.out.println("============"+records.count()+"==================");
Iterator<ConsumerRecord> iterator = records.iterator();
while (iterator.hasNext()) {
ConsumerRecord consumerRecord = iterator.next();
int p = consumerRecord.partition();
long offset = consumerRecord.offset();
System.out.println("=====>key: " + consumerRecord.key() + "===>partition:" + p + "==offset:" + offset+"=="+consumerRecord.value());
}
}
}
}
}

@ -0,0 +1,27 @@
package com.dalong.kafka.producer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringSerializer;
import java.util.Properties;
public class CustomProducer {
public static void main(String[] args) {
Properties properties=new Properties();
properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.132:9092");
properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
//
properties.setProperty(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION,"5");
properties.setProperty(ProducerConfig.SEND_BUFFER_CONFIG,"32768");//32K 改成-1 使用系统的默认值
properties.setProperty(ProducerConfig.RECEIVE_BUFFER_CONFIG,"32768");
KafkaProducer<String,String> producer= new KafkaProducer<String,String>(properties);
for (int i=0;i<50;i++) {
producer.send(new ProducerRecord<>("dalong1", "dalong2eeeeesdd额1"+i));
}
producer.close();
}
}

@ -0,0 +1,26 @@
package com.dalong.kafka.producer;
import org.apache.kafka.clients.producer.*;
import org.apache.kafka.common.serialization.StringSerializer;
import java.util.Properties;
public class CustomProducerCallback {
public static void main(String[] args) {
Properties properties=new Properties();
properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.37.131:9092");
properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
KafkaProducer<String,String> producer= new KafkaProducer<String,String>(properties);
for (int i=0;i<60;i++) {
producer.send(new ProducerRecord<String, String>("dalong1", i%6,"","对对对44=11144=55555" + i), new Callback() {
@Override
public void onCompletion(RecordMetadata recordMetadata, Exception e) {
System.out.println("=======主题:" + recordMetadata.topic() +"====分区:"+recordMetadata.partition()+ ", e = " + e);
}
});
}
producer.close();
}
}

@ -0,0 +1,43 @@
package com.dalong.rocketmq;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class ConsumerMq {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx2");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("PartOrder","*");
consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 同一个组里多个消费者都能消费到消息
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println(Thread.currentThread().getName()+"========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,43 @@
package com.dalong.rocketmq;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class ConsumerMq2 {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx2");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("wula","*");
// consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费
consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,53 @@
package com.dalong.rocketmq;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class ConsumerMq3 {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx6");
consumer.setNamesrvAddr("192.168.37.133:9876;192.168.37.131:9876");
consumer.subscribe("BALA2","*");
consumer.setConsumeMessageBatchMaxSize(1);
consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 同一个组里多个消费者都能消费到消息
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println(System.currentTimeMillis()+":"+Thread.currentThread().getName()+"========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags);
try {
if( mes.getKeys().equals("KEY==2")){
int i=1/0;
}
} catch (Exception e) {
e.printStackTrace();
return ConsumeConcurrentlyStatus.RECONSUME_LATER;
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,27 @@
package com.dalong.rocketmq;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageExt;
import java.util.ArrayList;
import java.util.Arrays;
public class ExRocketMQ {
public static void main(String[] args) throws Exception {
DefaultMQProducer producer = new DefaultMQProducer("ooxx5");
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876;192.168.37.131:9876");
// 启动Producer实例
producer.start();
ArrayList<Message> list=new ArrayList<>();
for (int i=0;i<10;i++){
list.add(new Message("BALA2","TAGA","KEY=="+i,("message=="+i).getBytes()));
}
SendResult sendResult= producer.send(list);
System.out.println("=====》" + sendResult);
producer.shutdown();
}
}

@ -0,0 +1,212 @@
package com.dalong.rocketmq;
import com.dalong.rocketmq.bean.Order;
import com.sun.corba.se.pept.broker.Broker;
import org.apache.kafka.clients.producer.Producer;
import org.apache.rocketmq.client.consumer.DefaultLitePullConsumer;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.MessageQueueSelector;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.common.protocol.body.ClusterInfo;
import org.apache.rocketmq.common.protocol.body.TopicList;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.apache.rocketmq.common.protocol.route.BrokerData;
import org.apache.rocketmq.common.protocol.route.TopicRouteData;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.apache.rocketmq.tools.admin.DefaultMQAdminExt;
import org.junit.Test;
import java.util.*;
public class SimpleRocketMQ {
@Test
public void producer() throws MQClientException, MQBrokerException, RemotingException, InterruptedException {
DefaultMQProducer producer = new DefaultMQProducer("ooxx");
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876");
// 启动Producer实例
producer.start();
// send5(producer);
MessageQueue messageQueue=new MessageQueue("wula","broker-a",0);
for (int i=0;i<20;i++){
Message message=new Message();
message.setTopic("wula");
message.setTags("taga");
message.setBody(("bodyooxx==="+i).getBytes());
message.setWaitStoreMsgOK(true);
//第一种
// send1(producer,message);
// // 第二种
// send2(producer,message);
// //第三种
// producer.sendOneway(message);
// 第四种
send4(producer,message,messageQueue);
}
producer.shutdown();
}
private void send1(DefaultMQProducer producer, Message message) throws MQBrokerException, RemotingException, InterruptedException, MQClientException {
SendResult sendResult= producer.send(message);
System.out.println("=====>sendResult:"+sendResult);
}
private void send2(DefaultMQProducer producer, Message message) throws RemotingException, InterruptedException, MQClientException {
producer.send(message,new SendCallback(){
@Override
public void onSuccess(SendResult sendResult) {
System.out.println("sendResult = " + sendResult);
}
@Override
public void onException(Throwable throwable) {
}
});
}
private void send4(DefaultMQProducer producer, Message message, MessageQueue messageQueue) throws MQBrokerException, RemotingException, InterruptedException, MQClientException {
messageQueue=new MessageQueue("wula","broker-a",0);
SendResult sendResult=producer.send(message,messageQueue);
System.out.println(sendResult);
}
/**
*
*/
private void send5(DefaultMQProducer producer) throws MQBrokerException, RemotingException, InterruptedException, MQClientException {
List<Order> list= buildOrders();
for(int i=0;i<list.size();i++){
String body= list.get(i).toString();
Message message=new Message();
message.setTopic("PartOrder");
message.setTags(null);
message.setBody(body.getBytes());
message.setWaitStoreMsgOK(true);
SendResult sendResult=producer.send(message, new MessageQueueSelector() {
@Override
public MessageQueue select(List<MessageQueue> list, Message message, Object o) {
System.out.println("====>list = " + list + ", message = " + message + ", o = " + o);
long id=(Long)o;
long index= id%list.size();
return list.get((int)index);
}
}, list.get(i).getId());
}
}
private List<Order> buildOrders(){
List<Order> orders=new ArrayList<>();
Order order=new Order();
order.setId(001);
order.setDes("创建");
orders.add(order);
order=new Order();
order.setId(002);
order.setDes("创建");
orders.add(order);
order=new Order();
order.setId(003);
order.setDes("创建");
orders.add(order);
order=new Order();
order.setId(001);
order.setDes("付款");
orders.add(order);
order=new Order();
order.setId(001);
order.setDes("推送");
orders.add(order);
order=new Order();
order.setId(002);
order.setDes("付款");
orders.add(order);
order=new Order();
order.setId(003);
order.setDes("付款");
orders.add(order);
order=new Order();
order.setId(002);
order.setDes("推送");
orders.add(order);
order=new Order();
order.setId(003);
order.setDes("推送");
orders.add(order);
return orders;
}
@Test
public void consumerPull() throws Exception {
DefaultLitePullConsumer consumer= new DefaultLitePullConsumer("consumer_xxoo");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.start();
Collection<MessageQueue> mqs= consumer.fetchMessageQueues("FilterTopic");
mqs.forEach(mq->System.out.println("=====>"+mq));
}
@Test
public void consumerPush() throws MQClientException {
}
@Test
public void admin() throws Exception {
DefaultMQAdminExt adminExt= new DefaultMQAdminExt();
adminExt.setNamesrvAddr("192.168.37.133:9876");
adminExt.start();
ClusterInfo clusterInfo= adminExt.examineBrokerClusterInfo();
HashMap addr= clusterInfo.getBrokerAddrTable();
Set<Map.Entry<String, Broker>> setss=addr.entrySet();
Iterator<Map.Entry<String, Broker>> ITS= setss.iterator();
Map.Entry<String, Broker> stringBrokerEntry= ITS.next();
System.out.println(stringBrokerEntry.getKey()+" "+stringBrokerEntry.getValue());
TopicList topicList= adminExt.fetchAllTopicList();
Set<String> sets= topicList.getTopicList();
sets.forEach(s->System.out.println("======>s:"+s));
System.out.println("=========>topiclist===============");
TopicRouteData wula= adminExt.examineTopicRouteInfo("wula_3");
System.out.println("=========>wula"+wula);
}
@Test
public void admin2() throws Exception {
DefaultMQAdminExt adminExt= new DefaultMQAdminExt();
adminExt.setNamesrvAddr("192.168.37.133:9876;192.168.37.131:9876");
adminExt.start();
ClusterInfo clusterInfo = adminExt.examineBrokerClusterInfo();
HashMap<String, BrokerData> brokerAddrTable = clusterInfo.getBrokerAddrTable();
Set<Map.Entry<String, BrokerData>> entries = brokerAddrTable.entrySet();
Iterator<Map.Entry<String, BrokerData>> iterator = entries.iterator();
while (iterator.hasNext()){
Map.Entry<String, BrokerData> next = iterator.next();
System.out.println("====>:"+next.getKey()+":value:"+next.getValue());
}
}
}

@ -0,0 +1,41 @@
package com.dalong.rocketmq.batch;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class BatchRocketConsumer {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("BatchTopic","*");
consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp()));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,25 @@
package com.dalong.rocketmq.batch;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import java.util.ArrayList;
import java.util.List;
public class BatchRocketProducer {
public static void main(String[] args) throws Exception {
DefaultMQProducer producer = new DefaultMQProducer("ooxxk");
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876");
// 启动Producer实例
producer.start();
int total=10;
List<Message> mesList=new ArrayList<>();
for (int i=0;i<total;i++){
Message message=new Message("BatchTopic",("Batch==="+i).getBytes());
mesList.add(message);
}
producer.send(mesList);
producer.shutdown();
}
}

@ -0,0 +1,30 @@
package com.dalong.rocketmq.bean;
public class Order {
private long id;
private String des;
public Long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getDes() {
return des;
}
public void setDes(String des) {
this.des = des;
}
@Override
public String toString() {
return "Order{" +
"id=" + id +
", des='" + des + '\'' +
'}';
}
}

@ -0,0 +1,42 @@
package com.dalong.rocketmq.filter;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.MessageSelector;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class FilterRocketConsumer {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("sqlfilter2");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("FilterTopic", MessageSelector.bySql("dalong is not null and dalong between 0 and 5"));
consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp()));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,28 @@
package com.dalong.rocketmq.filter;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class FilterRocketProducer {
public static void main(String[] args) throws Exception {
DefaultMQProducer producer = new DefaultMQProducer("ooxxz",false);
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876");
// 启动Producer实例
producer.start();
int total=10;
List<Message> mesList=new ArrayList<>();
for (int i=0;i<total;i++){
Message message=new Message("FilterTopic",("FilterTopic==="+i).getBytes());
message.putUserProperty("dalong",String.valueOf(i));
SendResult sendResult= producer.send(message);
System.out.println("args = " + sendResult);
}
producer.shutdown();
}
}

@ -0,0 +1,46 @@
package com.dalong.rocketmq.order;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.*;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
public class ConsumerInOrder {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("PartOrder","*");
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);
// consumer.setMessageModel(MessageModel.CLUSTERING);//集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式 同一个组里多个消费者都能消费到消息
consumer.registerMessageListener(new MessageListenerOrderly() {
Random round=new Random();
@Override
public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext context) {
context.setAutoCommit(true);
for(MessageExt msg:msgs){
System.out.println(Thread.currentThread().getName()+"========>msgs = " + new String(msg.getBody()) + ", context = " + context);
}
try {
TimeUnit.MILLISECONDS.sleep(round.nextInt(300));
} catch (InterruptedException e) {
e.printStackTrace();
return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;
}
return ConsumeOrderlyStatus.SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,105 @@
package com.dalong.rocketmq.order;
import com.dalong.rocketmq.bean.Order;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.MessageQueueSelector;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.remoting.exception.RemotingException;
import java.util.ArrayList;
import java.util.List;
public class OrderProducer {
public static void main(String[] args) throws MQClientException, MQBrokerException, RemotingException, InterruptedException {
DefaultMQProducer producer = new DefaultMQProducer("ooxx");
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876");
// 启动Producer实例
producer.start();
// send5(producer);
MessageQueue messageQueue=new MessageQueue("wula","broker-a",0);
for (int i=0;i<20;i++){
// Message message=new Message();
// message.setTopic("wula");
// message.setTags("taga");
// message.setBody(("bodyooxx==="+i).getBytes());
// message.setWaitStoreMsgOK(true);
List<Order> list= buildOrders();
for(int j=0;i<list.size();i++){
String body= list.get(j).toString();
Message message=new Message();
message.setTopic("PartOrder");
message.setTags(null);
message.setBody(body.getBytes());
message.setWaitStoreMsgOK(true);
SendResult sendResult=producer.send(message, new MessageQueueSelector() {
@Override
public MessageQueue select(List<MessageQueue> list, Message message, Object o) {
System.out.println("====>list = " + list + ", message = " + message + ", o = " + o);
long id=(Long)o;
long index= id%list.size();
return list.get((int)index);
}
}, list.get(i).getId());
}
}
producer.shutdown();
}
private static List<Order> buildOrders(){
List<Order> orders=new ArrayList<>();
Order order=new Order();
order.setId(001);
order.setDes("创建");
orders.add(order);
order=new Order();
order.setId(002);
order.setDes("创建");
orders.add(order);
order=new Order();
order.setId(003);
order.setDes("创建");
orders.add(order);
order=new Order();
order.setId(001);
order.setDes("付款");
orders.add(order);
order=new Order();
order.setId(001);
order.setDes("推送");
orders.add(order);
order=new Order();
order.setId(002);
order.setDes("付款");
orders.add(order);
order=new Order();
order.setId(003);
order.setDes("付款");
orders.add(order);
order=new Order();
order.setId(002);
order.setDes("推送");
orders.add(order);
order=new Order();
order.setId(003);
order.setDes("推送");
orders.add(order);
return orders;
}
}

@ -0,0 +1,41 @@
package com.dalong.rocketmq.schedule;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class ScheduleRocketConsumer {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("ScTopic","*");
consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp()));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,28 @@
package com.dalong.rocketmq.schedule;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
/**
*
*/
public class ScheduleRocketProducer {
public static void main(String[] args) throws Exception {
DefaultMQProducer producer = new DefaultMQProducer("ooxxk");
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876");
// 启动Producer实例
producer.start();
int total=10;
for (int i=0;i<total;i++){
Message message=new Message("ScTopic",("schedule=-"+i).getBytes());
//delayTimeLevel 分为18个等级 1-18 1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h
message.setDelayTimeLevel(4);
//
producer.send(message);
}
producer.shutdown();
}
}

@ -0,0 +1,34 @@
package com.dalong.rocketmq.sendbrokername;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.remoting.exception.RemotingException;
public class SendBrokerNameProducer {
public static void main(String[] args) throws MQClientException, MQBrokerException, RemotingException, InterruptedException {
DefaultMQProducer producer = new DefaultMQProducer("ooxx2");
// 设置NameServer的地址
producer.setNamesrvAddr("192.168.37.133:9876");
// 启动Producer实例
producer.start();
// send5(producer);
for (int i=0;i<20;i++){
Message message=new Message();
message.setTopic("wula_3");
message.setTags("taga");
message.setBody(("bodyooxx==="+i).getBytes());
message.setWaitStoreMsgOK(true);
MessageQueue messageQueue=new MessageQueue("wula_3","broker-b",0);
SendResult sendResult=producer.send(message,messageQueue);
System.out.println(sendResult);
}
producer.shutdown();
}
}

@ -0,0 +1,22 @@
package com.dalong.rocketmq.transaction;
import org.apache.rocketmq.client.producer.LocalTransactionState;
import org.apache.rocketmq.client.producer.TransactionListener;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageExt;
public class TransactionListenerImpl implements TransactionListener {
@Override
public LocalTransactionState executeLocalTransaction(Message msg, Object arg) {
String s= (String) arg;
System.out.println("=======>执行executeLocalTransaction:"+s);
return LocalTransactionState.UNKNOW;
}
@Override
public LocalTransactionState checkLocalTransaction(MessageExt msg) {
System.out.println("=======>检查checkLocalTransaction");
return LocalTransactionState.COMMIT_MESSAGE;
}
}

@ -0,0 +1,21 @@
package com.dalong.rocketmq.transaction;
import org.apache.rocketmq.client.producer.LocalTransactionState;
import org.apache.rocketmq.client.producer.TransactionListener;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageExt;
public class TransactionListenerImpl2 implements TransactionListener {
@Override
public LocalTransactionState executeLocalTransaction(Message msg, Object arg) {
System.out.println("=======>执行2executeLocalTransaction");
return LocalTransactionState.COMMIT_MESSAGE;
}
@Override
public LocalTransactionState checkLocalTransaction(MessageExt msg) {
System.out.println("=======>检查2checkLocalTransaction");
return LocalTransactionState.COMMIT_MESSAGE;
}
}

@ -0,0 +1,53 @@
package com.dalong.rocketmq.transaction;
import ch.qos.logback.core.util.TimeUtil;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.TransactionListener;
import org.apache.rocketmq.client.producer.TransactionMQProducer;
import org.apache.rocketmq.common.message.Message;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.TimerTask;
import java.util.concurrent.*;
public class TransactionProducer {
public static void main(String[] args) throws MQClientException {
TransactionListener transactionListener=new TransactionListenerImpl();
TransactionMQProducer producer=new TransactionMQProducer("TransactionMQProducer3");
// producer.setNamesrvAddr("192.168.37.133:9876");
producer.setNamesrvAddr("192.168.37.131:9876;192.168.37.133:9876");
ExecutorService executorService=new ThreadPoolExecutor(2,5,100,TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(16),new ThreadFactory(){
@Override
public Thread newThread(Runnable r) {
Thread thread=new Thread(r);
thread.setName("=====>check-thread");
return thread;
}
});
producer.setExecutorService(executorService);
producer.setTransactionListener(transactionListener);
// 启动Producer实例
producer.start();
Message message=new Message("TransactionProducer2"," A转钱B to==1》".getBytes());
SendResult sendResult= producer.sendMessageInTransaction(message,null);
SimpleDateFormat simpleDateFormat=new SimpleDateFormat();
System.out.println("===>sendResult:" + sendResult.getSendStatus()+":"+simpleDateFormat.format(new Date()));
// 让主线程等待,以便执行事务状态回查
for (int i = 0; i < 10000; i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
producer.shutdown();
}
}

@ -0,0 +1,49 @@
package com.dalong.rocketmq.transaction;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.TransactionListener;
import org.apache.rocketmq.client.producer.TransactionMQProducer;
import org.apache.rocketmq.common.message.Message;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.*;
public class TransactionProducer2 {
public static void main(String[] args) throws MQClientException {
TransactionListener transactionListener=new TransactionListenerImpl2();
TransactionMQProducer producer=new TransactionMQProducer("TransactionMQProducer");
producer.setNamesrvAddr("192.168.37.133:9876");
ExecutorService executorService=new ThreadPoolExecutor(2,5,100,TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(16),new ThreadFactory(){
@Override
public Thread newThread(Runnable r) {
Thread thread=new Thread(r);
thread.setName("=====>check-thread");
return thread;
}
});
producer.setExecutorService(executorService);
producer.setTransactionListener(transactionListener);
// 启动Producer实例
producer.start();
Message message=new Message("TransactionProducer"," A转钱B to==2》".getBytes());
SendResult sendResult= producer.sendMessageInTransaction(message,null);
SimpleDateFormat simpleDateFormat=new SimpleDateFormat();
System.out.println("===>sendResult:" + sendResult.getSendStatus()+simpleDateFormat.format(new Date()));
// 让主线程等待,以便执行事务状态回查
for (int i = 0; i < 10000; i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
producer.shutdown();
}
}

@ -0,0 +1,41 @@
package com.dalong.rocketmq.transaction;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import java.io.UnsupportedEncodingException;
import java.util.List;
public class TransactionRocketConsumer {
public static void main(String[] args) throws MQClientException {
// 集群消費
DefaultMQPushConsumer consumer=new DefaultMQPushConsumer("ooxx4");
consumer.setNamesrvAddr("192.168.37.133:9876");
consumer.subscribe("TransactionProducer","*");
consumer.setMessageModel(MessageModel.CLUSTERING);//默认集群消费
// consumer.setMessageModel(MessageModel.BROADCASTING);//广播模式
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
for(MessageExt mes:list){
String topic= mes.getTopic();
try {
String msgbody=new String(mes.getBody(),"UTF-8");
String tags=mes.getTags();
System.out.println("========》topic" + topic+"===>msgbody:"+msgbody+"===>tags:"+tags+"延时:"+(mes.getStoreTimestamp()-mes.getBornTimestamp()));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}

@ -0,0 +1,71 @@
<?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>msb-mall</artifactId>
<groupId>com.msb.mall</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mall-commons</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.4.3.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.14</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.2.8.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>

@ -0,0 +1,61 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.exception;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public class RRException extends RuntimeException {
private static final long serialVersionUID = 1L;
private String msg;
private int code = 500;
public RRException(String msg) {
super(msg);
this.msg = msg;
}
public RRException(String msg, Throwable e) {
super(msg, e);
this.msg = msg;
}
public RRException(String msg, int code) {
super(msg);
this.msg = msg;
this.code = code;
}
public RRException(String msg, int code, Throwable e) {
super(msg, e);
this.msg = msg;
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}

@ -0,0 +1,64 @@
///**
// * Copyright (c) 2016-2019 人人开源 All rights reserved.
// *
// * https://www.renren.io
// *
// * 版权所有,侵权必究!
// */
//
//package com.msb.mall.commons.exception;
//
//import io.renren.common.utils.R;
//import org.apache.shiro.authz.AuthorizationException;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.dao.DuplicateKeyException;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.RestControllerAdvice;
//import org.springframework.web.servlet.NoHandlerFoundException;
//
///**
// * 异常处理器
// *
// * @author Mark sunlightcs@gmail.com
// */
//@RestControllerAdvice
//public class RRExceptionHandler {
// private Logger logger = LoggerFactory.getLogger(getClass());
//
// /**
// * 处理自定义异常
// */
// @ExceptionHandler(RRException.class)
// public R handleRRException(RRException e){
// R r = new R();
// r.put("code", e.getCode());
// r.put("msg", e.getMessage());
//
// return r;
// }
//
// @ExceptionHandler(NoHandlerFoundException.class)
// public R handlerNoFoundException(Exception e) {
// logger.error(e.getMessage(), e);
// return R.error(404, "路径不存在,请检查路径是否正确");
// }
//
// @ExceptionHandler(DuplicateKeyException.class)
// public R handleDuplicateKeyException(DuplicateKeyException e){
// logger.error(e.getMessage(), e);
// return R.error("数据库中已存在该记录");
// }
//
// @ExceptionHandler(AuthorizationException.class)
// public R handleAuthorizationException(AuthorizationException e){
// logger.error(e.getMessage(), e);
// return R.error("没有权限,请联系管理员授权");
// }
//
// @ExceptionHandler(Exception.class)
// public R handleException(Exception e){
// logger.error(e.getMessage(), e);
// return R.error();
// }
//}

@ -0,0 +1,153 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
* <p>
* https://www.renren.io
* <p>
*
*/
package com.msb.mall.commons.util;
import com.msb.mall.commons.validator.group.AliyunGroup;
import com.msb.mall.commons.validator.group.QcloudGroup;
import com.msb.mall.commons.validator.group.QiniuGroup;
import java.util.Optional;
import java.util.stream.Stream;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public class Constant {
/**
* ID
*/
public static final int SUPER_ADMIN = 1;
/**
*
*/
public static final String PAGE = "page";
/**
*
*/
public static final String LIMIT = "limit";
/**
*
*/
public static final String ORDER_FIELD = "sidx";
/**
*
*/
public static final String ORDER = "order";
/**
*
*/
public static final String ASC = "asc";
/**
*
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 20161115 1:24:29
*/
public enum MenuType {
/**
*
*/
CATALOG(0),
/**
*
*/
MENU(1),
/**
*
*/
BUTTON(2);
private int value;
MenuType(int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
/**
*
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2016123 12:07:22
*/
public enum ScheduleStatus {
/**
*
*/
NORMAL(0),
/**
*
*/
PAUSE(1);
private int value;
ScheduleStatus(int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
/**
*
*/
public enum CloudService {
/**
*
*/
QINIU(1, QiniuGroup.class),
/**
*
*/
ALIYUN(2, AliyunGroup.class),
/**
*
*/
QCLOUD(3, QcloudGroup.class);
private int value;
private Class<?> validatorGroupClass;
CloudService(int value, Class<?> validatorGroupClass) {
this.value = value;
this.validatorGroupClass = validatorGroupClass;
}
public int getValue() {
return value;
}
public Class<?> getValidatorGroupClass() {
return this.validatorGroupClass;
}
public static CloudService getByValue(Integer value) {
Optional<CloudService> first = Stream.of(CloudService.values()).filter(cs -> value.equals(cs.value)).findFirst();
if (!first.isPresent()) {
throw new IllegalArgumentException("非法的枚举值:" + value);
}
return first.get();
}
}
}

@ -0,0 +1,110 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.util;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.io.Serializable;
import java.util.List;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public class PageUtils implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private int totalCount;
/**
*
*/
private int pageSize;
/**
*
*/
private int totalPage;
/**
*
*/
private int currPage;
/**
*
*/
private List<?> list;
/**
*
* @param list
* @param totalCount
* @param pageSize
* @param currPage
*/
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
}
/**
*
*/
public PageUtils(IPage<?> page) {
this.list = page.getRecords();
this.totalCount = (int)page.getTotal();
this.pageSize = (int)page.getSize();
this.currPage = (int)page.getCurrent();
this.totalPage = (int)page.getPages();
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
}

@ -0,0 +1,77 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.util;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.msb.mall.commons.xss.SQLFilter;
import org.apache.commons.lang.StringUtils;
import java.util.Map;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public class Query<T> {
public IPage<T> getPage(Map<String, Object> params) {
return this.getPage(params, null, false);
}
public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
//分页参数
long curPage = 1;
long limit = 10;
if(params.get(Constant.PAGE) != null){
curPage = Long.parseLong((String)params.get(Constant.PAGE));
}
if(params.get(Constant.LIMIT) != null){
limit = Long.parseLong((String)params.get(Constant.LIMIT));
}
//分页对象
Page<T> page = new Page<>(curPage, limit);
//分页参数
params.put(Constant.PAGE, page);
//排序字段
//防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
String orderField = SQLFilter.sqlInject((String)params.get(Constant.ORDER_FIELD));
String order = (String)params.get(Constant.ORDER);
//前端字段排序
if(StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)){
if(Constant.ASC.equalsIgnoreCase(order)) {
return page.addOrder(OrderItem.asc(orderField));
}else {
return page.addOrder(OrderItem.desc(orderField));
}
}
//没有排序字段,则不排序
if(StringUtils.isBlank(defaultOrderField)){
return page;
}
//默认排序
if(isAsc) {
page.addOrder(OrderItem.asc(defaultOrderField));
}else {
page.addOrder(OrderItem.desc(defaultOrderField));
}
return page;
}
}

@ -0,0 +1,64 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.util;
import org.apache.http.HttpStatus;
import java.util.HashMap;
import java.util.Map;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public class R extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
public R() {
put("code", 0);
put("msg", "success");
}
public static R error() {
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
}
public static R error(String msg) {
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
}
public static R error(int code, String msg) {
R r = new R();
r.put("code", code);
r.put("msg", msg);
return r;
}
public static R ok(String msg) {
R r = new R();
r.put("msg", msg);
return r;
}
public static R ok(Map<String, Object> map) {
R r = new R();
r.putAll(map);
return r;
}
public static R ok() {
return new R();
}
public R put(String key, Object value) {
super.put(key, value);
return this;
}
}

@ -0,0 +1,32 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator;
import com.msb.mall.commons.exception.RRException;
import org.apache.commons.lang.StringUtils;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public abstract class Assert {
public static void isBlank(String str, String message) {
if (StringUtils.isBlank(str)) {
throw new RRException(message);
}
}
public static void isNull(Object object, String message) {
if (object == null) {
throw new RRException(message);
}
}
}

@ -0,0 +1,56 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
* <p>
* https://www.renren.io
* <p>
*
*/
package com.msb.mall.commons.validator;
import com.msb.mall.commons.exception.RRException;
import com.msb.mall.commons.util.Constant;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import java.util.Set;
/**
* hibernate-validator
*
* http://docs.jboss.org/hibernate/validator/5.4/reference/en-US/html_single/
*
* @author Mark sunlightcs@gmail.com
*/
public class ValidatorUtils {
private static Validator validator;
static {
validator = Validation.buildDefaultValidatorFactory().getValidator();
}
/**
*
* @param object
* @param groups
* @throws RRException RRException
*/
public static void validateEntity(Object object, Class<?>... groups)
throws RRException {
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups);
if (!constraintViolations.isEmpty()) {
StringBuilder msg = new StringBuilder();
for (ConstraintViolation<Object> constraint : constraintViolations) {
msg.append(constraint.getMessage()).append("<br>");
}
throw new RRException(msg.toString());
}
}
public static void validateEntity(Object object, Constant.CloudService type) {
validateEntity(object, type.getValidatorGroupClass());
}
}

@ -0,0 +1,17 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator.group;
/**
* Group
*
* @author Mark sunlightcs@gmail.com
*/
public interface AddGroup {
}

@ -0,0 +1,17 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator.group;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public interface AliyunGroup {
}

@ -0,0 +1,21 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator.group;
import javax.validation.GroupSequence;
/**
* AddGroupUpdateGroup
*
* @author Mark sunlightcs@gmail.com
*/
@GroupSequence({AddGroup.class, UpdateGroup.class})
public interface Group {
}

@ -0,0 +1,17 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator.group;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public interface QcloudGroup {
}

@ -0,0 +1,17 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator.group;
/**
*
*
* @author Mark sunlightcs@gmail.com
*/
public interface QiniuGroup {
}

@ -0,0 +1,19 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.validator.group;
/**
* Group
*
* @author Mark sunlightcs@gmail.com
*/
public interface UpdateGroup {
}

@ -0,0 +1,50 @@
/**
* Copyright (c) 2016-2019 All rights reserved.
*
* https://www.renren.io
*
*
*/
package com.msb.mall.commons.xss;
import com.msb.mall.commons.exception.RRException;
import org.apache.commons.lang.StringUtils;
/**
* SQL
*
* @author Mark sunlightcs@gmail.com
*/
public class SQLFilter {
/**
* SQL
* @param str
*/
public static String sqlInject(String str){
if(StringUtils.isBlank(str)){
return null;
}
//去掉'|"|;|\字符
str = StringUtils.replace(str, "'", "");
str = StringUtils.replace(str, "\"", "");
str = StringUtils.replace(str, ";", "");
str = StringUtils.replace(str, "\\", "");
//转换成小写
str = str.toLowerCase();
//非法字符
String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"};
//判断是否包含非法字符
for(String keyword : keywords){
if(str.indexOf(keyword) != -1){
throw new RRException("包含非法字符");
}
}
return str;
}
}

@ -0,0 +1,31 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/

@ -0,0 +1,118 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

@ -0,0 +1,4 @@
# 工程简介
# 延伸阅读

@ -0,0 +1,310 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

@ -0,0 +1,182 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

@ -0,0 +1,102 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.msb.mall</groupId>
<artifactId>mall-coupon</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mall-coupon</name>
<description>mall-coupon</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.3.7.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR9</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>com.msb.mall</groupId>
<artifactId>mall-commons</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<configuration>
<mainClass>com.msb.mall.coupon.MallCouponApplication</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,17 @@
package com.msb.mall.coupon;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@SpringBootApplication
@MapperScan("com.msb.mall.coupon.dao")
public class MallCouponApplication {
public static void main(String[] args) {
SpringApplication.run(MallCouponApplication.class, args);
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.CouponEntity;
import com.msb.mall.coupon.service.CouponService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/coupon")
public class CouponController {
@Autowired
private CouponService couponService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = couponService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
CouponEntity coupon = couponService.getById(id);
return R.ok().put("coupon", coupon);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody CouponEntity coupon){
couponService.save(coupon);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody CouponEntity coupon){
couponService.updateById(coupon);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
couponService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.CouponHistoryEntity;
import com.msb.mall.coupon.service.CouponHistoryService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/couponhistory")
public class CouponHistoryController {
@Autowired
private CouponHistoryService couponHistoryService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = couponHistoryService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
CouponHistoryEntity couponHistory = couponHistoryService.getById(id);
return R.ok().put("couponHistory", couponHistory);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody CouponHistoryEntity couponHistory){
couponHistoryService.save(couponHistory);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody CouponHistoryEntity couponHistory){
couponHistoryService.updateById(couponHistory);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
couponHistoryService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.CouponSpuCategoryRelationEntity;
import com.msb.mall.coupon.service.CouponSpuCategoryRelationService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/couponspucategoryrelation")
public class CouponSpuCategoryRelationController {
@Autowired
private CouponSpuCategoryRelationService couponSpuCategoryRelationService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = couponSpuCategoryRelationService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
CouponSpuCategoryRelationEntity couponSpuCategoryRelation = couponSpuCategoryRelationService.getById(id);
return R.ok().put("couponSpuCategoryRelation", couponSpuCategoryRelation);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody CouponSpuCategoryRelationEntity couponSpuCategoryRelation){
couponSpuCategoryRelationService.save(couponSpuCategoryRelation);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody CouponSpuCategoryRelationEntity couponSpuCategoryRelation){
couponSpuCategoryRelationService.updateById(couponSpuCategoryRelation);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
couponSpuCategoryRelationService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.CouponSpuRelationEntity;
import com.msb.mall.coupon.service.CouponSpuRelationService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/couponspurelation")
public class CouponSpuRelationController {
@Autowired
private CouponSpuRelationService couponSpuRelationService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = couponSpuRelationService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
CouponSpuRelationEntity couponSpuRelation = couponSpuRelationService.getById(id);
return R.ok().put("couponSpuRelation", couponSpuRelation);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody CouponSpuRelationEntity couponSpuRelation){
couponSpuRelationService.save(couponSpuRelation);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody CouponSpuRelationEntity couponSpuRelation){
couponSpuRelationService.updateById(couponSpuRelation);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
couponSpuRelationService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.HomeAdvEntity;
import com.msb.mall.coupon.service.HomeAdvService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
* 广
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/homeadv")
public class HomeAdvController {
@Autowired
private HomeAdvService homeAdvService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = homeAdvService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
HomeAdvEntity homeAdv = homeAdvService.getById(id);
return R.ok().put("homeAdv", homeAdv);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody HomeAdvEntity homeAdv){
homeAdvService.save(homeAdv);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody HomeAdvEntity homeAdv){
homeAdvService.updateById(homeAdv);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
homeAdvService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.HomeSubjectEntity;
import com.msb.mall.coupon.service.HomeSubjectService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
* jd
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/homesubject")
public class HomeSubjectController {
@Autowired
private HomeSubjectService homeSubjectService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = homeSubjectService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
HomeSubjectEntity homeSubject = homeSubjectService.getById(id);
return R.ok().put("homeSubject", homeSubject);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody HomeSubjectEntity homeSubject){
homeSubjectService.save(homeSubject);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody HomeSubjectEntity homeSubject){
homeSubjectService.updateById(homeSubject);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
homeSubjectService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.HomeSubjectSpuEntity;
import com.msb.mall.coupon.service.HomeSubjectSpuService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/homesubjectspu")
public class HomeSubjectSpuController {
@Autowired
private HomeSubjectSpuService homeSubjectSpuService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = homeSubjectSpuService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
HomeSubjectSpuEntity homeSubjectSpu = homeSubjectSpuService.getById(id);
return R.ok().put("homeSubjectSpu", homeSubjectSpu);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody HomeSubjectSpuEntity homeSubjectSpu){
homeSubjectSpuService.save(homeSubjectSpu);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody HomeSubjectSpuEntity homeSubjectSpu){
homeSubjectSpuService.updateById(homeSubjectSpu);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
homeSubjectSpuService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.MemberPriceEntity;
import com.msb.mall.coupon.service.MemberPriceService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/memberprice")
public class MemberPriceController {
@Autowired
private MemberPriceService memberPriceService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = memberPriceService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
MemberPriceEntity memberPrice = memberPriceService.getById(id);
return R.ok().put("memberPrice", memberPrice);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody MemberPriceEntity memberPrice){
memberPriceService.save(memberPrice);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody MemberPriceEntity memberPrice){
memberPriceService.updateById(memberPrice);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
memberPriceService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SeckillPromotionEntity;
import com.msb.mall.coupon.service.SeckillPromotionService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/seckillpromotion")
public class SeckillPromotionController {
@Autowired
private SeckillPromotionService seckillPromotionService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = seckillPromotionService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SeckillPromotionEntity seckillPromotion = seckillPromotionService.getById(id);
return R.ok().put("seckillPromotion", seckillPromotion);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SeckillPromotionEntity seckillPromotion){
seckillPromotionService.save(seckillPromotion);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SeckillPromotionEntity seckillPromotion){
seckillPromotionService.updateById(seckillPromotion);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
seckillPromotionService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SeckillSessionEntity;
import com.msb.mall.coupon.service.SeckillSessionService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/seckillsession")
public class SeckillSessionController {
@Autowired
private SeckillSessionService seckillSessionService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = seckillSessionService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SeckillSessionEntity seckillSession = seckillSessionService.getById(id);
return R.ok().put("seckillSession", seckillSession);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SeckillSessionEntity seckillSession){
seckillSessionService.save(seckillSession);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SeckillSessionEntity seckillSession){
seckillSessionService.updateById(seckillSession);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
seckillSessionService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SeckillSkuNoticeEntity;
import com.msb.mall.coupon.service.SeckillSkuNoticeService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/seckillskunotice")
public class SeckillSkuNoticeController {
@Autowired
private SeckillSkuNoticeService seckillSkuNoticeService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = seckillSkuNoticeService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SeckillSkuNoticeEntity seckillSkuNotice = seckillSkuNoticeService.getById(id);
return R.ok().put("seckillSkuNotice", seckillSkuNotice);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SeckillSkuNoticeEntity seckillSkuNotice){
seckillSkuNoticeService.save(seckillSkuNotice);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SeckillSkuNoticeEntity seckillSkuNotice){
seckillSkuNoticeService.updateById(seckillSkuNotice);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
seckillSkuNoticeService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SeckillSkuRelationEntity;
import com.msb.mall.coupon.service.SeckillSkuRelationService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/seckillskurelation")
public class SeckillSkuRelationController {
@Autowired
private SeckillSkuRelationService seckillSkuRelationService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = seckillSkuRelationService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SeckillSkuRelationEntity seckillSkuRelation = seckillSkuRelationService.getById(id);
return R.ok().put("seckillSkuRelation", seckillSkuRelation);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SeckillSkuRelationEntity seckillSkuRelation){
seckillSkuRelationService.save(seckillSkuRelation);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SeckillSkuRelationEntity seckillSkuRelation){
seckillSkuRelationService.updateById(seckillSkuRelation);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
seckillSkuRelationService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SkuFullReductionEntity;
import com.msb.mall.coupon.service.SkuFullReductionService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/skufullreduction")
public class SkuFullReductionController {
@Autowired
private SkuFullReductionService skuFullReductionService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = skuFullReductionService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SkuFullReductionEntity skuFullReduction = skuFullReductionService.getById(id);
return R.ok().put("skuFullReduction", skuFullReduction);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SkuFullReductionEntity skuFullReduction){
skuFullReductionService.save(skuFullReduction);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SkuFullReductionEntity skuFullReduction){
skuFullReductionService.updateById(skuFullReduction);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
skuFullReductionService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SkuLadderEntity;
import com.msb.mall.coupon.service.SkuLadderService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/skuladder")
public class SkuLadderController {
@Autowired
private SkuLadderService skuLadderService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = skuLadderService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SkuLadderEntity skuLadder = skuLadderService.getById(id);
return R.ok().put("skuLadder", skuLadder);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SkuLadderEntity skuLadder){
skuLadderService.save(skuLadder);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SkuLadderEntity skuLadder){
skuLadderService.updateById(skuLadder);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
skuLadderService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,84 @@
package com.msb.mall.coupon.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.msb.mall.coupon.entity.SpuBoundsEntity;
import com.msb.mall.coupon.service.SpuBoundsService;
import com.msb.mall.commons.util.PageUtils;
import com.msb.mall.commons.util.R;
/**
* spu
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@RestController
@RequestMapping("coupon/spubounds")
public class SpuBoundsController {
@Autowired
private SpuBoundsService spuBoundsService;
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = spuBoundsService.queryPage(params);
return R.ok().put("page", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SpuBoundsEntity spuBounds = spuBoundsService.getById(id);
return R.ok().put("spuBounds", spuBounds);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody SpuBoundsEntity spuBounds){
spuBoundsService.save(spuBounds);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody SpuBoundsEntity spuBounds){
spuBoundsService.updateById(spuBounds);
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
spuBoundsService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.CouponEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface CouponDao extends BaseMapper<CouponEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.CouponHistoryEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface CouponHistoryDao extends BaseMapper<CouponHistoryEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.CouponSpuCategoryRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface CouponSpuCategoryRelationDao extends BaseMapper<CouponSpuCategoryRelationEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.CouponSpuRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface CouponSpuRelationDao extends BaseMapper<CouponSpuRelationEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.HomeAdvEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 广
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface HomeAdvDao extends BaseMapper<HomeAdvEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.HomeSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* jd
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface HomeSubjectDao extends BaseMapper<HomeSubjectEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.HomeSubjectSpuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface HomeSubjectSpuDao extends BaseMapper<HomeSubjectSpuEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.MemberPriceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface MemberPriceDao extends BaseMapper<MemberPriceEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SeckillPromotionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SeckillPromotionDao extends BaseMapper<SeckillPromotionEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SeckillSessionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SeckillSessionDao extends BaseMapper<SeckillSessionEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SeckillSkuNoticeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SeckillSkuNoticeDao extends BaseMapper<SeckillSkuNoticeEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SeckillSkuRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SeckillSkuRelationDao extends BaseMapper<SeckillSkuRelationEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SkuFullReductionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SkuFullReductionDao extends BaseMapper<SkuFullReductionEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SkuLadderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SkuLadderDao extends BaseMapper<SkuLadderEntity> {
}

@ -0,0 +1,17 @@
package com.msb.mall.coupon.dao;
import com.msb.mall.coupon.entity.SpuBoundsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* spu
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Mapper
public interface SpuBoundsDao extends BaseMapper<SpuBoundsEntity> {
}

@ -0,0 +1,105 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_coupon")
public class CouponEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* [0->1->2->3->]
*/
private Integer couponType;
/**
*
*/
private String couponImg;
/**
*
*/
private String couponName;
/**
*
*/
private Integer num;
/**
*
*/
private BigDecimal amount;
/**
*
*/
private Integer perLimit;
/**
* 使
*/
private BigDecimal minPoint;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
/**
* 使[0->1->2->]
*/
private Integer useType;
/**
*
*/
private String note;
/**
*
*/
private Integer publishCount;
/**
* 使
*/
private Integer useCount;
/**
*
*/
private Integer receiveCount;
/**
*
*/
private Date enableStartTime;
/**
*
*/
private Date enableEndTime;
/**
*
*/
private String code;
/**
* [0->-]
*/
private Integer memberLevel;
/**
* [0-1-]
*/
private Integer publish;
}

@ -0,0 +1,64 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_coupon_history")
public class CouponHistoryEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long couponId;
/**
* id
*/
private Long memberId;
/**
*
*/
private String memberNickName;
/**
* [0->1->]
*/
private Integer getType;
/**
*
*/
private Date createTime;
/**
* 使[0->使1->使2->]
*/
private Integer useType;
/**
* 使
*/
private Date useTime;
/**
* id
*/
private Long orderId;
/**
*
*/
private Long orderSn;
}

@ -0,0 +1,40 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_coupon_spu_category_relation")
public class CouponSpuCategoryRelationEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long couponId;
/**
* id
*/
private Long categoryId;
/**
*
*/
private String categoryName;
}

@ -0,0 +1,40 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_coupon_spu_relation")
public class CouponSpuRelationEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long couponId;
/**
* spu_id
*/
private Long spuId;
/**
* spu_name
*/
private String spuName;
}

@ -0,0 +1,72 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 广
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_home_adv")
public class HomeAdvEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String name;
/**
*
*/
private String pic;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
/**
*
*/
private Integer status;
/**
*
*/
private Integer clickCount;
/**
* 广
*/
private String url;
/**
*
*/
private String note;
/**
*
*/
private Integer sort;
/**
*
*/
private Long publisherId;
/**
*
*/
private Long authId;
}

@ -0,0 +1,56 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* jd
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_home_subject")
public class HomeSubjectEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String name;
/**
*
*/
private String title;
/**
*
*/
private String subTitle;
/**
*
*/
private Integer status;
/**
*
*/
private String url;
/**
*
*/
private Integer sort;
/**
*
*/
private String img;
}

@ -0,0 +1,44 @@
package com.msb.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author dalong
* @email 573607090@qq.com
* @date 2022-09-10 00:45:20
*/
@Data
@TableName("sms_home_subject_spu")
public class HomeSubjectSpuEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String name;
/**
* id
*/
private Long subjectId;
/**
* spu_id
*/
private Long spuId;
/**
*
*/
private Integer sort;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save