Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tjmdp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
other-project
tjmdp
Commits
8ff5707b
Commit
8ff5707b
authored
Apr 01, 2019
by
liuchao
Browse files
Options
Browse Files
Download
Plain Diff
no message
parents
a5f99a45
8d8ebbc2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1027 additions
and
32 deletions
+1027
-32
.gitignore
.gitignore
+0
-0
pom.xml
pom.xml
+61
-28
WxMaConfiguration.java
src/main/java/com/qiankun/config/WxMaConfiguration.java
+152
-0
WxMaProperties.java
src/main/java/com/qiankun/config/WxMaProperties.java
+101
-0
RainbowPlanController.java
...qiankun/controller/rainbowplan/RainbowPlanController.java
+0
-0
RainbowPlanUserDao.java
src/main/java/com/qiankun/dao/RainbowPlanUserDao.java
+8
-0
RainbowPlanUserDaoImpl.java
src/main/java/com/qiankun/dao/RainbowPlanUserDaoImpl.java
+14
-0
WishDao.java
src/main/java/com/qiankun/dao/WishDao.java
+12
-0
WishDaoImpl.java
src/main/java/com/qiankun/dao/WishDaoImpl.java
+21
-0
RainbowPlanUser.java
src/main/java/com/qiankun/entity/RainbowPlanUser.java
+162
-0
User.java
src/main/java/com/qiankun/entity/User.java
+1
-1
Wish.java
src/main/java/com/qiankun/entity/Wish.java
+90
-0
JwtTokenUtil.java
src/main/java/com/qiankun/utils/JwtTokenUtil.java
+128
-0
LoginReqVo.java
src/main/java/com/qiankun/vo/LoginReqVo.java
+49
-0
PublishWish.java
src/main/java/com/qiankun/vo/PublishWish.java
+52
-0
RegisterInfo.java
src/main/java/com/qiankun/vo/RegisterInfo.java
+49
-0
UserInfo.java
src/main/java/com/qiankun/vo/UserInfo.java
+115
-0
spring-beans.xml
src/main/resources/spring-beans.xml
+3
-1
system.properties
src/main/resources/system.properties
+9
-2
login_bg.png
src/main/webapp/resources/images/login_bg.png
+0
-0
No files found.
.gitignore
View file @
8ff5707b
pom.xml
View file @
8ff5707b
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
<dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.
2.1
</version>
<version>
3.
7
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
@@ -100,12 +100,12 @@
...
@@ -100,12 +100,12 @@
<version>
2.2
</version>
<version>
2.2
</version>
</dependency>
</dependency>
<
dependency
>
<
!--<dependency>--
>
<
groupId>
net.sf.json-lib
</groupId
>
<
!--<groupId>net.sf.json-lib</groupId>--
>
<
artifactId>
json-lib
</artifactId
>
<
!--<artifactId>json-lib</artifactId>--
>
<
classifier>
jdk15
</classifier
>
<
!--<classifier>jdk15</classifier>--
>
<
version>
2.4
</version
>
<
!--<version>2.4</version>--
>
<
/dependency
>
<
!--</dependency>--
>
...
@@ -116,11 +116,11 @@
...
@@ -116,11 +116,11 @@
<type>
jar
</type>
<type>
jar
</type>
</dependency>
</dependency>
<
dependency
>
<
!--<dependency>--
>
<
groupId>
org.codehaus.jackson
</groupId
>
<
!--<groupId>org.codehaus.jackson</groupId>--
>
<
artifactId>
jackson-mapper-asl
</artifactId
>
<
!--<artifactId>jackson-mapper-asl</artifactId>--
>
<
version>
1.9.13
</version
>
<
!--<version>1.9.13</version>--
>
<
/dependency
>
<
!--</dependency>--
>
<dependency>
<dependency>
<groupId>
commons-dbcp
</groupId>
<groupId>
commons-dbcp
</groupId>
...
@@ -128,12 +128,12 @@
...
@@ -128,12 +128,12 @@
<version>
1.4
</version>
<version>
1.4
</version>
</dependency>
</dependency>
<
dependency
>
<
!--<dependency>--
>
<
groupId>
org.apache.httpcomponents
</groupId
>
<
!--<groupId>org.apache.httpcomponents</groupId>--
>
<
artifactId>
httpclient
</artifactId
>
<
!--<artifactId>httpclient</artifactId>--
>
<
version>
4.3.2
</version
>
<
!--<version>4.3.2</version>--
>
<
scope>
test
</scope
>
<
!--<scope>test</scope>--
>
<
/dependency
>
<
!--</dependency>--
>
<dependency>
<dependency>
<groupId>
opensymphony
</groupId>
<groupId>
opensymphony
</groupId>
...
@@ -160,17 +160,17 @@
...
@@ -160,17 +160,17 @@
<version>
1.3.1
</version>
<version>
1.3.1
</version>
</dependency>
</dependency>
<
dependency
>
<
!--<dependency>--
>
<
groupId>
com.sun.mail
</groupId
>
<
!--<groupId>com.sun.mail</groupId>--
>
<
artifactId>
javax.mail
</artifactId
>
<
!--<artifactId>javax.mail</artifactId>--
>
<
version>
1.5.1
</version
>
<
!--<version>1.5.1</version>--
>
<
/dependency
>
<
!--</dependency>--
>
<
dependency
>
<
!--<dependency>--
>
<
groupId>
org.apache.httpcomponents
</groupId
>
<
!--<groupId>org.apache.httpcomponents</groupId>--
>
<
artifactId>
httpmime
</artifactId
>
<
!--<artifactId>httpmime</artifactId>--
>
<
version>
4.3.2
</version
>
<
!--<version>4.3.2</version>--
>
<
/dependency
>
<
!--</dependency>--
>
<dependency>
<dependency>
...
@@ -203,6 +203,31 @@
...
@@ -203,6 +203,31 @@
<version>
1.5.1
</version>
<version>
1.5.1
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.binarywang
</groupId>
<artifactId>
weixin-java-miniapp
</artifactId>
<version>
3.3.0
</version>
</dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
<version>
0.9.0
</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.httpcomponents</groupId>-->
<!--<artifactId>httpclient</artifactId>-->
<!--<exclusions>-->
<!--<exclusion>-->
<!--<artifactId>commons-logging</artifactId>-->
<!--<groupId>commons-logging</groupId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.httpcomponents</groupId>-->
<!--<artifactId>httpmime</artifactId>-->
<!--</dependency>-->
<dependency>
<dependency>
<groupId>
junit
</groupId>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<artifactId>
junit
</artifactId>
...
@@ -235,6 +260,14 @@
...
@@ -235,6 +260,14 @@
<groupId>
org.eclipse.jetty
</groupId>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-maven-plugin
</artifactId>
<artifactId>
jetty-maven-plugin
</artifactId>
</plugin>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
8
</source>
<target>
8
</target>
</configuration>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
src/main/java/com/qiankun/config/WxMaConfiguration.java
0 → 100755
View file @
8ff5707b
package
com
.
qiankun
.
config
;
import
cn.binarywang.wx.miniapp.api.WxMaService
;
import
cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl
;
import
cn.binarywang.wx.miniapp.bean.WxMaKefuMessage
;
import
cn.binarywang.wx.miniapp.bean.WxMaMessage
;
import
cn.binarywang.wx.miniapp.bean.WxMaTemplateData
;
import
cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage
;
import
cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig
;
import
cn.binarywang.wx.miniapp.message.WxMaMessageHandler
;
import
cn.binarywang.wx.miniapp.message.WxMaMessageRouter
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
me.chanjar.weixin.common.bean.result.WxMediaUploadResult
;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
me.chanjar.weixin.common.session.WxSessionManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
javax.annotation.PostConstruct
;
import
java.io.File
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Configuration
public
class
WxMaConfiguration
{
private
final
WxMaMessageHandler
templateMsgHandler
=
new
WxMaMessageHandler
()
{
public
void
handle
(
WxMaMessage
wxMessage
,
Map
<
String
,
Object
>
context
,
WxMaService
service
,
WxSessionManager
sessionManager
)
throws
WxErrorException
{
service
.
getMsgService
().
sendTemplateMsg
(
WxMaTemplateMessage
.
builder
()
.
templateId
(
"此处更换为自己的模板id"
)
.
formId
(
"自己替换可用的formid"
)
.
data
(
Lists
.
newArrayList
(
new
WxMaTemplateData
(
"keyword1"
,
"339208499"
,
"#173177"
)))
.
toUser
(
wxMessage
.
getFromUser
())
.
build
());
}
};
private
final
WxMaMessageHandler
logHandler
=
new
WxMaMessageHandler
()
{
public
void
handle
(
WxMaMessage
wxMessage
,
Map
<
String
,
Object
>
context
,
WxMaService
service
,
WxSessionManager
sessionManager
)
throws
WxErrorException
{
System
.
out
.
println
(
"收到消息:"
+
wxMessage
.
toString
());
service
.
getMsgService
().
sendKefuMsg
(
WxMaKefuMessage
.
newTextBuilder
().
content
(
"收到信息为:"
+
wxMessage
.
toJson
())
.
toUser
(
wxMessage
.
getFromUser
()).
build
());
}
};
private
final
WxMaMessageHandler
textHandler
=
new
WxMaMessageHandler
()
{
public
void
handle
(
WxMaMessage
wxMessage
,
Map
<
String
,
Object
>
context
,
WxMaService
service
,
WxSessionManager
sessionManager
)
throws
WxErrorException
{
service
.
getMsgService
().
sendKefuMsg
(
WxMaKefuMessage
.
newTextBuilder
().
content
(
"回复文本消息"
)
.
toUser
(
wxMessage
.
getFromUser
()).
build
());
}
};
private
final
WxMaMessageHandler
picHandler
=
new
WxMaMessageHandler
()
{
public
void
handle
(
WxMaMessage
wxMessage
,
Map
<
String
,
Object
>
context
,
WxMaService
service
,
WxSessionManager
sessionManager
)
throws
WxErrorException
{
try
{
WxMediaUploadResult
uploadResult
=
service
.
getMediaService
()
.
uploadMedia
(
"image"
,
"png"
,
ClassLoader
.
getSystemResourceAsStream
(
"tmp.png"
));
service
.
getMsgService
().
sendKefuMsg
(
WxMaKefuMessage
.
newImageBuilder
()
.
mediaId
(
uploadResult
.
getMediaId
())
.
toUser
(
wxMessage
.
getFromUser
())
.
build
());
}
catch
(
WxErrorException
e
)
{
e
.
printStackTrace
();
}
}
};
private
final
WxMaMessageHandler
qrcodeHandler
=
new
WxMaMessageHandler
()
{
public
void
handle
(
WxMaMessage
wxMessage
,
Map
<
String
,
Object
>
context
,
WxMaService
service
,
WxSessionManager
sessionManager
)
throws
WxErrorException
{
try
{
final
File
file
=
service
.
getQrcodeService
().
createQrcode
(
"123"
,
430
);
WxMediaUploadResult
uploadResult
=
service
.
getMediaService
().
uploadMedia
(
"image"
,
file
);
service
.
getMsgService
().
sendKefuMsg
(
WxMaKefuMessage
.
newImageBuilder
()
.
mediaId
(
uploadResult
.
getMediaId
())
.
toUser
(
wxMessage
.
getFromUser
())
.
build
());
}
catch
(
WxErrorException
e
)
{
e
.
printStackTrace
();
}
}
};
@Autowired
private
WxMaProperties
properties
;
private
static
Map
<
String
,
WxMaMessageRouter
>
routers
=
Maps
.
newHashMap
();
private
static
Map
<
String
,
WxMaService
>
maServices
=
Maps
.
newHashMap
();
// public WxMaConfiguration(WxMaProperties properties) {
// this.properties = properties;
// }
public
static
Map
<
String
,
WxMaMessageRouter
>
getRouters
()
{
return
routers
;
}
public
static
WxMaService
getMaService
(
String
appid
)
{
WxMaService
wxService
=
maServices
.
get
(
appid
);
if
(
wxService
==
null
)
{
throw
new
IllegalArgumentException
(
String
.
format
(
"未找到对应appid=[%s]的配置,请核实!"
,
appid
));
}
return
wxService
;
}
// public WxMaConfiguration(){
// this.properties = new WxMaProperties();
// }
@Bean
public
Object
services
()
{
maServices
=
this
.
properties
.
getConfigs
()
.
stream
()
.
map
(
a
->
{
WxMaInMemoryConfig
config
=
new
WxMaInMemoryConfig
();
config
.
setAppid
(
a
.
getAppid
());
config
.
setSecret
(
a
.
getSecret
());
config
.
setToken
(
a
.
getToken
());
config
.
setAesKey
(
a
.
getAesKey
());
config
.
setMsgDataFormat
(
a
.
getMsgDataFormat
());
WxMaService
service
=
new
WxMaServiceImpl
();
service
.
setWxMaConfig
(
config
);
routers
.
put
(
a
.
getAppid
(),
this
.
newRouter
(
service
));
return
service
;
}).
collect
(
Collectors
.
toMap
(
s
->
s
.
getWxMaConfig
().
getAppid
(),
a
->
a
));
return
Boolean
.
TRUE
;
}
private
WxMaMessageRouter
newRouter
(
WxMaService
service
)
{
final
WxMaMessageRouter
router
=
new
WxMaMessageRouter
(
service
);
router
.
rule
().
handler
(
logHandler
).
next
()
.
rule
().
async
(
false
).
content
(
"模板"
).
handler
(
templateMsgHandler
).
end
()
.
rule
().
async
(
false
).
content
(
"文本"
).
handler
(
textHandler
).
end
()
.
rule
().
async
(
false
).
content
(
"图片"
).
handler
(
picHandler
).
end
()
.
rule
().
async
(
false
).
content
(
"二维码"
).
handler
(
qrcodeHandler
).
end
();
return
router
;
}
}
src/main/java/com/qiankun/config/WxMaProperties.java
0 → 100755
View file @
8ff5707b
package
com
.
qiankun
.
config
;
import
com.google.common.collect.Lists
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.ResourceBundle
;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Component
public
class
WxMaProperties
{
private
List
<
Config
>
configs
;
public
List
<
Config
>
getConfigs
()
{
return
configs
;
}
public
void
setConfigs
(
List
<
Config
>
configs
)
{
this
.
configs
=
configs
;
}
public
WxMaProperties
(){
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
"system"
);
Config
config
=
new
Config
();
config
.
setAppid
(
rb
.
getString
(
"rainbowplan.appid"
));
config
.
setSecret
(
rb
.
getString
(
"rainbowplan.secret"
));
configs
=
Lists
.
newArrayList
();
configs
.
add
(
config
);
}
public
static
class
Config
{
/**
* 设置微信小程序的appid
*/
private
String
appid
;
/**
* 设置微信小程序的Secret
*/
private
String
secret
;
/**
* 设置微信小程序消息服务器配置的token
*/
private
String
token
;
/**
* 设置微信小程序消息服务器配置的EncodingAESKey
*/
private
String
aesKey
;
/**
* 消息格式,XML或者JSON
*/
private
String
msgDataFormat
;
public
String
getAppid
()
{
return
appid
;
}
public
void
setAppid
(
String
appid
)
{
this
.
appid
=
appid
;
}
public
String
getSecret
()
{
return
secret
;
}
public
void
setSecret
(
String
secret
)
{
this
.
secret
=
secret
;
}
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
public
String
getAesKey
()
{
return
aesKey
;
}
public
void
setAesKey
(
String
aesKey
)
{
this
.
aesKey
=
aesKey
;
}
public
String
getMsgDataFormat
()
{
return
msgDataFormat
;
}
public
void
setMsgDataFormat
(
String
msgDataFormat
)
{
this
.
msgDataFormat
=
msgDataFormat
;
}
}
}
src/main/java/com/qiankun/controller/rainbowplan/RainbowPlanController.java
0 → 100644
View file @
8ff5707b
This diff is collapsed.
Click to expand it.
src/main/java/com/qiankun/dao/RainbowPlanUserDao.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
dao
;
import
com.qiankun.dao.core.IDao
;
import
com.qiankun.entity.RainbowPlanUser
;
public
interface
RainbowPlanUserDao
extends
IDao
<
RainbowPlanUser
,
String
>
{
RainbowPlanUser
findByOpenid
(
String
openid
);
}
src/main/java/com/qiankun/dao/RainbowPlanUserDaoImpl.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
dao
;
import
com.qiankun.dao.core.AbsDao
;
import
com.qiankun.dao.core.Hints
;
import
com.qiankun.entity.RainbowPlanUser
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
RainbowPlanUserDaoImpl
extends
AbsDao
<
RainbowPlanUser
,
String
>
implements
RainbowPlanUserDao
{
@Override
public
RainbowPlanUser
findByOpenid
(
String
openid
)
{
return
findUnique
(
"from RainbowPlanUser where openid=?"
,
new
Hints
(),
openid
);
}
}
src/main/java/com/qiankun/dao/WishDao.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
dao
;
import
com.qiankun.dao.core.IDao
;
import
com.qiankun.entity.Wish
;
import
java.util.List
;
public
interface
WishDao
extends
IDao
<
Wish
,
String
>
{
List
<
Wish
>
findByRainbowPlanUserId
(
String
id
);
Wish
findById
(
String
id
);
}
src/main/java/com/qiankun/dao/WishDaoImpl.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
dao
;
import
com.qiankun.dao.core.AbsDao
;
import
com.qiankun.dao.core.Hints
;
import
com.qiankun.entity.Wish
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
class
WishDaoImpl
extends
AbsDao
<
Wish
,
String
>
implements
WishDao
{
@Override
public
List
<
Wish
>
findByRainbowPlanUserId
(
String
rainbowPlanUserId
)
{
return
find
(
" from Wish where rainbowPlanUserId = ? order by createTime desc"
,
new
Hints
(
0
),
rainbowPlanUserId
);
}
@Override
public
Wish
findById
(
String
id
)
{
return
findUnique
(
"from Wish where id = ?"
,
new
Hints
(),
id
);
}
}
src/main/java/com/qiankun/entity/RainbowPlanUser.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
entity
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.omg.CORBA.PUBLIC_MEMBER
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.util.Date
;
@Entity
public
class
RainbowPlanUser
{
public
static
final
int
STATUS_UNAUDIT
=
0
;
public
static
final
int
STATUS_AUDIT
=
1
;
@Id
@GenericGenerator
(
name
=
"systemUUID"
,
strategy
=
"uuid2"
)
@GeneratedValue
(
generator
=
"systemUUID"
)
private
String
id
;
private
String
openid
;
//小程序用户ID
private
String
unionid
;
//微信全局ID
private
String
phone
;
//注册手机号
private
String
name
;
//真实姓名
private
String
nickName
;
//昵称
private
String
gender
;
//性别
private
String
birthday
;
//出生日期
private
String
bedNum
;
//楼层床号
private
String
receiveName
;
//收件人姓名
private
String
connectTel
;
//联系方式
private
String
receiveAddress
;
//收件地址
private
int
status
;
//用户状态 0:已注册未审核,1:已审核
private
String
avatar
;
//头像图片名
private
Date
createTime
=
new
Date
();
private
String
inviterId
;
//邀请者ID
public
String
getInviterId
()
{
return
inviterId
;
}
public
void
setInviterId
(
String
inviterId
)
{
this
.
inviterId
=
inviterId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
String
getGender
()
{
return
gender
;
}
public
void
setGender
(
String
gender
)
{
this
.
gender
=
gender
;
}
public
String
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
String
birthday
)
{
this
.
birthday
=
birthday
;
}
public
String
getBedNum
()
{
return
bedNum
;
}
public
void
setBedNum
(
String
bedNum
)
{
this
.
bedNum
=
bedNum
;
}
public
String
getReceiveName
()
{
return
receiveName
;
}
public
void
setReceiveName
(
String
receiveName
)
{
this
.
receiveName
=
receiveName
;
}
public
String
getConnectTel
()
{
return
connectTel
;
}
public
void
setConnectTel
(
String
connectTel
)
{
this
.
connectTel
=
connectTel
;
}
public
String
getReceiveAddress
()
{
return
receiveAddress
;
}
public
void
setReceiveAddress
(
String
receiveAddress
)
{
this
.
receiveAddress
=
receiveAddress
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
}
src/main/java/com/qiankun/entity/User.java
View file @
8ff5707b
...
@@ -42,7 +42,7 @@ public class User {
...
@@ -42,7 +42,7 @@ public class User {
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
cascade
=
{
CascadeType
.
ALL
},
orphanRemoval
=
true
,
mappedBy
=
"user"
)
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
cascade
=
{
CascadeType
.
ALL
},
orphanRemoval
=
true
,
mappedBy
=
"user"
)
@JsonIgnore
@JsonIgnore
private
Set
<
Product
>
product
=
new
HashSet
<
>();
private
Set
<
Product
>
product
=
new
HashSet
<
Product
>();
private
Boolean
isRemove
=
false
;
//是否删除用户,默认false
private
Boolean
isRemove
=
false
;
//是否删除用户,默认false
...
...
src/main/java/com/qiankun/entity/Wish.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
entity
;
import
org.hibernate.annotations.GenericGenerator
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.util.Date
;
@Entity
public
class
Wish
{
public
static
final
int
STATUS_PUBLISH
=
0
;
public
static
final
int
STATUS_RECEIVE
=
1
;
public
static
final
int
STATUS_COMPLETE
=
2
;
@Id
@GenericGenerator
(
name
=
"systemUUID"
,
strategy
=
"uuid2"
)
@GeneratedValue
(
generator
=
"systemUUID"
)
private
String
id
;
//愿望ID
private
String
title
;
//愿望标题
private
String
content
;
//愿望内容
private
String
uploadImage
;
//上传的图片
private
int
status
;
//愿望状态,0:发布;1:领取;2:实现
private
String
volunteerId
;
//领取愿望的志愿者ID
private
String
rainbowPlanUserId
;
//小朋友ID
private
Date
createTime
=
new
Date
();
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getRainbowPlanUserId
()
{
return
rainbowPlanUserId
;
}
public
void
setRainbowPlanUserId
(
String
rainbowPlanUserId
)
{
this
.
rainbowPlanUserId
=
rainbowPlanUserId
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
String
getUploadImage
()
{
return
uploadImage
;
}
public
void
setUploadImage
(
String
uploadImage
)
{
this
.
uploadImage
=
uploadImage
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
String
getVolunteerId
()
{
return
volunteerId
;
}
public
void
setVolunteerId
(
String
volunteerId
)
{
this
.
volunteerId
=
volunteerId
;
}
}
src/main/java/com/qiankun/utils/JwtTokenUtil.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
utils
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Jwts
;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
@Component
public
class
JwtTokenUtil
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3301605591108950415L
;
private
static
final
String
CLAIM_KEY_USERNAME
=
"sub"
;
private
static
final
String
CLAIM_KEY_CREATED
=
"created"
;
private
String
secret
=
"ArgusMiniAppRainbowPlan"
;
private
Long
expiration
=
604800
l
;
public
String
getUsernameFromToken
(
String
token
)
{
String
username
;
try
{
final
Claims
claims
=
getClaimsFromToken
(
token
);
username
=
claims
.
getSubject
();
}
catch
(
Exception
e
)
{
username
=
null
;
}
return
username
;
}
public
Date
getCreatedDateFromToken
(
String
token
)
{
Date
created
;
try
{
final
Claims
claims
=
getClaimsFromToken
(
token
);
created
=
new
Date
((
Long
)
claims
.
get
(
CLAIM_KEY_CREATED
));
}
catch
(
Exception
e
)
{
created
=
null
;
}
return
created
;
}
public
Date
getExpirationDateFromToken
(
String
token
)
{
Date
expiration
;
try
{
final
Claims
claims
=
getClaimsFromToken
(
token
);
expiration
=
claims
.
getExpiration
();
}
catch
(
Exception
e
)
{
expiration
=
null
;
}
return
expiration
;
}
private
Claims
getClaimsFromToken
(
String
token
)
{
Claims
claims
;
try
{
claims
=
Jwts
.
parser
()
.
setSigningKey
(
secret
)
.
parseClaimsJws
(
token
)
.
getBody
();
}
catch
(
Exception
e
)
{
claims
=
null
;
}
return
claims
;
}
private
Date
generateExpirationDate
()
{
return
new
Date
(
System
.
currentTimeMillis
()
+
expiration
*
1000
);
}
public
Boolean
isTokenExpired
(
String
token
)
{
final
Date
expiration
=
getExpirationDateFromToken
(
token
);
return
expiration
.
before
(
new
Date
());
}
private
Boolean
isCreatedBeforeLastPasswordReset
(
Date
created
,
Date
lastPasswordReset
)
{
return
(
lastPasswordReset
!=
null
&&
created
.
before
(
lastPasswordReset
));
}
public
String
generateToken
(
String
openId
)
{
Map
<
String
,
Object
>
claims
=
new
HashMap
<>();
claims
.
put
(
CLAIM_KEY_USERNAME
,
openId
);
claims
.
put
(
CLAIM_KEY_CREATED
,
new
Date
());
return
generateToken
(
claims
);
}
String
generateToken
(
Map
<
String
,
Object
>
claims
)
{
return
Jwts
.
builder
()
.
setClaims
(
claims
)
.
setExpiration
(
generateExpirationDate
())
.
signWith
(
SignatureAlgorithm
.
HS512
,
secret
)
.
compact
();
}
public
Boolean
canTokenBeRefreshed
(
String
token
,
Date
lastPasswordReset
)
{
final
Date
created
=
getCreatedDateFromToken
(
token
);
return
!
isCreatedBeforeLastPasswordReset
(
created
,
lastPasswordReset
)
&&
!
isTokenExpired
(
token
);
}
public
String
refreshToken
(
String
token
)
{
String
refreshedToken
;
try
{
final
Claims
claims
=
getClaimsFromToken
(
token
);
claims
.
put
(
CLAIM_KEY_CREATED
,
new
Date
());
refreshedToken
=
generateToken
(
claims
);
}
catch
(
Exception
e
)
{
refreshedToken
=
null
;
}
return
refreshedToken
;
}
public
Boolean
validateToken
(
String
token
,
String
openId
)
{
final
String
username
=
getUsernameFromToken
(
token
);
// final Date created = getCreatedDateFromToken(token);
// final Date expiration = getExpirationDateFromToken(token);
return
(
username
.
equals
(
openId
)
&&
!
isTokenExpired
(
token
));
}
}
src/main/java/com/qiankun/vo/LoginReqVo.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
vo
;
public
class
LoginReqVo
{
private
String
code
;
private
String
signature
;
private
String
rawData
;
private
String
encryptedData
;
private
String
iv
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getSignature
()
{
return
signature
;
}
public
void
setSignature
(
String
signature
)
{
this
.
signature
=
signature
;
}
public
String
getRawData
()
{
return
rawData
;
}
public
void
setRawData
(
String
rawData
)
{
this
.
rawData
=
rawData
;
}
public
String
getEncryptedData
()
{
return
encryptedData
;
}
public
void
setEncryptedData
(
String
encryptedData
)
{
this
.
encryptedData
=
encryptedData
;
}
public
String
getIv
()
{
return
iv
;
}
public
void
setIv
(
String
iv
)
{
this
.
iv
=
iv
;
}
}
src/main/java/com/qiankun/vo/PublishWish.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
vo
;
import
org.springframework.web.multipart.MultipartFile
;
public
class
PublishWish
{
public
String
id
;
public
String
title
;
public
String
wish
;
public
String
wishImage
;
public
MultipartFile
file
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getWish
()
{
return
wish
;
}
public
void
setWish
(
String
wish
)
{
this
.
wish
=
wish
;
}
public
String
getWishImage
()
{
return
wishImage
;
}
public
void
setWishImage
(
String
wishImage
)
{
this
.
wishImage
=
wishImage
;
}
public
MultipartFile
getFile
()
{
return
file
;
}
public
void
setFile
(
MultipartFile
file
)
{
this
.
file
=
file
;
}
}
src/main/java/com/qiankun/vo/RegisterInfo.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
vo
;
public
class
RegisterInfo
{
public
String
name
;
public
String
phone
;
public
String
gender
;
public
String
openid
;
public
String
inviter
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getGender
()
{
return
gender
;
}
public
void
setGender
(
String
gender
)
{
this
.
gender
=
gender
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getInviter
()
{
return
inviter
;
}
public
void
setInviter
(
String
inviter
)
{
this
.
inviter
=
inviter
;
}
}
src/main/java/com/qiankun/vo/UserInfo.java
0 → 100644
View file @
8ff5707b
package
com
.
qiankun
.
vo
;
import
org.springframework.web.multipart.MultipartFile
;
public
class
UserInfo
{
public
String
uid
;
public
String
phone
;
public
String
name
;
public
String
nickName
;
public
String
gender
;
public
String
birthday
;
public
String
bedNum
;
public
String
receiveName
;
public
String
connectTel
;
public
String
receiveAddress
;
public
String
avatar
;
public
MultipartFile
file
;
public
String
getUid
()
{
return
uid
;
}
public
void
setUid
(
String
uid
)
{
this
.
uid
=
uid
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
String
getGender
()
{
return
gender
;
}
public
void
setGender
(
String
gender
)
{
this
.
gender
=
gender
;
}
public
String
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
String
birthday
)
{
this
.
birthday
=
birthday
;
}
public
String
getBedNum
()
{
return
bedNum
;
}
public
void
setBedNum
(
String
bedNum
)
{
this
.
bedNum
=
bedNum
;
}
public
String
getReceiveName
()
{
return
receiveName
;
}
public
void
setReceiveName
(
String
receiveName
)
{
this
.
receiveName
=
receiveName
;
}
public
String
getConnectTel
()
{
return
connectTel
;
}
public
void
setConnectTel
(
String
connectTel
)
{
this
.
connectTel
=
connectTel
;
}
public
String
getReceiveAddress
()
{
return
receiveAddress
;
}
public
void
setReceiveAddress
(
String
receiveAddress
)
{
this
.
receiveAddress
=
receiveAddress
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
public
MultipartFile
getFile
()
{
return
file
;
}
public
void
setFile
(
MultipartFile
file
)
{
this
.
file
=
file
;
}
}
src/main/resources/spring-beans.xml
View file @
8ff5707b
...
@@ -74,7 +74,8 @@
...
@@ -74,7 +74,8 @@
<context:annotation-config
/>
<context:annotation-config
/>
<context:component-scan
<context:component-scan
base-package=
"com.qiankun.service,com.qiankun.dao"
/>
base-package=
"com.qiankun"
/>
</beans>
</beans>
\ No newline at end of file
src/main/resources/system.properties
View file @
8ff5707b
file_path
=
D:/file/
#
file_path=D:/file/
#file_path=/usr/local/tomcat/upload/
file_path
=
/Users/liuyang/work/argus_work/tjmdp/udata
account
=
admin
account
=
admin
password
=
passed
password
=
passed
rainbowplan.appid
=
wxd097672957e48ba8
rainbowplan.secret
=
6500d648cc5715f8829dab993de746f3
rainbowplan.token
=
rainbowplan.aesKey
=
rainbowplan.msgDataFormat
:
JSON
\ No newline at end of file
src/main/webapp/resources/images/login_bg.png
0 → 100644
View file @
8ff5707b
372 KB
Write
Preview
Markdown
is supported
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