Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-system
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
luoyangfei
store-system
Commits
08459128
Commit
08459128
authored
Nov 08, 2018
by
扫地僧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改返回值
parent
d1f2f2c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
300 additions
and
236 deletions
+300
-236
IndexController.java
...main/java/cn/com/fqy/controller/mapi/IndexController.java
+134
-96
ShopController.java
.../main/java/cn/com/fqy/controller/mapi/ShopController.java
+83
-71
WorkerController.java
...ain/java/cn/com/fqy/controller/mapi/WorkerController.java
+83
-69
No files found.
2code/server/store-system/src/main/java/cn/com/fqy/controller/mapi/IndexController.java
View file @
08459128
package
cn
.
com
.
fqy
.
controller
.
mapi
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Advert
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.model.Worker
;
import
cn.com.fqy.core.service.AdvertService
;
import
cn.com.fqy.core.service.StoreService
;
import
cn.com.fqy.core.service.WorkerService
;
/**
* H5首页数据服务类
* @author Administrator
*
*/
@Controller
@RequestMapping
(
"/h5/index"
)
public
class
IndexController
{
@Resource
private
AdvertService
advertService
;
@Resource
private
StoreService
storeService
;
@Resource
WorkerService
workerService
;
@RequestMapping
(
"fqy"
)
@ResponseBody
public
String
fqy
(){
return
"fqy"
;
}
/**
* 分页展示广告
*/
@RequestMapping
(
"getAdvertList"
)
@ResponseBody
public
PageFinder
<
Advert
>
getAdvertList
(
@ModelAttribute
(
"advert"
)
Advert
advert
,
Query
query
)
{
Query
q
=
new
Query
(
query
.
getPageNo
(),
query
.
getPageSize
(),
advert
);
return
advertService
.
getAdvertPagedList
(
q
);
}
/**
* 推荐商家
*/
@RequestMapping
(
"getStoreList"
)
@ResponseBody
public
PageFinder
<
Store
>
getStoreList
()
{
Store
store
=
new
Store
();
store
.
setIsDeleted
(
0
);
//未删除
store
.
setIsAvailable
(
1
);
//店铺启用状态
store
.
setIsShopping
(
1
);
//店铺展示状态
store
.
setIsRecommend
(
1
);
//店铺推荐状态
Query
q
=
new
Query
(
store
);
return
storeService
.
getStorePagedList
(
q
);
}
/**
* 推荐员工
*/
@RequestMapping
(
"getWorkerList"
)
@ResponseBody
public
PageFinder
<
Worker
>
getWorkerList
()
{
Worker
worker
=
new
Worker
();
worker
.
setIsDeleted
(
0
);
//未删除
worker
.
setIsAuditing
(
1
);
//已审核
worker
.
setIsShopping
(
1
);
//已展示
worker
.
setIsRecommend
(
1
);
//已推荐
Query
q
=
new
Query
(
worker
);
return
workerService
.
getWorkerPagedList
(
q
);
}
/**
* 搜索查询 - 待需求明确
*/
@RequestMapping
(
"searchShop"
)
@ResponseBody
public
PageFinder
<
Store
>
searchShopResult
(
String
addkey
){
Store
store
=
new
Store
();
store
.
setIsDeleted
(
0
);
//未删除
store
.
setIsAvailable
(
1
);
//店铺启用状态
store
.
setIsShopping
(
1
);
//店铺展示状态
Query
q
=
new
Query
(
store
);
return
storeService
.
getStorePagedList
(
q
);
}
}
package
cn
.
com
.
fqy
.
controller
.
mapi
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.ResultInfo
;
import
cn.com.fqy.common.constants.Constant
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Advert
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.model.Worker
;
import
cn.com.fqy.core.service.AdvertService
;
import
cn.com.fqy.core.service.StoreService
;
import
cn.com.fqy.core.service.WorkerService
;
/**
* H5首页数据服务类
* @author Administrator
*
*/
@Controller
@RequestMapping
(
"/h5/index"
)
public
class
IndexController
{
@Resource
private
AdvertService
advertService
;
@Resource
private
StoreService
storeService
;
@Resource
WorkerService
workerService
;
@RequestMapping
(
"fqy"
)
@ResponseBody
public
String
fqy
(){
return
"fqy"
;
}
/**
* 分页展示广告
*/
@RequestMapping
(
"getAdvertList"
)
@ResponseBody
public
ResultInfo
<
List
<
Advert
>>
getAdvertList
()
{
ResultInfo
<
List
<
Advert
>>
resultInfo
=
new
ResultInfo
<
List
<
Advert
>>();
Advert
advert
=
new
Advert
();
advert
.
setIsAvailable
(
1
);
//可用
Query
q
=
new
Query
(
advert
);
PageFinder
<
Advert
>
pageResult
=
advertService
.
getAdvertPagedList
(
q
);
if
(
null
!=
pageResult
&&
pageResult
.
getData
().
size
()>
0
)
{
List
<
Advert
>
result
=
pageResult
.
getData
();
resultInfo
.
setData
(
result
);
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
resultInfo
.
setMsg
(
"请求成功"
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setMsg
(
"暂无数据"
);
}
return
resultInfo
;
}
/**
* 推荐商家
*/
@RequestMapping
(
"getStoreList"
)
@ResponseBody
public
ResultInfo
<
List
<
Store
>>
getStoreList
()
{
ResultInfo
<
List
<
Store
>>
resultInfo
=
new
ResultInfo
<
List
<
Store
>>();
Store
store
=
new
Store
();
store
.
setIsDeleted
(
0
);
//未删除
store
.
setIsAvailable
(
1
);
//店铺启用状态
store
.
setIsShopping
(
1
);
//店铺展示状态
store
.
setIsRecommend
(
1
);
//店铺推荐状态
Query
q
=
new
Query
(
store
);
PageFinder
<
Store
>
pageResult
=
storeService
.
getStorePagedList
(
q
);
if
(
null
!=
pageResult
&&
pageResult
.
getData
().
size
()
>
0
)
{
List
<
Store
>
result
=
pageResult
.
getData
();
resultInfo
.
setData
(
result
);
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
resultInfo
.
setMsg
(
"请求成功"
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setMsg
(
"暂无数据"
);
}
return
resultInfo
;
}
/**
* 推荐员工
*/
@RequestMapping
(
"getWorkerList"
)
@ResponseBody
public
ResultInfo
<
List
<
Worker
>>
getWorkerList
()
{
ResultInfo
<
List
<
Worker
>>
resultInfo
=
new
ResultInfo
<
List
<
Worker
>>();
Worker
worker
=
new
Worker
();
worker
.
setIsDeleted
(
0
);
//未删除
worker
.
setIsAuditing
(
1
);
//已审核
worker
.
setIsShopping
(
1
);
//已展示
worker
.
setIsRecommend
(
1
);
//已推荐
Query
q
=
new
Query
(
worker
);
PageFinder
<
Worker
>
pageResult
=
workerService
.
getWorkerPagedList
(
q
);
if
(
null
!=
pageResult
&&
pageResult
.
getData
().
size
()
>
0
)
{
List
<
Worker
>
result
=
pageResult
.
getData
();
resultInfo
.
setData
(
result
);
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
resultInfo
.
setMsg
(
"请求成功"
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setMsg
(
"暂无数据"
);
}
return
resultInfo
;
}
/**
* 搜索查询 - 待需求明确
*/
@RequestMapping
(
"searchShop"
)
@ResponseBody
public
PageFinder
<
Store
>
searchShopResult
(
String
addkey
){
Store
store
=
new
Store
();
store
.
setIsDeleted
(
0
);
//未删除
store
.
setIsAvailable
(
1
);
//店铺启用状态
store
.
setIsShopping
(
1
);
//店铺展示状态
Query
q
=
new
Query
(
store
);
return
storeService
.
getStorePagedList
(
q
);
}
}
2code/server/store-system/src/main/java/cn/com/fqy/controller/mapi/ShopController.java
View file @
08459128
package
cn
.
com
.
fqy
.
controller
.
mapi
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.ResultInfo
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Advert
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.model.Worker
;
import
cn.com.fqy.core.service.AdvertService
;
import
cn.com.fqy.core.service.StoreService
;
import
cn.com.fqy.core.service.WorkerService
;
/**
* H5商家数据服务类
* @author Administrator
*
*/
@Controller
@RequestMapping
(
"/h5/shop"
)
public
class
ShopController
{
@Resource
private
AdvertService
advertService
;
@Resource
private
StoreService
storeService
;
@Resource
WorkerService
workerService
;
/**
* 根据条件查询商家列表
* @param store
* @return
*/
@RequestMapping
(
"getStoreList"
)
@ResponseBody
public
PageFinder
<
Store
>
getStoreList
(
Store
store
)
{
store
.
setIsDeleted
(
0
);
//未删除
store
.
setIsAvailable
(
1
);
//店铺启用状态
store
.
setIsShopping
(
1
);
//店铺展示状态
Query
q
=
new
Query
(
store
);
return
storeService
.
getStorePagedList
(
q
);
}
/**
* 商家店铺详情信息
*/
@RequestMapping
(
"storeDetails"
)
@ResponseBody
public
ResultInfo
<
Store
>
getStores
(
Store
store
){
ResultInfo
<
Store
>
resultInfo
=
new
ResultInfo
<>();
Store
res
=
storeService
.
getStore
(
store
.
getStoreId
());
if
(
null
!=
res
)
{
resultInfo
.
setCode
(
"1"
);
resultInfo
.
setData
(
res
);
}
else
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"店铺数据丢失"
);
}
return
resultInfo
;
}
}
package
cn
.
com
.
fqy
.
controller
.
mapi
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.ResultInfo
;
import
cn.com.fqy.common.constants.Constant
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Advert
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.model.Worker
;
import
cn.com.fqy.core.service.AdvertService
;
import
cn.com.fqy.core.service.StoreService
;
import
cn.com.fqy.core.service.WorkerService
;
/**
* H5商家数据服务类
* @author Administrator
*
*/
@Controller
@RequestMapping
(
"/h5/shop"
)
public
class
ShopController
{
@Resource
private
AdvertService
advertService
;
@Resource
private
StoreService
storeService
;
@Resource
WorkerService
workerService
;
/**
* 根据条件查询商家列表
* @param store
* @return
*/
@RequestMapping
(
"getStoreList"
)
@ResponseBody
public
ResultInfo
<
List
<
Store
>>
getStoreList
(
Store
store
)
{
ResultInfo
<
List
<
Store
>>
resultInfo
=
new
ResultInfo
<
List
<
Store
>>();
store
.
setIsDeleted
(
0
);
//未删除
store
.
setIsAvailable
(
1
);
//店铺启用状态
store
.
setIsShopping
(
1
);
//店铺展示状态
Query
q
=
new
Query
(
store
);
PageFinder
<
Store
>
pageResult
=
storeService
.
getStorePagedList
(
q
);
if
(
null
!=
pageResult
&&
pageResult
.
getData
().
size
()
>
0
)
{
List
<
Store
>
result
=
pageResult
.
getData
();
resultInfo
.
setData
(
result
);
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
resultInfo
.
setMsg
(
"请求成功"
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setMsg
(
"暂无数据"
);
}
return
resultInfo
;
}
/**
* 商家店铺详情信息
*/
@RequestMapping
(
"storeDetails"
)
@ResponseBody
public
ResultInfo
<
Store
>
getStores
(
Store
store
){
ResultInfo
<
Store
>
resultInfo
=
new
ResultInfo
<>();
Store
res
=
storeService
.
getStore
(
store
.
getStoreId
());
if
(
null
!=
res
)
{
resultInfo
.
setCode
(
"1"
);
resultInfo
.
setData
(
res
);
}
else
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"店铺数据丢失"
);
}
return
resultInfo
;
}
}
2code/server/store-system/src/main/java/cn/com/fqy/controller/mapi/WorkerController.java
View file @
08459128
package
cn
.
com
.
fqy
.
controller
.
mapi
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.ResultInfo
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Advert
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.model.Worker
;
import
cn.com.fqy.core.service.AdvertService
;
import
cn.com.fqy.core.service.StoreService
;
import
cn.com.fqy.core.service.WorkerService
;
/**
* H5员工数据服务类
* @author Administrator
*
*/
@Controller
@RequestMapping
(
"/h5/worker"
)
public
class
WorkerController
{
@Resource
private
AdvertService
advertService
;
@Resource
private
StoreService
storeService
;
@Resource
WorkerService
workerService
;
/**
* 根据条件查询员工列表
* @param store
* @return
*/
@RequestMapping
(
"getWorkerList"
)
@ResponseBody
public
PageFinder
<
Worker
>
getStoreList
(
Worker
worker
)
{
worker
.
setIsDeleted
(
0
);
//未删除
worker
.
setIsAuditing
(
1
);
//已审核
worker
.
setIsShopping
(
1
);
//已展示
Query
q
=
new
Query
(
worker
);
return
workerService
.
getWorkerPagedList
(
q
);
}
/**
* 员工详情信息
*/
@RequestMapping
(
"workerDetails"
)
@ResponseBody
public
ResultInfo
<
Worker
>
workerDetails
(
Worker
worker
){
ResultInfo
<
Worker
>
resultInfo
=
new
ResultInfo
<>();
Worker
res
=
workerService
.
getWorker
(
worker
.
getWorkerId
());
if
(
null
!=
res
)
{
resultInfo
.
setCode
(
"1"
);
resultInfo
.
setData
(
res
);
}
else
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"员工信息丢失"
);
}
return
resultInfo
;
}
}
package
cn
.
com
.
fqy
.
controller
.
mapi
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.ResultInfo
;
import
cn.com.fqy.common.constants.Constant
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Advert
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.model.Worker
;
import
cn.com.fqy.core.service.AdvertService
;
import
cn.com.fqy.core.service.StoreService
;
import
cn.com.fqy.core.service.WorkerService
;
/**
* H5员工数据服务类
* @author Administrator
*
*/
@Controller
@RequestMapping
(
"/h5/worker"
)
public
class
WorkerController
{
@Resource
private
AdvertService
advertService
;
@Resource
private
StoreService
storeService
;
@Resource
WorkerService
workerService
;
/**
* 根据条件查询员工列表
* @param store
* @return
*/
@RequestMapping
(
"getWorkerList"
)
@ResponseBody
public
ResultInfo
<
List
<
Worker
>>
getStoreList
(
Worker
worker
)
{
ResultInfo
<
List
<
Worker
>>
resultInfo
=
new
ResultInfo
<
List
<
Worker
>>();
worker
.
setIsDeleted
(
0
);
//未删除
worker
.
setIsAuditing
(
1
);
//已审核
worker
.
setIsShopping
(
1
);
//已展示
Query
q
=
new
Query
(
worker
);
PageFinder
<
Worker
>
pageResult
=
workerService
.
getWorkerPagedList
(
q
);
if
(
null
!=
pageResult
&&
pageResult
.
getData
().
size
()
>
0
)
{
List
<
Worker
>
result
=
pageResult
.
getData
();
resultInfo
.
setData
(
result
);
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
resultInfo
.
setMsg
(
"请求成功"
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setMsg
(
"暂无数据"
);
}
return
resultInfo
;
}
/**
* 员工详情信息
*/
@RequestMapping
(
"workerDetails"
)
@ResponseBody
public
ResultInfo
<
Worker
>
workerDetails
(
Worker
worker
){
ResultInfo
<
Worker
>
resultInfo
=
new
ResultInfo
<>();
Worker
res
=
workerService
.
getWorker
(
worker
.
getWorkerId
());
if
(
null
!=
res
)
{
resultInfo
.
setCode
(
"1"
);
resultInfo
.
setData
(
res
);
}
else
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"员工信息丢失"
);
}
return
resultInfo
;
}
}
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