Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
40a55157
Commit
40a55157
authored
Jun 28, 2019
by
sober
Committed by
linlinjava
Jun 28, 2019
Browse files
api add codestyle check plugin (#219)
parent
4fec87a7
Changes
8
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/checkstyle.xml
0 → 100755
View file @
40a55157
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--Checkstyle Configuration http://checkstyle.sourceforge.net/config.html-->
<module
name=
"Checker"
>
<!-- 文件编码 -->
<property
name=
"charset"
value=
"UTF-8"
/>
<!-- 违反的严重级别 -->
<!--<property name="severity" value="warning"/>-->
<property
name=
"severity"
value=
"error"
/>
<!-- 处理的文件扩展名 -->
<!-- <property name="fileExtensions" value="java, properties, xml"/> -->
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!--检查源文件是否包含制表符tab-->
<module
name=
"FileTabCharacter"
>
<property
name=
"eachLine"
value=
"true"
/>
</module>
<module
name=
"TreeWalker"
>
<!--检查类名和文件名是否匹配-->
<module
name=
"OuterTypeFilename"
/>
<!--<module name="IllegalTokenText">-->
<!--<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>-->
<!--<property name="format" value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>-->
<!--<property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>-->
<!--</module>-->
<!--限制使用Unicode转义-->
<module
name=
"AvoidEscapedUnicodeCharacters"
>
<property
name=
"allowEscapesForControlCharacters"
value=
"true"
/>
<property
name=
"allowByTailComment"
value=
"true"
/>
<property
name=
"allowNonPrintableEscapes"
value=
"true"
/>
</module>
<!--每行字符数-->
<module
name=
"LineLength"
>
<property
name=
"max"
value=
"120"
/>
<property
name=
"ignorePattern"
value=
"^package.*|^import.*|a href|href|http://|https://|ftp://"
/>
</module>
<!-- 必须导入类的完整路径,即不能使用*导入所需的类 -->
<!--<module name="AvoidStarImport"/>-->
<!-- 检查是否导入了不必显示导入的类-->
<module
name=
"RedundantImport"
/>
<!-- 检查是否导入的包没有使用-->
<module
name=
"UnusedImports"
/>
<!--检查顶级类/接口/枚举是否在自己的源文件-->
<module
name=
"OneTopLevelClass"
/>
<!--检查所选语句是否换行,默认检查package/import语句-->
<module
name=
"NoLineWrap"
/>
<!--检查空块-->
<module
name=
"EmptyBlock"
>
<property
name=
"option"
value=
"TEXT"
/>
<property
name=
"tokens"
value=
"LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"
/>
</module>
<!-- NeedBraces 检查是否应该使用括号的地方没有加括号
tokens: 定义检查的类型 -->
<module
name=
"NeedBraces"
/>
<!--option: 定义左大括号'{'显示位置,eol在同一行显示,nl在下一行显示
maxLineLength: 大括号'{'所在行行最多容纳的字符数
tokens: 该属性适用的类型,例:CLASS_DEF,INTERFACE_DEF,METHOD_DEF,CTOR_DEF -->
<module
name=
"LeftCurly"
>
<property
name=
"maxLineLength"
value=
"120"
/>
</module>
<!-- Checks the placement of right curly braces ('}') for else, try, and catch tokens. The policy to verify is specified using property option.
option: 右大括号是否单独一行显示
tokens: 定义检查的类型 -->
<module
name=
"RightCurly"
>
<property
name=
"id"
value=
"RightCurlySame"
/>
<property
name=
"tokens"
value=
"LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"
/>
</module>
<module
name=
"RightCurly"
>
<property
name=
"id"
value=
"RightCurlyAlone"
/>
<property
name=
"option"
value=
"alone"
/>
<property
name=
"tokens"
value=
"CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"
/>
</module>
<!-- 检查在重写了equals方法后是否重写了hashCode方法 -->
<module
name=
"EqualsHashCode"
/>
<!--空白环绕-->
<module
name=
"WhitespaceAround"
>
<property
name=
"allowEmptyConstructors"
value=
"true"
/>
<property
name=
"allowEmptyMethods"
value=
"true"
/>
<property
name=
"allowEmptyTypes"
value=
"true"
/>
<property
name=
"allowEmptyLoops"
value=
"true"
/>
</module>
<!--检查每行只有一个语句-->
<module
name=
"OneStatementPerLine"
/>
<!-- 每一行只能定义一个变量
<module name="MultipleVariableDeclarations"/> -->
<!--检查再定义数组时,采用java风格还是c风格,例如:int[] num是java风格,int num[]是c风格。默认是java风格-->
<module
name=
"ArrayTypeStyle"
/>
<!--检查switch语句是否有default-->
<module
name=
"MissingSwitchDefault"
/>
<!--检查switch中case后是否加入了跳出语句,例如:return、break、throw、continue -->
<module
name=
"FallThrough"
/>
<!--检查是否在long类型是否定义了大写的L.字母小写l和数字1很相似-->
<module
name=
"UpperEll"
/>
<!-- ModifierOrder 检查修饰符的顺序,默认是 public,protected,private,abstract,static,final,transient,volatile,synchronized,native -->
<module
name=
"ModifierOrder"
/>
<!-- 检查是否有多余的修饰符,例如:接口中的方法不必使用public、abstract修饰 -->
<module
name=
"RedundantModifier"
/>
<!--- 字符串比较必须使用 equals() -->
<module
name=
"StringLiteralEquality"
/>
<!-- if-else嵌套语句个数 最多4层 -->
<module
name=
"NestedIfDepth"
>
<property
name=
"max"
value=
"3"
/>
</module>
<!-- try-catch 嵌套语句个数 最多2层 -->
<module
name=
"NestedTryDepth"
>
<property
name=
"max"
value=
"2"
/>
</module>
<!--空白行分隔符检查-->
<module
name=
"EmptyLineSeparator"
>
<property
name=
"allowNoEmptyLineBetweenFields"
value=
"true"
/>
</module>
<!--点号分隔新起一行-->
<module
name=
"SeparatorWrap"
>
<property
name=
"id"
value=
"SeparatorWrapDot"
/>
<property
name=
"tokens"
value=
"DOT"
/>
<property
name=
"option"
value=
"nl"
/>
</module>
<!--逗号分隔在行尾-->
<module
name=
"SeparatorWrap"
>
<property
name=
"id"
value=
"SeparatorWrapComma"
/>
<property
name=
"tokens"
value=
"COMMA"
/>
<property
name=
"option"
value=
"EOL"
/>
</module>
<!-- static, non-final fields -->
<module
name=
"StaticVariableName"
>
<property
name=
"format"
value=
"(^[A-Z0-9_]{0,40}$)"
/>
</module>
<!--检查常量名称是否符合格式属性指定的格式-->
<module
name=
"ConstantName"
>
<property
name=
"format"
value=
"(^[A-Z0-9_]{0,40}$)"
/>
</module>
<!--检查包名称是否符合格式属性指定的格式-->
<module
name=
"PackageName"
>
<property
name=
"format"
value=
"^[a-z]+(\.[a-z][a-z0-9]*)*$"
/>
</module>
<!--检查类型名称是否符合格式属性指定的格式-->
<module
name=
"TypeName"
/>
<!--检查实例变量名称是否符合格式属性指定的格式-->
<module
name=
"MemberName"
>
<property
name=
"format"
value=
"^[a-z][a-zA-Z0-9]*$"
/>
</module>
<!--检查参数名称是否符合格式属性指定的格式-->
<module
name=
"ParameterName"
>
<property
name=
"format"
value=
"^[a-z]([a-zA-Z0-9]*)?$"
/>
</module>
<!--catch参数-->
<module
name=
"CatchParameterName"
>
<property
name=
"format"
value=
"^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"
/>
</module>
<!--检查本地、非最终变量名称是否符合格式属性指定的格式-->
<module
name=
"LocalVariableName"
>
<property
name=
"tokens"
value=
"VARIABLE_DEF"
/>
<property
name=
"format"
value=
"^[a-z]([a-zA-Z0-9]*)?$"
/>
</module>
<module
name=
"ClassTypeParameterName"
>
<property
name=
"format"
value=
"(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"
/>
</module>
<module
name=
"MethodTypeParameterName"
>
<property
name=
"format"
value=
"(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"
/>
</module>
<module
name=
"InterfaceTypeParameterName"
>
<property
name=
"format"
value=
"(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"
/>
</module>
<!--检查没有finalize()方法定义在类中-->
<module
name=
"NoFinalizer"
/>
<!--检查<>周围的空格-->
<module
name=
"GenericWhitespace"
/>
<!-- 代码缩进 -->
<module
name=
"Indentation"
>
<property
name=
"basicOffset"
value=
"4"
/>
<property
name=
"braceAdjustment"
value=
"0"
/>
<property
name=
"caseIndent"
value=
"4"
/>
<property
name=
"throwsIndent"
value=
"4"
/>
<property
name=
"lineWrappingIndentation"
value=
"8"
/>
<property
name=
"arrayInitIndent"
value=
"4"
/>
</module>
<!--检查验证缩写(连续大写字母)的长度标识符的名称,它也可以强制执行骆驼命名-->
<module
name=
"AbbreviationAsWordInName"
>
<property
name=
"ignoreFinal"
value=
"false"
/>
<property
name=
"allowedAbbreviationLength"
value=
"2"
/>
</module>
<!--检查重载方法是否组合在一起-->
<module
name=
"OverloadMethodsDeclarationOrder"
/>
<!--检查变量声明和首次使用之间的距离-->
<!--<module name="VariableDeclarationUsageDistance"/>-->
<!--<module name="CustomImportOrder">-->
<!--<property name="sortImportsInGroupAlphabetically" value="true"/>-->
<!--<property name="separateLineBetweenGroups" value="true"/>-->
<!--<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>-->
<!--</module>-->
<module
name=
"MethodParamPad"
/>
<module
name=
"ParenPad"
/>
<!--<module name="OperatorWrap">-->
<!--<property name="option" value="NL"/>-->
<!--<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>-->
<!--</module>-->
<!--检查注解位置-->
<module
name=
"AnnotationLocation"
>
<property
name=
"id"
value=
"AnnotationLocationMostCases"
/>
<property
name=
"tokens"
value=
"CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"
/>
</module>
<module
name=
"AnnotationLocation"
>
<property
name=
"id"
value=
"AnnotationLocationVariables"
/>
<property
name=
"tokens"
value=
"VARIABLE_DEF"
/>
<property
name=
"allowSamelineMultipleAnnotations"
value=
"true"
/>
</module>
<!--<module name="NonEmptyAtclauseDescription"/>-->
<!--<module name="JavadocTagContinuationIndentation"/>-->
<!--<module name="SummaryJavadoc">-->
<!--<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>-->
<!--</module>-->
<!--<module name="JavadocParagraph"/>-->
<!--<module name="AtclauseOrder">-->
<!--<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>-->
<!--<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>-->
<!--</module>-->
<!-- 检查类和接口的javadoc 默认不检查author 和version tags
authorFormat: 检查author标签的格式
versionFormat: 检查version标签的格式
scope: 可以检查的类的范围,例如:public只能检查public修饰的类,private可以检查所有的类
excludeScope: 不能检查的类的范围,例如:public,public的类将不被检查,但访问权限小于public的类仍然会检查,其他的权限以此类推
tokens: 该属性适用的类型,例如:CLASS_DEF,INTERFACE_DEF -->
<!--<module name="JavadocType">-->
<!--<property name="authorFormat" value="\S"/>-->
<!--<property name="scope" value="protected"/>-->
<!--<property name="tokens" value="CLASS_DEF,INTERFACE_DEF"/>-->
<!--</module>-->
<!-- 检查方法的javadoc的注释
scope: 可以检查的方法的范围,例如:public只能检查public修饰的方法,private可以检查所有的方法
allowMissingParamTags: 是否忽略对参数注释的检查
allowMissingThrowsTags: 是否忽略对throws注释的检查
allowMissingReturnTag: 是否忽略对return注释的检查 -->
<!--<module name="JavadocMethod">-->
<!--<property name="scope" value="public"/>-->
<!--<property name="allowMissingParamTags" value="true"/>-->
<!--<property name="allowMissingThrowsTags" value="true"/>-->
<!--<property name="allowMissingReturnTag" value="true"/>-->
<!--<property name="minLineCount" value="2"/>-->
<!--<property name="allowedAnnotations" value="Override, Test"/>-->
<!--<property name="allowThrowsTagsForSubclasses" value="true"/>-->
<!--</module>-->
<!-- 检查类变量的注释
scope: 检查变量的范围,例如:public只能检查public修饰的变量,private可以检查所有的变量 -->
<!--<module name="JavadocVariable">-->
<!--<property name="scope" value="private"/>-->
<!--</module>-->
<!--检查方法名称是否符合格式属性指定的格式-->
<module
name=
"MethodName"
>
<property
name=
"format"
value=
"^[a-z][a-z0-9][a-zA-Z0-9_]*$"
/>
</module>
<!--<module name="SingleLineJavadoc">-->
<!--<property name="ignoreInlineTags" value="false"/>-->
<!--</module>-->
<!--检查空catch块-->
<module
name=
"EmptyCatchBlock"
>
<property
name=
"exceptionVariableName"
value=
"expected"
/>
</module>
<!--<module name="CommentsIndentation"/>-->
</module>
</module>
litemall-admin-api/pom.xml
View file @
40a55157
...
@@ -9,7 +9,12 @@
...
@@ -9,7 +9,12 @@
<artifactId>
litemall
</artifactId>
<artifactId>
litemall
</artifactId>
<version>
0.1.0
</version>
<version>
0.1.0
</version>
</parent>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<maven-checkstyle-plugin.version>
2.17
</maven-checkstyle-plugin.version>
<checkstyle.version>
7.6
</checkstyle.version>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
...
@@ -39,5 +44,39 @@
...
@@ -39,5 +44,39 @@
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<version>
${maven-checkstyle-plugin.version}
</version>
<dependencies>
<dependency>
<groupId>
com.puppycrawl.tools
</groupId>
<artifactId>
checkstyle
</artifactId>
<version>
${checkstyle.version}
</version>
</dependency>
</dependencies>
<configuration>
<sourceDirectories>
<sourceDirectory>
${basedir}/src/main/java
</sourceDirectory>
</sourceDirectories>
</configuration>
<executions>
<execution>
<id>
checkstyle
</id>
<phase>
validate
</phase>
<goals>
<goal>
check
</goal>
</goals>
<configuration>
<configLocation>
checkstyle.xml
</configLocation>
<encoding>
${project.reporting.outputEncoding}
</encoding>
<failOnViolation>
true
</failOnViolation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>
\ No newline at end of file
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java
View file @
40a55157
...
@@ -120,11 +120,11 @@ public class AdminOrderService {
...
@@ -120,11 +120,11 @@ public class AdminOrderService {
wxPayRefundRequest
.
setTotalFee
(
totalFee
);
wxPayRefundRequest
.
setTotalFee
(
totalFee
);
wxPayRefundRequest
.
setRefundFee
(
totalFee
);
wxPayRefundRequest
.
setRefundFee
(
totalFee
);
WxPayRefundResult
wxPayRefundResult
=
null
;
WxPayRefundResult
wxPayRefundResult
;
try
{
try
{
wxPayRefundResult
=
wxPayService
.
refund
(
wxPayRefundRequest
);
wxPayRefundResult
=
wxPayService
.
refund
(
wxPayRefundRequest
);
}
catch
(
WxPayException
e
)
{
}
catch
(
WxPayException
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
e
.
getMessage
(),
e
);
return
ResponseUtil
.
fail
(
ORDER_REFUND_FAILED
,
"订单退款失败"
);
return
ResponseUtil
.
fail
(
ORDER_REFUND_FAILED
,
"订单退款失败"
);
}
}
if
(!
wxPayRefundResult
.
getReturnCode
().
equals
(
"SUCCESS"
))
{
if
(!
wxPayRefundResult
.
getReturnCode
().
equals
(
"SUCCESS"
))
{
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/LogHelper.java
View file @
40a55157
...
@@ -24,10 +24,10 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -24,10 +24,10 @@ import javax.servlet.http.HttpServletRequest;
*/
*/
@Component
@Component
public
class
LogHelper
{
public
class
LogHelper
{
public
final
static
Integer
LOG_TYPE_GENERAL
=
0
;
public
static
final
Integer
LOG_TYPE_GENERAL
=
0
;
public
final
static
Integer
LOG_TYPE_AUTH
=
1
;
public
static
final
Integer
LOG_TYPE_AUTH
=
1
;
public
final
static
Integer
LOG_TYPE_ORDER
=
2
;
public
static
final
Integer
LOG_TYPE_ORDER
=
2
;
public
final
static
Integer
LOG_TYPE_OTHER
=
3
;
public
static
final
Integer
LOG_TYPE_OTHER
=
3
;
@Autowired
@Autowired
private
LitemallLogService
logService
;
private
LitemallLogService
logService
;
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminAuthorizingRealm.java
View file @
40a55157
...
@@ -12,8 +12,6 @@ import org.linlinjava.litemall.db.domain.LitemallAdmin;
...
@@ -12,8 +12,6 @@ import org.linlinjava.litemall.db.domain.LitemallAdmin;
import
org.linlinjava.litemall.db.service.LitemallAdminService
;
import
org.linlinjava.litemall.db.service.LitemallAdminService
;
import
org.linlinjava.litemall.db.service.LitemallPermissionService
;
import
org.linlinjava.litemall.db.service.LitemallPermissionService
;
import
org.linlinjava.litemall.db.service.LitemallRoleService
;
import
org.linlinjava.litemall.db.service.LitemallRoleService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -23,7 +21,6 @@ import java.util.Set;
...
@@ -23,7 +21,6 @@ import java.util.Set;
public
class
AdminAuthorizingRealm
extends
AuthorizingRealm
{
public
class
AdminAuthorizingRealm
extends
AuthorizingRealm
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AdminAuthorizingRealm
.
class
);
@Autowired
@Autowired
private
LitemallAdminService
adminService
;
private
LitemallAdminService
adminService
;
@Autowired
@Autowired
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java
View file @
40a55157
...
@@ -122,7 +122,7 @@ public class AdminAuthController {
...
@@ -122,7 +122,7 @@ public class AdminAuthController {
data
.
put
(
"roles"
,
roles
);
data
.
put
(
"roles"
,
roles
);
// NOTE
// NOTE
// 这里需要转换perms结构,因为对于前端而已API形式的权限更容易理解
// 这里需要转换perms结构,因为对于前端而已API形式的权限更容易理解
data
.
put
(
"perms"
,
toA
PI
(
permissions
));
data
.
put
(
"perms"
,
toA
pi
(
permissions
));
return
ResponseUtil
.
ok
(
data
);
return
ResponseUtil
.
ok
(
data
);
}
}
...
@@ -130,7 +130,7 @@ public class AdminAuthController {
...
@@ -130,7 +130,7 @@ public class AdminAuthController {
private
ApplicationContext
context
;
private
ApplicationContext
context
;
private
HashMap
<
String
,
String
>
systemPermissionsMap
=
null
;
private
HashMap
<
String
,
String
>
systemPermissionsMap
=
null
;
private
Collection
<
String
>
toA
PI
(
Set
<
String
>
permissions
)
{
private
Collection
<
String
>
toA
pi
(
Set
<
String
>
permissions
)
{
if
(
systemPermissionsMap
==
null
)
{
if
(
systemPermissionsMap
==
null
)
{
systemPermissionsMap
=
new
HashMap
<>();
systemPermissionsMap
=
new
HashMap
<>();
final
String
basicPackage
=
"org.linlinjava.litemall.admin"
;
final
String
basicPackage
=
"org.linlinjava.litemall.admin"
;
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminCouponController.java
View file @
40a55157
...
@@ -51,8 +51,8 @@ public class AdminCouponController {
...
@@ -51,8 +51,8 @@ public class AdminCouponController {
@RequestParam
(
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
limit
,
@Sort
@RequestParam
(
defaultValue
=
"add_time"
)
String
sort
,
@Sort
@RequestParam
(
defaultValue
=
"add_time"
)
String
sort
,
@Order
@RequestParam
(
defaultValue
=
"desc"
)
String
order
)
{
@Order
@RequestParam
(
defaultValue
=
"desc"
)
String
order
)
{
List
<
LitemallCouponUser
>
couponList
=
couponUserService
.
queryList
(
userId
,
couponId
,
status
,
page
,
limit
,
sort
List
<
LitemallCouponUser
>
couponList
=
couponUserService
.
queryList
(
userId
,
couponId
,
status
,
page
,
,
order
);
limit
,
sort
,
order
);
return
ResponseUtil
.
okList
(
couponList
);
return
ResponseUtil
.
okList
(
couponList
);
}
}
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminGrouponController.java
View file @
40a55157
...
@@ -50,19 +50,19 @@ public class AdminGrouponController {
...
@@ -50,19 +50,19 @@ public class AdminGrouponController {
List
<
Map
<
String
,
Object
>>
groupons
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
groupons
=
new
ArrayList
<>();
for
(
LitemallGroupon
groupon
:
grouponList
)
{
for
(
LitemallGroupon
groupon
:
grouponList
)
{
try
{
try
{
Map
<
String
,
Object
>
R
ecordData
=
new
HashMap
<>();
Map
<
String
,
Object
>
r
ecordData
=
new
HashMap
<>();
List
<
LitemallGroupon
>
subGrouponList
=
grouponService
.
queryJoinRecord
(
groupon
.
getId
());
List
<
LitemallGroupon
>
subGrouponList
=
grouponService
.
queryJoinRecord
(
groupon
.
getId
());
LitemallGrouponRules
rules
=
rulesService
.
queryById
(
groupon
.
getRulesId
());
LitemallGrouponRules
rules
=
rulesService
.
queryById
(
groupon
.
getRulesId
());
LitemallGoods
goods
=
goodsService
.
findById
(
rules
.
getGoodsId
());
LitemallGoods
goods
=
goodsService
.
findById
(
rules
.
getGoodsId
());
R
ecordData
.
put
(
"groupon"
,
groupon
);
r
ecordData
.
put
(
"groupon"
,
groupon
);
R
ecordData
.
put
(
"subGroupons"
,
subGrouponList
);
r
ecordData
.
put
(
"subGroupons"
,
subGrouponList
);
R
ecordData
.
put
(
"rules"
,
rules
);
r
ecordData
.
put
(
"rules"
,
rules
);
R
ecordData
.
put
(
"goods"
,
goods
);
r
ecordData
.
put
(
"goods"
,
goods
);
groupons
.
add
(
R
ecordData
);
groupons
.
add
(
r
ecordData
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment