Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppTag
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
dataplatform
AppTag
Commits
7c8e7a55
Commit
7c8e7a55
authored
Dec 04, 2018
by
wangjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
97c1aeb9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
29 deletions
+62
-29
ResultController.java
...java/com/mobvista/apptag/controller/ResultController.java
+2
-3
ResultDao.java
src/main/java/com/mobvista/apptag/mapper/ResultDao.java
+39
-25
ResultService.java
src/main/java/com/mobvista/apptag/service/ResultService.java
+2
-0
ResultServiceImpl.java
...a/com/mobvista/apptag/service/impl/ResultServiceImpl.java
+19
-1
No files found.
src/main/java/com/mobvista/apptag/controller/ResultController.java
View file @
7c8e7a55
...
@@ -139,11 +139,10 @@ public class ResultController {
...
@@ -139,11 +139,10 @@ public class ResultController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
@ResponseBody
@ResponseBody
public
PageUtil
list
(
@SessionAttribute
(
WebSecurityConfig
.
SESSION_KEY
)
String
username
,
@RequestBody
Query
query
)
public
PageUtil
list
(
@SessionAttribute
(
WebSecurityConfig
.
SESSION_KEY
)
String
username
,
@RequestBody
Query
query
)
{
throws
IOException
{
PageHelper
.
startPage
(
query
.
getOffset
()
/
query
.
getLimit
()
+
1
,
query
.
getLimit
());
PageHelper
.
startPage
(
query
.
getOffset
()
/
query
.
getLimit
()
+
1
,
query
.
getLimit
());
List
<
TagResult
>
results
=
resultService
.
list
(
username
);
List
<
TagResult
>
results
=
resultService
.
list
(
username
);
int
total
=
result
Dao
.
count
(
username
);
int
total
=
result
Service
.
count
(
username
);
PageUtil
pageUtil
=
new
PageUtil
(
results
,
total
);
PageUtil
pageUtil
=
new
PageUtil
(
results
,
total
);
return
pageUtil
;
return
pageUtil
;
}
}
...
...
src/main/java/com/mobvista/apptag/mapper/ResultDao.java
View file @
7c8e7a55
...
@@ -15,29 +15,42 @@ import org.apache.ibatis.annotations.Select;
...
@@ -15,29 +15,42 @@ import org.apache.ibatis.annotations.Select;
public
interface
ResultDao
{
public
interface
ResultDao
{
@Insert
(
"REPLACE INTO tag_result(package_name,app_name,platform,feat_id,comment,user_id,update_time) VALUES(#{packageName}, #{appName}, #{platform}, #{featId}, #{comment}, #{userId}, #{updateTime})"
)
@Insert
(
"REPLACE INTO tag_result(package_name,app_name,platform,feat_id,comment,user_id,update_time) VALUES(#{packageName}, #{appName}, #{platform}, #{featId}, #{comment}, #{userId}, #{updateTime})"
)
boolean
save
(
TagResult
tagResult
);
boolean
save
(
TagResult
tagResult
);
@Select
(
"SELECT * FROM tag_result WHERE package_name = #{packageName}"
)
@Select
(
"SELECT * FROM tag_result WHERE package_name = #{packageName}"
)
@Results
({
@Result
(
property
=
"packageName"
,
column
=
"package_name"
),
@Results
({
@Result
(
property
=
"packageName"
,
column
=
"package_name"
),
@Result
(
property
=
"appName"
,
column
=
"app_name"
),
@Result
(
property
=
"appName"
,
column
=
"app_name"
),
@Result
(
property
=
"platform"
,
column
=
"platform"
),
@Result
(
property
=
"platform"
,
column
=
"platform"
),
@Result
(
property
=
"featId"
,
column
=
"feat_id"
),
@Result
(
property
=
"featId"
,
column
=
"feat_id"
),
@Result
(
property
=
"comments"
,
column
=
"comments"
),
@Result
(
property
=
"comments"
,
column
=
"comments"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)})
TagResult
find
(
String
packageName
);
TagResult
find
(
String
packageName
);
@Select
(
"SELECT * FROM tag_result WHERE user_id = #{userId}"
)
@Select
(
"SELECT * FROM tag_result WHERE user_id = #{userId}"
)
@Results
({
@Result
(
property
=
"packageName"
,
column
=
"package_name"
),
@Results
({
@Result
(
property
=
"packageName"
,
column
=
"package_name"
),
@Result
(
property
=
"appName"
,
column
=
"app_name"
),
@Result
(
property
=
"appName"
,
column
=
"app_name"
),
@Result
(
property
=
"platform"
,
column
=
"platform"
),
@Result
(
property
=
"platform"
,
column
=
"platform"
),
@Result
(
property
=
"featId"
,
column
=
"feat_id"
),
@Result
(
property
=
"featId"
,
column
=
"feat_id"
),
@Result
(
property
=
"comments"
,
column
=
"comments"
),
@Result
(
property
=
"comments"
,
column
=
"comments"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)})
List
<
TagResult
>
list
(
String
userId
);
List
<
TagResult
>
list
(
String
userId
);
@Select
(
"SELECT COUNT(1) FROM tag_result WHERE user_id = #{userId}"
)
@Select
(
"SELECT * FROM tag_result"
)
int
count
(
String
userId
);
@Results
({
@Result
(
property
=
"packageName"
,
column
=
"package_name"
),
@Result
(
property
=
"appName"
,
column
=
"app_name"
),
@Result
(
property
=
"platform"
,
column
=
"platform"
),
@Result
(
property
=
"featId"
,
column
=
"feat_id"
),
@Result
(
property
=
"comments"
,
column
=
"comments"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)})
List
<
TagResult
>
listAll
();
@Select
(
"SELECT COUNT(1) FROM tag_result WHERE user_id = #{userId}"
)
int
count
(
String
userId
);
@Select
(
"SELECT COUNT(1) FROM tag_result"
)
int
countAll
();
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/ResultService.java
View file @
7c8e7a55
...
@@ -17,4 +17,5 @@ public interface ResultService {
...
@@ -17,4 +17,5 @@ public interface ResultService {
List
<
TagResult
>
list
(
String
userId
);
List
<
TagResult
>
list
(
String
userId
);
int
count
(
String
userId
);
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/impl/ResultServiceImpl.java
View file @
7c8e7a55
...
@@ -63,7 +63,14 @@ public class ResultServiceImpl implements ResultService {
...
@@ -63,7 +63,14 @@ public class ResultServiceImpl implements ResultService {
@Override
@Override
public
List
<
TagResult
>
list
(
String
userId
)
{
public
List
<
TagResult
>
list
(
String
userId
)
{
List
<
TagResult
>
results
=
resultDao
.
list
(
userId
);
User
user
=
userDao
.
find
(
userId
);
List
<
TagResult
>
results
;
if
(
user
.
getRole
()
==
0
)
{
results
=
resultDao
.
list
(
userId
);
}
else
{
results
=
resultDao
.
listAll
();
}
List
<
TagResult
>
results2
=
new
ArrayList
<>();
List
<
TagResult
>
results2
=
new
ArrayList
<>();
for
(
TagResult
result
:
results
)
{
for
(
TagResult
result
:
results
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
.
getFeatId
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
.
getFeatId
());
...
@@ -72,4 +79,14 @@ public class ResultServiceImpl implements ResultService {
...
@@ -72,4 +79,14 @@ public class ResultServiceImpl implements ResultService {
}
}
return
results2
;
return
results2
;
}
}
@Override
public
int
count
(
String
userId
)
{
User
user
=
userDao
.
find
(
userId
);
if
(
user
.
getRole
()
==
0
)
{
return
resultDao
.
count
(
userId
);
}
else
{
return
resultDao
.
countAll
();
}
}
}
}
\ No newline at end of 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