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
5e84c730
Commit
5e84c730
authored
Aug 05, 2019
by
jinfeng.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8a9bf83c
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
312 additions
and
101 deletions
+312
-101
ResultController.java
...java/com/mobvista/apptag/controller/ResultController.java
+2
-3
TagController.java
...in/java/com/mobvista/apptag/controller/TagController.java
+8
-15
UserController.java
...n/java/com/mobvista/apptag/controller/UserController.java
+8
-14
ResultDao.java
src/main/java/com/mobvista/apptag/mapper/ResultDao.java
+80
-8
TagDao.java
src/main/java/com/mobvista/apptag/mapper/TagDao.java
+49
-14
UserDao.java
src/main/java/com/mobvista/apptag/mapper/UserDao.java
+44
-12
ResultService.java
src/main/java/com/mobvista/apptag/service/ResultService.java
+2
-1
TagService.java
src/main/java/com/mobvista/apptag/service/TagService.java
+2
-3
UserService.java
src/main/java/com/mobvista/apptag/service/UserService.java
+6
-3
ResultServiceImpl.java
...a/com/mobvista/apptag/service/impl/ResultServiceImpl.java
+10
-10
TagServiceImpl.java
...java/com/mobvista/apptag/service/impl/TagServiceImpl.java
+3
-0
UserServiceImpl.java
...ava/com/mobvista/apptag/service/impl/UserServiceImpl.java
+2
-0
MD5Util.java
src/main/java/com/mobvista/apptag/utils/MD5Util.java
+6
-0
Query.java
src/main/java/com/mobvista/apptag/utils/Query.java
+16
-0
list.js
src/main/resources/static/js/appjs/result/list.js
+8
-0
list.js
src/main/resources/static/js/appjs/tag/list.js
+8
-0
list.js
src/main/resources/static/js/appjs/user/list.js
+16
-6
list.html
src/main/resources/templates/result/list.html
+14
-4
list.html
src/main/resources/templates/tag/list.html
+14
-4
list.html
src/main/resources/templates/user/list.html
+14
-4
No files found.
src/main/java/com/mobvista/apptag/controller/ResultController.java
View file @
5e84c730
...
...
@@ -2,7 +2,6 @@ package com.mobvista.apptag.controller;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.pagehelper.PageHelper
;
import
com.mobvista.apptag.config.WebSecurityConfig
;
import
com.mobvista.apptag.entity.Feat
;
import
com.mobvista.apptag.entity.Tag
;
...
...
@@ -25,7 +24,6 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -142,7 +140,8 @@ public class ResultController {
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
,
query
);
int
total
=
resultService
.
count
(
username
);
String
search
=
query
.
getSearch
();
int
total
=
resultService
.
count
(
username
,
search
);
PageUtil
pageUtil
=
new
PageUtil
(
results
,
total
);
return
pageUtil
;
}
...
...
src/main/java/com/mobvista/apptag/controller/TagController.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -18,22 +14,18 @@ import com.mobvista.apptag.service.TagService;
import
com.mobvista.apptag.utils.PageUtil
;
import
com.mobvista.apptag.utils.Query
;
import
com.mobvista.apptag.utils.R
;
import
net.sf.json.JSONArray
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.SessionAttribute
;
import
org.springframework.web.bind.annotation.*
;
import
net.sf.json.JSONArray
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author wangjf
...
...
@@ -147,8 +139,9 @@ public class TagController {
public
PageUtil
list
(
@RequestBody
Query
query
,
@RequestParam
(
name
=
"tag"
,
required
=
false
,
defaultValue
=
"0"
)
int
tag
)
{
PageHelper
.
startPage
(
query
.
getOffset
()
/
query
.
getLimit
()
+
1
,
query
.
getLimit
());
List
<
Tag
>
tags
=
tagDao
.
list
(
tag
);
int
total
=
tagDao
.
count
(
tag
);
String
search
=
query
.
getSearch
();
List
<
Tag
>
tags
=
tagDao
.
list
(
search
,
tag
);
int
total
=
tagDao
.
count
(
search
,
tag
);
PageUtil
pageUtil
=
new
PageUtil
(
tags
,
total
);
return
pageUtil
;
}
...
...
src/main/java/com/mobvista/apptag/controller/UserController.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
controller
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpSession
;
import
com.github.pagehelper.PageHelper
;
import
com.mobvista.apptag.config.WebSecurityConfig
;
import
com.mobvista.apptag.entity.User
;
...
...
@@ -13,18 +8,16 @@ import com.mobvista.apptag.service.UserService;
import
com.mobvista.apptag.utils.PageUtil
;
import
com.mobvista.apptag.utils.Query
;
import
com.mobvista.apptag.utils.R
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.SessionAttribute
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author wangjf
...
...
@@ -117,8 +110,9 @@ public class UserController {
@ResponseBody
public
PageUtil
list
(
@SessionAttribute
(
WebSecurityConfig
.
SESSION_KEY
)
String
username
,
@RequestBody
Query
query
)
{
PageHelper
.
startPage
(
query
.
getOffset
()
/
query
.
getLimit
()
+
1
,
query
.
getLimit
());
List
<
User
>
users
=
userDao
.
list
();
int
total
=
userDao
.
count
();
String
search
=
query
.
getSearch
();
List
<
User
>
users
=
userDao
.
list
(
search
.
toLowerCase
());
int
total
=
userDao
.
count
(
search
);
PageUtil
pageUtil
=
new
PageUtil
(
users
,
total
);
return
pageUtil
;
}
...
...
src/main/java/com/mobvista/apptag/mapper/ResultDao.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
mapper
;
import
java.util.List
;
import
com.mobvista.apptag.entity.TagResult
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.Result
;
import
org.apache.ibatis.annotations.Results
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* @author wangjf
...
...
@@ -28,6 +25,7 @@ public interface ResultDao {
@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"),
@Result(property = "appName", column = "app_name"),
...
...
@@ -37,7 +35,29 @@ public interface ResultDao {
@Result(property = "userId", column = "user_id"),
@Result(property = "updateTime", column = "update_time")})
List<TagResult> list(String userId);
*/
@SelectProvider
(
type
=
ListMapperProvider
.
class
,
method
=
"list"
)
@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
>
list
(
String
userId
,
String
search
);
class
ListMapperProvider
{
public
String
list
(
String
userId
,
String
search
)
{
String
sql
=
"SELECT * FROM tag_result WHERE user_id = #{userId}"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" AND LOWER(package_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
/*
@Select("SELECT * FROM tag_result")
@Results({@Result(property = "packageName", column = "package_name"),
@Result(property = "appName", column = "app_name"),
...
...
@@ -46,11 +66,62 @@ public interface ResultDao {
@Result(property = "comments", column = "comments"),
@Result(property = "userId", column = "user_id"),
@Result(property = "updateTime", column = "update_time")})
List
<
TagResult
>
listAll
();
List<TagResult> listAll(String search);
*/
@SelectProvider
(
type
=
ListAllMapperProvider
.
class
,
method
=
"listAll"
)
@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
(
String
search
);
class
ListAllMapperProvider
{
public
String
listAll
(
String
search
)
{
String
sql
=
"SELECT * FROM tag_result"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" WHERE LOWER(package_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
/*
@Select("SELECT COUNT(1) FROM tag_result WHERE user_id = #{userId}")
int count(String userId);
*/
@SelectProvider
(
type
=
CountMapperProvider
.
class
,
method
=
"count"
)
int
count
(
String
userId
,
String
search
);
class
CountMapperProvider
{
public
String
count
(
String
userId
,
String
search
)
{
String
sql
=
"SELECT COUNT(1) FROM tag_result WHERE user_id = #{userId}"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" AND LOWER(package_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
/*
@Select("SELECT COUNT(1) FROM tag_result")
int
countAll
();
int countAll(String search);
*/
@SelectProvider
(
type
=
CountAllMapperProvider
.
class
,
method
=
"countAll"
)
int
countAll
(
String
search
);
class
CountAllMapperProvider
{
public
String
countAll
(
String
search
)
{
String
sql
=
"SELECT COUNT(1) FROM tag_result"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" WHERE LOWER(package_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/mapper/TagDao.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
mapper
;
import
java.util.List
;
import
com.mobvista.apptag.entity.Tag
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.Result
;
import
org.apache.ibatis.annotations.Results
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Update
;
import
java.util.List
;
/**
* @author wangjf
...
...
@@ -17,46 +14,83 @@ public interface TagDao {
@Update
(
"UPDATE tag_list SET user_id = #{userId}, tag = #{tag},update_time = #{updateTime} WHERE package_name = #{packageName}"
)
boolean
update
(
Tag
tag
);
/*
@Select("SELECT * FROM tag_list WHERE tag = #{tag} ORDER BY install DESC")
@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 = "category", column = "category"), @Result(property = "url", column = "url"),
@Result(property = "install", column = "install"), @Result(property = "tag", column = "tag"),
@Result(property = "userId", column = "user_id"),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
@Result(property = "updateTime", column = "update_time")
})
List<Tag> list(int tag);
*/
@SelectProvider
(
type
=
ListMapperProvider
.
class
,
method
=
"list"
)
@Results
({
@Result
(
property
=
"packageName"
,
column
=
"package_name"
),
@Result
(
property
=
"appName"
,
column
=
"app_name"
),
@Result
(
property
=
"platform"
,
column
=
"platform"
),
@Result
(
property
=
"category"
,
column
=
"category"
),
@Result
(
property
=
"url"
,
column
=
"url"
),
@Result
(
property
=
"install"
,
column
=
"install"
),
@Result
(
property
=
"tag"
,
column
=
"tag"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)})
List
<
Tag
>
list
(
String
search
,
int
tag
);
class
ListMapperProvider
{
public
String
list
(
String
search
,
int
tag
)
{
String
sql
=
"SELECT * FROM tag_list WHERE tag = #{tag}"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" AND LOWER(package_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
+
" ORDER BY install DESC"
;
}
}
@Select
(
"SELECT * FROM tag_list WHERE tag = #{tag} ORDER BY install DESC"
)
@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
=
"category"
,
column
=
"category"
),
@Result
(
property
=
"url"
,
column
=
"url"
),
@Result
(
property
=
"install"
,
column
=
"install"
),
@Result
(
property
=
"tag"
,
column
=
"tag"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
List
<
Tag
>
listAll
(
int
tag
);
@Select
(
"SELECT * FROM tag_list ORDER BY install DESC LIMIT 1"
)
@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
=
"category"
,
column
=
"category"
),
@Result
(
property
=
"url"
,
column
=
"url"
),
@Result
(
property
=
"install"
,
column
=
"install"
),
@Result
(
property
=
"tag"
,
column
=
"tag"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
Tag
one
();
@Select
(
"SELECT * FROM tag_list 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
=
"category"
,
column
=
"category"
),
@Result
(
property
=
"url"
,
column
=
"url"
),
@Result
(
property
=
"install"
,
column
=
"install"
),
@Result
(
property
=
"tag"
,
column
=
"tag"
),
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
)
})
Tag
find
(
String
package_name
);
/*
@Select("SELECT COUNT(1) FROM tag_list WHERE tag = #{tag}")
int count(int tag);
*/
@SelectProvider
(
type
=
CountMapperProvider
.
class
,
method
=
"count"
)
int
count
(
String
search
,
int
tag
);
class
CountMapperProvider
{
public
String
count
(
String
search
,
int
tag
)
{
String
sql
=
"SELECT COUNT(1) FROM tag_list WHERE tag = #{tag}"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" AND LOWER(package_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/mapper/UserDao.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
mapper
;
import
java.util.List
;
import
com.mobvista.apptag.entity.User
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.Result
;
import
org.apache.ibatis.annotations.Results
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Update
;
import
java.util.List
;
/**
* @author wangjf
...
...
@@ -23,21 +19,56 @@ public interface UserDao {
void
update
(
User
user
);
@Select
(
"SELECT * FROM user WHERE user_id = #{userId}"
)
@Results
({
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Results
({
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"userName"
,
column
=
"user_name"
),
@Result
(
property
=
"count"
,
column
=
"count"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
),
@Result
(
property
=
"role"
,
column
=
"role"
)
})
@Result
(
property
=
"role"
,
column
=
"role"
)
})
User
find
(
String
userId
);
/*
@Select("SELECT * FROM user")
@Results
({
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Results({@Result(property = "userId", column = "user_id"),
@Result(property = "userName", column = "user_name"),
@Result(property = "count", column = "count"),
@Result(property = "updateTime", column = "update_time"),
@Result(property = "role", column = "role")})
List<User> list(String search);
*/
@SelectProvider
(
type
=
ListMapperProvider
.
class
,
method
=
"list"
)
@Results
({
@Result
(
property
=
"userId"
,
column
=
"user_id"
),
@Result
(
property
=
"userName"
,
column
=
"user_name"
),
@Result
(
property
=
"count"
,
column
=
"count"
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
),
@Result
(
property
=
"role"
,
column
=
"role"
)
})
List
<
User
>
list
();
@Result
(
property
=
"role"
,
column
=
"role"
)})
List
<
User
>
list
(
String
search
);
class
ListMapperProvider
{
public
String
list
(
String
search
)
{
String
sql
=
"SELECT * FROM user"
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" WHERE LOWER(user_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
/*
@Select("SELECT COUNT(1) FROM user")
int count();
*/
@SelectProvider
(
type
=
CountMapperProvider
.
class
,
method
=
"count"
)
int
count
(
String
search
);
class
CountMapperProvider
{
public
String
count
(
String
search
)
{
String
sql
=
"SELECT count(1) FROM user "
;
if
(
StringUtils
.
isNotBlank
(
search
))
{
sql
+=
" WHERE LOWER(user_name) LIKE '%"
+
search
+
"%'"
;
}
return
sql
;
}
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/ResultService.java
View file @
5e84c730
...
...
@@ -18,5 +18,5 @@ public interface ResultService {
List
<
TagResult
>
list
(
String
userId
,
Query
query
);
int
count
(
String
userId
);
int
count
(
String
userId
,
String
search
);
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/TagService.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
service
;
import
java.util.List
;
import
com.mobvista.apptag.entity.Tag
;
/**
...
...
@@ -13,5 +11,5 @@ public interface TagService {
Tag
find
(
String
packageName
);
List
<
Tag
>
list
(
int
pageNum
,
int
pageSize
);
//
List<Tag> list(int pageNum, int pageSize);
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/UserService.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
service
;
import
java.util.Map
;
import
com.mobvista.apptag.entity.User
;
import
java.util.Map
;
/**
* @author wangjf
*/
public
interface
UserService
{
boolean
createUser
(
Map
<
String
,
Object
>
uMap
,
String
userId
);
boolean
createUser
(
Map
<
String
,
Object
>
uMap
,
String
userId
);
void
updateUser
(
User
user
);
Map
<
String
,
Object
>
find
(
String
userId
);
/*
Map<String, Object> list();
*/
Boolean
validate
(
String
userId
,
String
password
);
...
...
src/main/java/com/mobvista/apptag/service/impl/ResultServiceImpl.java
View file @
5e84c730
package
com
.
mobvista
.
apptag
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.mobvista.apptag.entity.Tag
;
...
...
@@ -13,11 +9,14 @@ import com.mobvista.apptag.mapper.ResultDao;
import
com.mobvista.apptag.mapper.TagDao
;
import
com.mobvista.apptag.mapper.UserDao
;
import
com.mobvista.apptag.service.ResultService
;
import
com.mobvista.apptag.utils.Query
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author wangjf
*/
...
...
@@ -69,9 +68,9 @@ public class ResultServiceImpl implements ResultService {
List
<
TagResult
>
results
;
PageHelper
.
startPage
(
query
.
getOffset
()
/
query
.
getLimit
()
+
1
,
query
.
getLimit
());
if
(
user
.
getRole
()
==
0
)
{
results
=
resultDao
.
list
(
userId
);
results
=
resultDao
.
list
(
userId
,
query
.
getSearch
().
toLowerCase
()
);
}
else
{
results
=
resultDao
.
listAll
();
results
=
resultDao
.
listAll
(
query
.
getSearch
().
toLowerCase
()
);
}
List
<
TagResult
>
results2
=
new
ArrayList
<>();
...
...
@@ -84,12 +83,12 @@ public class ResultServiceImpl implements ResultService {
}
@Override
public
int
count
(
String
userId
)
{
public
int
count
(
String
userId
,
String
search
)
{
User
user
=
userDao
.
find
(
userId
);
if
(
user
.
getRole
()
==
0
)
{
return
resultDao
.
count
(
userId
);
return
resultDao
.
count
(
userId
,
search
);
}
else
{
return
resultDao
.
countAll
();
return
resultDao
.
countAll
(
search
);
}
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/impl/TagServiceImpl.java
View file @
5e84c730
...
...
@@ -41,9 +41,11 @@ public class TagServiceImpl implements TagService {
return
tagDao
.
find
(
packageName
);
}
/*
@Override
public List<Tag> list(int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
return tagDao.list(1);
}
*/
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/service/impl/UserServiceImpl.java
View file @
5e84c730
...
...
@@ -54,6 +54,7 @@ public class UserServiceImpl implements UserService {
return
attributes
;
}
/*
@Override
public Map<String, Object> list() {
Map<String, Object> attributes = new HashMap<>();
...
...
@@ -62,6 +63,7 @@ public class UserServiceImpl implements UserService {
attributes.put("userDto", new User());
return attributes;
}
*/
@Override
public
Boolean
validate
(
String
user_id
,
String
password
)
{
...
...
src/main/java/com/mobvista/apptag/utils/MD5Util.java
View file @
5e84c730
...
...
@@ -22,4 +22,9 @@ public class MD5Util {
throw
new
Exception
(
"MD5加密出现错误,"
+
e
.
toString
());
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
str
=
getMD5Str
(
"123456"
);
System
.
out
.
println
(
str
);
}
}
\ No newline at end of file
src/main/java/com/mobvista/apptag/utils/Query.java
View file @
5e84c730
...
...
@@ -16,6 +16,8 @@ public class Query implements Serializable {
private
String
order
;
private
String
search
;
/**
* @return the limit
*/
...
...
@@ -58,4 +60,17 @@ public class Query implements Serializable {
this
.
offset
=
offset
;
}
/**
* @return the search
*/
public
String
getSearch
()
{
return
search
;
}
/**
* @param search the search to set
*/
public
void
setSearch
(
String
search
)
{
this
.
search
=
search
;
}
}
\ No newline at end of file
src/main/resources/static/js/appjs/result/list.js
View file @
5e84c730
...
...
@@ -23,6 +23,14 @@ function load() {
showColumns
:
true
,
// 是否显示内容下拉框(选择显示的列)
sidePagination
:
"server"
,
// 设置在哪里进行分页,可选值为"client" 或者 "server"
// queryParams : queryParams,
queryParams
:
function
(
params
)
{
return
{
// 说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
limit
:
params
.
limit
,
offset
:
params
.
offset
,
search
:
$
(
'#searchName'
).
val
()
};
},
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
// queryParamsType = 'limit' ,返回参数必须包含
// limit, offset, search, sort, order 否则, 需要包含:
...
...
src/main/resources/static/js/appjs/tag/list.js
View file @
5e84c730
...
...
@@ -23,6 +23,14 @@ function load() {
showColumns
:
true
,
// 是否显示内容下拉框(选择显示的列)
sidePagination
:
"server"
,
// 设置在哪里进行分页,可选值为"client" 或者 "server"
// queryParams : queryParams,
queryParams
:
function
(
params
)
{
return
{
// 说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
limit
:
params
.
limit
,
offset
:
params
.
offset
,
search
:
$
(
'#searchName'
).
val
()
};
},
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
// queryParamsType = 'limit' ,返回参数必须包含
// limit, offset, search, sort, order 否则, 需要包含:
...
...
src/main/resources/static/js/appjs/user/list.js
View file @
5e84c730
...
...
@@ -23,6 +23,15 @@ function load() {
showColumns
:
true
,
// 是否显示内容下拉框(选择显示的列)
sidePagination
:
"server"
,
// 设置在哪里进行分页,可选值为"client" 或者 "server"
// queryParams : queryParams,
queryParams
:
function
(
params
)
{
return
{
// 说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
limit
:
params
.
limit
,
offset
:
params
.
offset
,
search
:
$
(
'#searchName'
).
val
()
};
},
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
// queryParamsType = 'limit' ,返回参数必须包含
// limit, offset, search, sort, order 否则, 需要包含:
...
...
@@ -115,11 +124,11 @@ function edit(userId) {
function
add
()
{
// iframe层
layer
.
open
({
type
:
2
,
title
:
'增加用户'
,
maxmin
:
true
,
shadeClose
:
false
,
// 点击遮罩关闭层
area
:
[
'800px'
,
'450px'
],
content
:
prefix
+
'/add'
type
:
2
,
title
:
'增加用户'
,
maxmin
:
true
,
shadeClose
:
false
,
// 点击遮罩关闭层
area
:
[
'800px'
,
'450px'
],
content
:
prefix
+
'/add'
});
}
\ No newline at end of file
src/main/resources/templates/result/list.html
View file @
5e84c730
...
...
@@ -4,10 +4,19 @@
<meta
charset=
"utf-8"
>
<head
th:include=
"include :: header"
></head>
<body
class=
"gray-bg"
>
<div
class=
"wrapper wrapper-content "
>
<div
class=
"wrapper wrapper-content "
>
<div
class=
"col-sm-12"
>
<div
class=
"ibox"
>
<div
class=
"ibox-body"
>
<div
class=
"fixed-table-toolbar"
>
<div
class=
"columns pull-right"
>
<button
class=
"btn btn-success"
onclick=
"reLoad(1)"
>
查询
</button>
</div>
<div
class=
"columns pull-right col-md-2 nopadding"
>
<input
id=
"searchName"
type=
"text"
class=
"form-control"
placeholder=
"packageName"
>
</div>
</div>
<table
id=
"exampleTable"
data-mobile-responsive=
"true"
>
</table>
</div>
...
...
@@ -23,8 +32,8 @@
s_edit_h
=
''
;
</script>
</div>
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
src=
"/js/appjs/result/list.js"
></script>
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
src=
"/js/appjs/result/list.js"
></script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/tag/list.html
View file @
5e84c730
...
...
@@ -4,10 +4,19 @@
<meta
charset=
"utf-8"
>
<head
th:include=
"include :: header"
></head>
<body
class=
"gray-bg"
>
<div
class=
"wrapper wrapper-content "
>
<div
class=
"wrapper wrapper-content "
>
<div
class=
"col-sm-12"
>
<div
class=
"ibox"
>
<div
class=
"ibox-body"
>
<div
class=
"fixed-table-toolbar"
>
<div
class=
"columns pull-right"
>
<button
class=
"btn btn-success"
onclick=
"reLoad(1)"
>
查询
</button>
</div>
<div
class=
"columns pull-right col-md-2 nopadding"
>
<input
id=
"searchName"
type=
"text"
class=
"form-control"
placeholder=
"packageName"
>
</div>
</div>
<table
id=
"exampleTable"
data-mobile-responsive=
"true"
>
</table>
</div>
...
...
@@ -23,8 +32,8 @@
s_edit_h
=
''
;
</script>
</div>
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
src=
"/js/appjs/tag/list.js"
></script>
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
src=
"/js/appjs/tag/list.js"
></script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/user/list.html
View file @
5e84c730
...
...
@@ -4,16 +4,25 @@
<meta
charset=
"utf-8"
>
<head
th:include=
"include :: header"
></head>
<body
class=
"gray-bg"
>
<div
class=
"wrapper wrapper-content "
>
<div
class=
"wrapper wrapper-content "
>
<div
class=
"col-sm-12"
>
<div
class=
"ibox"
>
<div
class=
"ibox-body"
>
<div
class=
"fixed-table-toolbar"
>
<div
id=
"exampleToolbar"
role=
"group"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"add()"
>
<i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
增加用户
</button>
</div>
<div
class=
"columns pull-right"
>
<button
class=
"btn btn-success"
onclick=
"reLoad(1)"
>
查询
</button>
</div>
<div
class=
"columns pull-right col-md-2 nopadding"
>
<input
id=
"searchName"
type=
"text"
class=
"form-control"
placeholder=
"姓名"
>
</div>
</div>
<table
id=
"exampleTable"
data-mobile-responsive=
"true"
>
</table>
</div>
...
...
@@ -29,8 +38,8 @@
s_edit_h
=
''
;
</script>
</div>
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
src=
"/js/appjs/user/list.js"
></script>
</div>
<div
th:include=
"include :: footer"
></div>
<script
type=
"text/javascript"
src=
"/js/appjs/user/list.js"
></script>
</body>
</html>
\ 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