Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Administrator
browser-backend
Commits
4e3cdf4b
Commit
4e3cdf4b
authored
Jan 19, 2021
by
huangjiamin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-maintain-notice' into 'master'
Feature maintain notice See merge request
!241
parents
677dd280
20ff8a2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+11
-10
GlobalFieldController.java
...wserbackend/browser/controller/GlobalFieldController.java
+14
-0
No files found.
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
4e3cdf4b
...
@@ -13,6 +13,7 @@ import com.edgec.browserbackend.browser.repository.IpResourceRepository;
...
@@ -13,6 +13,7 @@ import com.edgec.browserbackend.browser.repository.IpResourceRepository;
import
com.edgec.browserbackend.browser.repository.ProxyConfigRepository
;
import
com.edgec.browserbackend.browser.repository.ProxyConfigRepository
;
import
com.edgec.browserbackend.browser.repository.ShopRepository
;
import
com.edgec.browserbackend.browser.repository.ShopRepository
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.utils.DateConverter
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.NotNull
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -773,6 +774,14 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -773,6 +774,14 @@ public class AdministratorServiceImpl implements AdministratorService {
@Override
@Override
public
void
setNotice
(
Notice
notice
)
{
public
void
setNotice
(
Notice
notice
)
{
if
(
notice
==
null
||
StringUtils
.
isEmpty
(
notice
.
getStarDate
())
||
StringUtils
.
isEmpty
(
notice
.
getEndDate
())
||
StringUtils
.
isEmpty
(
notice
.
getContent
())
||
DateConverter
.
stringToDate
(
notice
.
getStarDate
()).
compareTo
(
DateConverter
.
stringToDate
(
notice
.
getEndDate
()))
>
0
)
{
throw
new
ClientRequestException
(
AccountErrorCode
.
OTHERS
);
}
Notice
only
=
noticeRepository
.
findOneByNameIsNotNull
();
Notice
only
=
noticeRepository
.
findOneByNameIsNotNull
();
if
(
only
!=
null
)
{
if
(
only
!=
null
)
{
only
.
setStarDate
(
notice
.
getStarDate
());
only
.
setStarDate
(
notice
.
getStarDate
());
...
@@ -797,13 +806,4 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -797,13 +806,4 @@ public class AdministratorServiceImpl implements AdministratorService {
public
void
delNotice
()
{
public
void
delNotice
()
{
noticeRepository
.
deleteAll
();
noticeRepository
.
deleteAll
();
}
}
}
}
\ No newline at end of file
src/main/java/com/edgec/browserbackend/browser/controller/GlobalFieldController.java
View file @
4e3cdf4b
package
com
.
edgec
.
browserbackend
.
browser
.
controller
;
package
com
.
edgec
.
browserbackend
.
browser
.
controller
;
import
com.edgec.browserbackend.account.dto.NoticeDto
;
import
com.edgec.browserbackend.account.dto.ResultDto
;
import
com.edgec.browserbackend.account.dto.ResultDto
;
import
com.edgec.browserbackend.account.service.AdministratorService
;
import
com.edgec.browserbackend.browser.service.GlobalFieldService
;
import
com.edgec.browserbackend.browser.service.GlobalFieldService
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.utils.ResponseUtil
;
import
com.edgec.browserbackend.common.utils.ResponseUtil
;
...
@@ -9,6 +11,7 @@ import org.slf4j.LoggerFactory;
...
@@ -9,6 +11,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -24,6 +27,9 @@ public class GlobalFieldController {
...
@@ -24,6 +27,9 @@ public class GlobalFieldController {
@Autowired
@Autowired
private
GlobalFieldService
globalFieldService
;
private
GlobalFieldService
globalFieldService
;
@Autowired
private
AdministratorService
administratorService
;
@GetMapping
(
"/speciallinestate"
)
@GetMapping
(
"/speciallinestate"
)
public
ResultDto
querySpecialLineState
()
{
public
ResultDto
querySpecialLineState
()
{
String
logs
=
"【querySpecialLineState】 "
;
String
logs
=
"【querySpecialLineState】 "
;
...
@@ -37,4 +43,12 @@ public class GlobalFieldController {
...
@@ -37,4 +43,12 @@ public class GlobalFieldController {
return
ResponseUtil
.
error
(
e
.
getMessage
());
return
ResponseUtil
.
error
(
e
.
getMessage
());
}
}
}
}
/**
* 查询公告
*/
@RequestMapping
(
path
=
"/getNotice"
,
method
=
RequestMethod
.
GET
)
public
NoticeDto
getNotice
()
{
return
administratorService
.
getNotice
();
}
}
}
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