Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
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
曲欣亮
shop
Commits
4cbe97dc
Commit
4cbe97dc
authored
Oct 17, 2018
by
zhangyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3c3834bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
0 deletions
+82
-0
PageController.java
src/main/java/com/egolm/shop/controller/PageController.java
+51
-0
PageService.java
src/main/java/com/egolm/shop/service/PageService.java
+8
-0
PageServiceImpl.java
...ain/java/com/egolm/shop/service/impl/PageServiceImpl.java
+23
-0
No files found.
src/main/java/com/egolm/shop/controller/PageController.java
0 → 100644
View file @
4cbe97dc
package
com
.
egolm
.
shop
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.shop.service.PageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"页面相关接口"
})
@RestController
@RequestMapping
(
"page"
)
public
class
PageController
{
@Autowired
private
PageService
pageService
;
@ApiOperation
(
"查询(只有一条)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
})
@RequestMapping
(
value
=
"/query"
,
method
=
RequestMethod
.
GET
)
public
String
query
(
HttpServletRequest
request
)
{
String
LangID
=
request
.
getParameter
(
"LangID"
);
if
(!
StringUtil
.
isNotEmpty
(
LangID
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
"参数不能为空"
).
toJson
();
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
List
<
Map
<
String
,
Object
>>
layoutList
=
pageService
.
query
(
params
);
if
(
layoutList
!=
null
&&
layoutList
.
size
()
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
"detail"
,
layoutList
.
get
(
0
)).
toString
();
}
else
{
return
Rjx
.
jsonOk
().
set
(
"detail"
,
new
HashMap
<
String
,
Object
>()).
toString
();
}
}
}
src/main/java/com/egolm/shop/service/PageService.java
0 → 100644
View file @
4cbe97dc
package
com
.
egolm
.
shop
.
service
;
import
java.util.List
;
import
java.util.Map
;
public
interface
PageService
{
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
);
}
src/main/java/com/egolm/shop/service/impl/PageServiceImpl.java
0 → 100644
View file @
4cbe97dc
package
com
.
egolm
.
shop
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.shop.service.PageService
;
@Service
public
class
PageServiceImpl
implements
PageService
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Override
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
)
{
String
sql
=
"SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+
" FROM tPlatformLayout "
+
"WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC "
;
return
jdbcTemplate
.
queryForList
(
sql
);
}
}
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