Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
c3671e40
Commit
c3671e40
authored
Aug 31, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
3285a53e
8fd35680
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
18 deletions
+39
-18
RandomListDto.java
...c/main/java/com/xxfc/platform/uccn/dto/RandomListDto.java
+10
-0
ArticleBiz.java
.../src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
+6
-6
RandomListBiz.java
...c/main/java/com/xxfc/platform/uccn/biz/RandomListBiz.java
+2
-2
ArticleController.java
...n/java/com/xxfc/platform/uccn/rest/ArticleController.java
+9
-5
RandomListController.java
...ava/com/xxfc/platform/uccn/rest/RandomListController.java
+1
-1
SmsService.java
.../java/com/xxfc/platform/universal/service/SmsService.java
+9
-4
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+2
-0
No files found.
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/dto/RandomListDto.java
View file @
c3671e40
...
...
@@ -20,4 +20,14 @@ public class RandomListDto {
*/
private
Integer
location
;
/**
* 新闻类型
*/
private
Integer
newsType
;
/**
* 新闻id
*/
private
Integer
newsId
;
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
View file @
c3671e40
...
...
@@ -24,7 +24,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
/**
* 随机文章条数
*/
private
final
Integer
RANDOM_NUMBER
=
3
;
private
final
Integer
RANDOM_NUMBER
=
2
;
/**
* 首页文章条数
...
...
@@ -77,18 +77,18 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @param id
* @return
*/
public
List
getThree
(
Integer
type
,
Integer
id
)
{
public
List
getThree
(
Integer
type
,
Integer
number
,
Integer
id
)
{
number
=
number
==
null
?
RANDOM_NUMBER
:
number
;
List
<
Article
>
articleList
=
mapper
.
getArticleList
(
type
,
null
,
id
);
if
(!
Objects
.
isNull
(
articleList
))
{
int
size
=
articleList
.
size
();
if
(
RANDOM_NUMBER
>=
size
)
{
if
(
number
>=
size
)
{
return
articleList
;
}
else
{
Random
random
=
new
Random
();
int
r
=
random
.
nextInt
(
size
-
RANDOM_NUMBER
+
1
);
int
r
=
random
.
nextInt
(
size
-
number
+
1
);
List
<
Article
>
result
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
RANDOM_NUMBER
.
intValue
();
i
++)
{
for
(
int
i
=
0
;
i
<
number
.
intValue
();
i
++)
{
int
index
=
i
+
r
;
result
.
add
(
articleList
.
get
(
index
));
}
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/RandomListBiz.java
View file @
c3671e40
...
...
@@ -37,7 +37,7 @@ public class RandomListBiz {
* @param number 随机数,默认是2
* @return
*/
public
ObjectRestResponse
getRandomList
(
Integer
type
,
Integer
number
,
Integer
location
)
{
public
ObjectRestResponse
getRandomList
(
Integer
type
,
Integer
number
,
Integer
location
,
Integer
id
,
Integer
newsType
)
{
if
(
type
!=
null
)
{
number
=
number
==
null
?
2
:
number
;
switch
(
TypeEnum
.
getByValue
(
type
))
{
...
...
@@ -50,7 +50,7 @@ public class RandomListBiz {
case
ACTIVITY:
return
ObjectRestResponse
.
succ
(
summitActivityBiz
.
getHostWithSummitActivity
(
number
,
location
));
case
NEWS:
return
ObjectRestResponse
.
succ
(
articleBiz
.
getThree
(
type
,
number
,
id
));
}
}
return
ObjectRestResponse
.
succ
();
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/ArticleController.java
View file @
c3671e40
...
...
@@ -37,15 +37,19 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
}
/**
*
*
随机获取三条数据
* @param type
* @param id 当前文章id
* @param number
* @param id
* @return
*/
@GetMapping
(
"/app/unauth/three
/{type}/{id}
"
)
@GetMapping
(
"/app/unauth/three"
)
@ApiOperation
(
value
=
"随机获取三条数据"
)
public
ObjectRestResponse
randomAccessToThreeData
(
@PathVariable
Integer
type
,
@PathVariable
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getThree
(
type
,
id
));
public
ObjectRestResponse
randomAccessToThreeData
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"number"
)
Integer
number
,
@RequestParam
(
"id"
)
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getThree
(
type
,
number
,
id
));
}
@GetMapping
(
"/app/unauth/homePage/{type}"
)
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/RandomListController.java
View file @
c3671e40
...
...
@@ -19,7 +19,7 @@ public class RandomListController {
if
(
randomListDto
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
return
randomListBiz
.
getRandomList
(
randomListDto
.
getType
(),
randomListDto
.
getNumber
(),
randomListDto
.
getLocation
());
return
randomListBiz
.
getRandomList
(
randomListDto
.
getType
(),
randomListDto
.
getNumber
(),
randomListDto
.
getLocation
()
,
randomListDto
.
getNewsId
(),
randomListDto
.
getNewsType
()
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/SmsService.java
View file @
c3671e40
...
...
@@ -195,21 +195,26 @@ public class SmsService {
try
{
JSONObject
jsonParams
=
new
JSONObject
();
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++){
jsonParams
.
put
(
param
+(
i
+
1
),
params
[
i
]);
String
para
=
params
[
i
];
if
(
para
.
contains
(
"【"
)){
para
=
para
.
replaceAll
(
"【"
,
""
);
}
if
(
para
.
contains
(
"】"
)){
para
=
para
.
replaceAll
(
"】"
,
""
);
}
jsonParams
.
put
(
param
+(
i
+
1
),
para
);
}
sendTemplate
(
PhoneNumbers
,
jsonParams
.
toJSONString
(),
templateCode
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
public
static
void
main
(
String
[]
args
)
throws
ClientException
,
InterruptedException
{
SmsService
smsService
=
new
SmsService
();
//发短信
String
[]
params
={
"1"
,
"2"
,
"3"
,
"2019-08-29"
,
"
松山湖
"
};
String
[]
params
={
"1"
,
"2"
,
"3"
,
"2019-08-29"
,
"
【松山湖】
"
};
SmsService
.
sendTemplateToJson
(
"13612688539,13265487972"
,
params
,
"SMS_169904346"
);
/*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
c3671e40
...
...
@@ -677,6 +677,8 @@
and v.is_del = 0
and v.status != 3
and v.use_type = 1
and bc.is_del = 0
and bc.is_show = 1
</where>
</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