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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
8 deletions
+41
-8
ResultController.java
...java/com/mobvista/apptag/controller/ResultController.java
+2
-3
ResultDao.java
src/main/java/com/mobvista/apptag/mapper/ResultDao.java
+18
-4
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 {
@PostMapping
(
"/list"
)
@ResponseBody
public
PageUtil
list
(
@SessionAttribute
(
WebSecurityConfig
.
SESSION_KEY
)
String
username
,
@RequestBody
Query
query
)
throws
IOException
{
public
PageUtil
list
(
@SessionAttribute
(
WebSecurityConfig
.
SESSION_KEY
)
String
username
,
@RequestBody
Query
query
)
{
PageHelper
.
startPage
(
query
.
getOffset
()
/
query
.
getLimit
()
+
1
,
query
.
getLimit
());
List
<
TagResult
>
results
=
resultService
.
list
(
username
);
int
total
=
result
Dao
.
count
(
username
);
int
total
=
result
Service
.
count
(
username
);
PageUtil
pageUtil
=
new
PageUtil
(
results
,
total
);
return
pageUtil
;
}
...
...
src/main/java/com/mobvista/apptag/mapper/ResultDao.java
View file @
7c8e7a55
...
...
@@ -19,25 +19,38 @@ public interface ResultDao {
boolean
save
(
TagResult
tagResult
);
@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
=
"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"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
TagResult
find
(
String
packageName
);
@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
=
"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"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
List
<
TagResult
>
list
(
String
userId
);
@Select
(
"SELECT * FROM tag_result"
)
@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 {
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 {
@Override
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
<>();
for
(
TagResult
result
:
results
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
.
getFeatId
());
...
...
@@ -72,4 +79,14 @@ public class ResultServiceImpl implements ResultService {
}
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