Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
reyun
manager
Commits
d474f3bd
Commit
d474f3bd
authored
Dec 27, 2017
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大后台token改为redis存储
parent
b83284fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
20 deletions
+73
-20
TkioAccountController.java
src/main/java/tkio/controller/TkioAccountController.java
+29
-2
TkioAccountService.java
src/main/java/tkio/service/TkioAccountService.java
+9
-4
TkioAccountServiceImpl.java
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
+33
-12
web.xml
src/main/webapp/WEB-INF/web.xml
+2
-2
No files found.
src/main/java/tkio/controller/TkioAccountController.java
View file @
d474f3bd
package
tkio
.
controller
;
import
common.model.BackVisit
;
import
common.model.Payment
;
import
common.model.Reminder
;
import
common.model.User
;
import
common.service.UserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,10 +30,34 @@ public class TkioAccountController {
}
//关闭到期提醒
@RequestMapping
(
value
=
"/forbiden/
{id}
"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/forbiden/"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
delete
(
@CurrentAccount
User
loginAccount
,
@RequestBody
User
resource
)
{
public
ResultModel
forbiden
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Reminder
resource
)
{
tkioAccountService
.
forbiden
(
loginAccount
,
resource
);
return
ResultModel
.
OK
();
}
//开启到期提醒
@RequestMapping
(
value
=
"/enable/"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
enable
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Reminder
resource
)
{
tkioAccountService
.
enable
(
loginAccount
,
resource
);
return
ResultModel
.
OK
();
}
//缴费
@RequestMapping
(
value
=
"/pay/"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
pay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Payment
resource
)
{
tkioAccountService
.
pay
(
loginAccount
,
resource
);
return
ResultModel
.
OK
();
}
//回访
@RequestMapping
(
value
=
"/visit/"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
visit
(
@CurrentAccount
User
loginAccount
,
@RequestBody
BackVisit
resource
)
{
tkioAccountService
.
visit
(
loginAccount
,
resource
);
return
ResultModel
.
OK
();
}
...
...
src/main/java/tkio/service/TkioAccountService.java
View file @
d474f3bd
package
tkio
.
service
;
import
common.model.Account4Web
;
import
common.model.User
;
import
common.model.*
;
import
java.util.List
;
...
...
@@ -12,9 +11,15 @@ public interface TkioAccountService {
List
<
Account4Web
>
findAll
(
User
user
);
//到期提醒关闭
Account4Web
forbiden
(
User
user
,
Long
accountId
);
Reminder
forbiden
(
User
user
,
Reminder
resource
);
//到期提醒开启
Account4Web
enable
(
User
user
,
Long
accountId
);
Reminder
enable
(
User
user
,
Reminder
resource
);
//缴费
Payment
pay
(
User
user
,
Payment
resource
);
//回访
BackVisit
visit
(
User
user
,
BackVisit
resource
);
}
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
View file @
d474f3bd
...
...
@@ -2,10 +2,7 @@ package tkio.service.impl;
import
com.amazonaws.services.dynamodbv2.xspec.B
;
import
common.model.*
;
import
common.repository.Account4WebRepository
;
import
common.repository.BackVisitRepository
;
import
common.repository.PaymentRepository
;
import
common.repository.UserRepository
;
import
common.repository.*
;
import
dic.RoleEnum
;
import
dic.RoleTypeEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -17,10 +14,7 @@ import tkio.repository.SalesManLeaderRepository;
import
tkio.service.TkioAccountService
;
import
util.ValidateUtil
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* Created by mxq on 2017/12/26.
...
...
@@ -43,6 +37,9 @@ public class TkioAccountServiceImpl implements TkioAccountService {
@Autowired
PaymentRepository
paymentRepository
;
@Autowired
ReminderRepository
reminderRepository
;
@Override
public
List
<
Account4Web
>
findAll
(
User
user
)
{
List
<
Account4Web
>
result
=
new
ArrayList
<>();
...
...
@@ -94,15 +91,39 @@ public class TkioAccountServiceImpl implements TkioAccountService {
}
@Override
public
Account4Web
forbiden
(
User
user
,
Long
accountId
)
{
return
null
;
public
Reminder
forbiden
(
User
user
,
Reminder
resource
)
{
resource
.
setUser
(
user
.
getId
());
resource
.
setModifyTime
(
new
Date
());
resource
.
setPlatform
(
"tkio"
);
resource
.
setRemindStatus
(
false
);
return
reminderRepository
.
save
(
resource
);
}
@Override
public
Reminder
enable
(
User
user
,
Reminder
resource
)
{
resource
.
setUser
(
user
.
getId
());
resource
.
setModifyTime
(
new
Date
());
resource
.
setPlatform
(
"tkio"
);
resource
.
setRemindStatus
(
true
);
return
reminderRepository
.
save
(
resource
);
}
@Override
public
Account4Web
enable
(
User
user
,
Long
accountId
)
{
return
null
;
public
Payment
pay
(
User
user
,
Payment
resource
)
{
resource
.
setUser
(
user
.
getId
());
resource
.
setPayDate
(
new
Date
());
return
paymentRepository
.
save
(
resource
);
}
@Override
public
BackVisit
visit
(
User
user
,
BackVisit
resource
)
{
resource
.
setUser
(
user
.
getId
());
resource
.
setVisitDate
(
new
Date
());
return
backVisitRepository
.
save
(
resource
);
}
public
Map
<
String
,
Integer
>
getBackTime
(){
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
List
<
BackVisit
>
all
=
backVisitRepository
.
findAll
();
...
...
src/main/webapp/WEB-INF/web.xml
View file @
d474f3bd
...
...
@@ -51,7 +51,7 @@
<url-pattern>
/api/*
</url-pattern>
</servlet-mapping>
<filter>
<!--
<filter>
<filter-name>cors</filter-name>
<filter-class>security.cors.CorsFilter</filter-class>
</filter>
...
...
@@ -59,7 +59,7 @@
<filter-mapping>
<filter-name>cors</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</filter-mapping>
-->
<welcome-file-list>
<welcome-file>
/home.html
</welcome-file>
...
...
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