Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
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
licc
shop-Mall
Commits
3b192d8c
Commit
3b192d8c
authored
Mar 08, 2021
by
m1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录功能增加生成唯一标识 用于绑定有赞OpengId
修复 前端无法拿到返回值问题
parent
3ced1dd8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
226 additions
and
88 deletions
+226
-88
ResultEnum.java
...n/src/main/java/cn/wisenergy/common/enums/ResultEnum.java
+2
-0
Result.java
...ommon/src/main/java/cn/wisenergy/common/utils/Result.java
+19
-1
ResultUtils.java
.../src/main/java/cn/wisenergy/common/utils/ResultUtils.java
+13
-0
ShopZxMapper.java
...apper/src/main/java/cn/wisenergy/mapper/ShopZxMapper.java
+28
-4
ShopZxMapper.xml
wisenergy-mapper/src/main/resources/mapper/ShopZxMapper.xml
+3
-3
UploadService.java
...src/main/java/cn/wisenergy/service/app/UploadService.java
+16
-8
UserService.java
...e/src/main/java/cn/wisenergy/service/app/UserService.java
+3
-21
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+25
-9
LoginController.java
...n/wisenergy/web/admin/controller/app/LoginController.java
+60
-24
SmsController.java
.../cn/wisenergy/web/admin/controller/app/SmsController.java
+27
-4
UploadController.java
.../wisenergy/web/admin/controller/app/UploadController.java
+30
-14
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/enums/ResultEnum.java
View file @
3b192d8c
...
...
@@ -23,6 +23,8 @@ public enum ResultEnum {
CODETYPE_ERROR
(
"1009"
,
"手机号码格式不正确"
),
CODESEND_ERROR
(
"1010"
,
"请相隔60S后再发送"
),
FILE_NOT_LOGIN
(
"2001"
,
"未登录"
),
FILE_NOT_HAVE_PERMISSION
(
"2002"
,
"没有权限"
),
FAIL_ACCOUNT_LOCK
(
"2003"
,
"账号已被锁定"
),
...
...
wisenergy-common/src/main/java/cn/wisenergy/common/utils/Result.java
View file @
3b192d8c
...
...
@@ -5,19 +5,22 @@ import cn.wisenergy.common.enums.ResultEnum;
import
org.springframework.stereotype.Component
;
import
java.io.Serializable
;
import
java.util.Map
;
/**
* 返回信息包装类
* Created by m1991 on 2021/2/28 23:08
*/
@Component
public
class
Result
<
T
>
implements
Serializable
{
public
class
Result
<
T
>
implements
Serializable
{
public
String
code
;
public
String
msg
;
private
T
data
;
private
T
wyz
;
/**
* 无参构造
*/
...
...
@@ -52,6 +55,21 @@ public class Result<T> implements Serializable{
this
.
data
=
data
;
}
public
T
getWyz
()
{
return
wyz
;
}
public
void
setWyz
(
T
wyz
)
{
this
.
wyz
=
wyz
;
}
public
Result
(
String
code
,
String
msg
,
T
data
,
T
wyz
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
data
=
data
;
this
.
wyz
=
wyz
;
}
/**
* 根据枚举创建一个Result
* @param resultEnum
...
...
wisenergy-common/src/main/java/cn/wisenergy/common/utils/ResultUtils.java
View file @
3b192d8c
...
...
@@ -41,6 +41,19 @@ public class ResultUtils {
return
Result
;
}
/**
* 用于返回唯一值
* @param data
* @param wyz
* @return
*/
public
static
Result
returnDataSuccess
(
Object
data
,
String
wyz
)
{
Result
Result
=
new
Result
(
ResultEnum
.
SUCCESS
);
Result
.
setData
(
data
);
Result
.
setWyz
(
wyz
);
return
Result
;
}
/**
* 返回一个失败的Result
* @return
...
...
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/ShopZxMapper.java
View file @
3b192d8c
...
...
@@ -22,19 +22,43 @@ public interface ShopZxMapper extends BaseMapper<shopZx> {
*/
int
zxadd
(
@Param
(
"zxUrl"
)
String
zxUrl
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"zxName"
)
String
zxName
,
@Param
(
"zxField"
)
String
zxField
,
@Param
(
"imgUrl"
)
String
imgUrl
,
@Param
(
"zxAddress"
)
String
zxAddress
);
/**
* 查询全部资讯
* @return
*/
List
<
shopZx
>
findAll
();
/**分页 资讯内容倒叙查询
* PageSize int, --每页的记录数量,比如10条#{beginPos},#{pageSize}
* @param
* @return
*/
// List selectAll( @Param("beginPos") int beginPos,@Param("PageSize") int PageSize);
List
<
shopZx
>
selectPage
();
/**
* 根据手机号删除资讯
* @param userId
* @return
*/
int
deleteByPrimaryKey
(
Long
userId
);
/**
* 分页查询资讯
* 根据手机号查询资讯
* @param userId
* @return
*/
// List<shopZx> selectPage();
int
insert
(
shopZx
userId
);
int
insertSelective
(
shopZx
userId
);
shopZx
selectByPrimaryKey
(
Long
userId
);
int
updateByPrimaryKeySelective
(
shopZx
userId
);
int
updateByPrimaryKey
(
shopZx
userId
);
}
wisenergy-mapper/src/main/resources/mapper/ShopZxMapper.xml
View file @
3b192d8c
...
...
@@ -48,11 +48,11 @@
<!--</insert>-->
<!--资讯内容倒叙查询-->
<select
id=
"
select
All"
parameterType=
"java.lang.Integer"
resultType=
"cn.wisenergy.model.app.shopZx"
>
<select
id=
"
find
All"
parameterType=
"java.lang.Integer"
resultType=
"cn.wisenergy.model.app.shopZx"
>
select zxid as zxid,zxUrl as zxUrl,
zxLikes as zxLikes,userid as userid,zxName as zxName,
zxShenHe as zxShenHe,zxField as zxField,zxDate as zxDate,
imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc limit #{
beginPos
},#{pageSize}
imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc limit #{
pageNum
},#{pageSize}
</select>
<!--资讯总记录数查询-->
...
...
@@ -64,7 +64,7 @@
select zxid as zxid,zxUrl as zxUrl,
zxLikes as zxLikes,userid as userid,zxName as zxName,
zxShenHe as zxShenHe,zxField as zxField,zxDate as zxDate,
imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc limit #{
beginPos
},#{pageSize}
imgUrl as imgUrl,zxAddress as zxAddress from shop_zx order by zxid desc limit #{
pageNum
},#{pageSize}
</select>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/UploadService.java
View file @
3b192d8c
...
...
@@ -3,6 +3,7 @@ package cn.wisenergy.service.app;
import
cn.wisenergy.common.utils.PageRequest
;
import
cn.wisenergy.common.utils.PageResult
;
import
cn.wisenergy.mapper.ShopZxMapper
;
import
cn.wisenergy.model.app.shopZx
;
import
org.springframework.core.io.Resource
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -47,24 +48,31 @@ public interface UploadService {
String
storeFile
(
MultipartFile
file
);
Resource
loadFileAsResource
(
String
fileName
);
/**
*
查询资讯所有信息(分页——10条信息一页)
* @param
*
根据用户ID查找用户资讯
* @param
userId
* @return
*/
Map
getList
(
int
beginPos
,
int
pageSize
);
// public Page<shopZx> find();
shopZx
findByUserId
(
Long
userId
);
/**
* 分页查询接口
* 查询所有资讯
* @return
*/
List
<
shopZx
>
findAll
();
/**
* 分页查询接口 资讯分页
* 这里统一封装了分页请求和结果,避免直接引入具体框架的分页对象, 如MyBatis或JPA的分页对象
* 从而避免因为替换ORM框架而导致服务层、控制层的分页接口也需要变动的情况,替换ORM框架也不会
* 影响服务层以上的分页接口,起到了解耦的作用
* @param pageRequest 自定义,统一分页查询请求
* @return PageResult 自定义,统一分页查询结果
*/
// PageResult findPage(PageRequest pageRequest);
PageResult
findPage
(
PageRequest
pageRequest
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserService.java
View file @
3b192d8c
...
...
@@ -7,28 +7,26 @@ import cn.wisenergy.model.vo.AerialDeliveryVo;
import
java.util.Map
;
/**
* @author 86187
* @author 86187
* @ Description: 用户接口
* @ Author : 86187
* @ Date : 2021/1/6 16:08
* @author 86187
*/
public
interface
UserService
{
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
User
getById
(
String
userId
);
User
getById
(
String
userId
);
R
<
Integer
>
getById1
(
String
userId
);
R
<
Integer
>
getById1
(
String
userId
);
/**
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
...
...
@@ -59,21 +57,5 @@ public interface UserService {
*/
R
<
AerialDeliveryVo
>
queryAerialDelivery
();
/**
* 设置用户头像
*
* @param userId 用户id
* @param headImage 头像地址url
* @return true or false
*/
R
<
Boolean
>
setHeadImage
(
String
userId
,
String
headImage
);
/**
* 填写设置页面-邀请码
*
* @param userId 用户id
* @param inviteCode 邀请码
* @return true or false
*/
R
<
Boolean
>
fillInInviteCode
(
String
userId
,
String
inviteCode
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
3b192d8c
...
...
@@ -256,13 +256,6 @@ public class UploadServiceImpl implements UploadService {
}
/**
* 获取资讯分页数据
* @return
*/
// @Override
/**
* 多文件上传 TODO
*/
...
...
@@ -321,8 +314,31 @@ public class UploadServiceImpl implements UploadService {
}
@Override
public
Map
getList
(
int
beginPos
,
int
pageSize
)
{
return
null
;
public
shopZx
findByUserId
(
Long
userId
)
{
return
shopZxMapper
.
selectByPrimaryKey
(
userId
);
}
@Override
public
List
<
shopZx
>
findAll
()
{
return
shopZxMapper
.
findAll
();
}
/**
* 调用分页插件完成分页
* @param pageRequest
* @return
*/
private
PageInfo
<
shopZx
>
getPageInfo
(
PageRequest
pageRequest
)
{
int
pageNum
=
pageRequest
.
getPageNum
();
int
pageSize
=
pageRequest
.
getPageSize
();
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
shopZx
>
sysMenus
=
shopZxMapper
.
selectPage
();
return
new
PageInfo
<
shopZx
>(
sysMenus
);
}
@Override
public
PageResult
findPage
(
PageRequest
pageRequest
)
{
return
PageUtils
.
getPageResult
(
pageRequest
,
getPageInfo
(
pageRequest
));
}
// @Override
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/LoginController.java
View file @
3b192d8c
...
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
...
...
@@ -27,7 +28,7 @@ import java.util.Map;
*/
@Api
(
tags
=
"登录/注册"
)
@Slf4j
@RequestMapping
(
"
/
api/user"
)
@RequestMapping
(
"api/user"
)
@RestController
public
class
LoginController
{
@Autowired
...
...
@@ -52,30 +53,41 @@ public class LoginController {
@ApiImplicitParam
(
name
=
"sms"
,
value
=
"验证码"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户手机号"
,
required
=
true
,
dataType
=
"String"
)})
@RequestMapping
(
"/login"
)
public
Result
loginBySms
(
String
userId
,
String
sms
)
throws
Exception
{
public
Map
loginBySms
(
@RequestParam
String
userId
,
@RequestParam
String
sms
)
throws
Exception
{
User
users
=
null
;
Map
map
=
new
HashMap
();
String
key
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
SMS_PRIFIX
,
userId
,
Constants
.
Sms
.
CodeType
.
LOGIN_OR_REGISTER
+
""
);
String
redisCode
=
redisUtils
.
getValue
(
key
);
if
(
StringUtil
.
isBlank
(
redisCode
)
||
!
sms
.
equals
(
redisCode
)){
throw
new
BaseException
(
ResultEnum
.
FAIL_VERIFY
);
map
.
put
(
"code"
,
"1003"
);
map
.
put
(
"msg"
,
"验证码错误"
);
// throw new BaseException(ResultEnum.FAIL_VERIFY);
return
map
;
}
redisUtils
.
delete
(
key
);
//根据手机号判断用户是否存在
//不存在则保存用户信息--修改为提示用户注册
users
=
usersService
.
queryUsersByPhone
(
userId
);
if
(
null
==
users
){
throw
new
BaseException
(
ResultEnum
.
FAIL_ACCOUNT_NOT_EXIST
);
// users=new User();
// users.setUserId(userId);
// usersService.qdtxAddUsers(users);;
//throw new BaseException(ResultEnum.FAIL_ACCOUNT_NOT_EXIST);
map
.
put
(
"code"
,
"1005"
);
map
.
put
(
"msg"
,
"账号不存在,请注册"
);
return
map
;
}
String
token
=
createToken
(
users
);
String
token
=
null
;
token
=
createToken
(
users
);
if
(!
StringUtil
.
isBlank
(
token
)){
return
ResultUtils
.
returnDataSuccess
(
StringUtil
.
createSimpleMap
(
"token"
,
token
));
String
wyz
=
users
.
getInviteCode
();
Map
<
String
,
Object
>
map1
=
StringUtil
.
createSimpleMap
(
"token"
,
token
);
map1
.
put
(
"wyz"
,
wyz
);
map1
.
put
(
"code"
,
0
);
map1
.
put
(
"msg"
,
"成功!"
);
return
map1
;
}
return
ResultUtils
.
returnFail
();
return
(
Map
)
ResultUtils
.
returnFail
();
}
public
String
createToken
(
User
users
)
throws
Exception
{
...
...
@@ -87,21 +99,30 @@ public class LoginController {
redisUtils
.
set
(
tokenKey
,
JSONObject
.
toJSONString
(
usersDto
),
Constants
.
Duration
.
HALF_HOUR_INT
);
return
token
;
}
@ApiOperation
(
value
=
"获取用户登录token信息"
,
notes
=
"获取用户登录token信息"
,
httpMethod
=
"POST"
,
produces
=
"application/json; charset=UTF-8"
)
@RequestMapping
(
"/info"
)
public
Result
info
(
HttpServletRequest
request
)
throws
Exception
{
public
Map
info
(
HttpServletRequest
request
)
throws
Exception
{
String
token
=
request
.
getHeader
(
"token"
);
String
tokenKey
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
TOKEN_PRIFIX
,
token
);
String
userDtoJson
=
redisUtils
.
getValue
(
tokenKey
);
if
(
StringUtil
.
isBlank
(
userDtoJson
)){
throw
new
BaseException
(
ResultEnum
.
FILE_NOT_LOGIN
);
Map
map
=
new
HashMap
();
map
.
put
(
"code"
,
"2001"
);
map
.
put
(
"msg"
,
"未登录"
);
return
map
;
///throw new BaseException(ResultEnum.FILE_NOT_LOGIN);
}
UsersDto
usersDto
=
JSONObject
.
parseObject
(
userDtoJson
,
UsersDto
.
class
);
usersDto
.
setPassword
(
null
);
return
ResultUtils
.
returnDataSuccess
(
userDtoJson
);
return
(
Map
)
ResultUtils
.
returnDataSuccess
(
userDtoJson
);
}
//用户注册
@ApiOperation
(
value
=
"用户注册"
,
notes
=
"用户注册"
,
httpMethod
=
"POST"
,
produces
=
"application/json; charset=UTF-8"
)
@ApiImplicitParams
({
...
...
@@ -110,23 +131,38 @@ public class LoginController {
@ApiImplicitParam
(
name
=
"sms"
,
value
=
"验证码"
,
required
=
true
,
dataType
=
"String"
)
})
@RequestMapping
(
"/register"
)
public
Map
register
(
@RequestParam
String
userId
,
String
beInvitedCode
,
@RequestParam
String
sms
)
throws
Exception
{
public
Map
register
(
@RequestParam
String
userId
,
@RequestParam
String
beInvitedCode
,
@RequestParam
String
sms
)
{
User
users
=
null
;
String
key
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
SMS_PRIFIX
,
userId
,
Constants
.
Sms
.
CodeType
.
LOGIN_OR_REGISTER
+
""
);
String
redisCode
=
redisUtils
.
getValue
(
key
);
if
(
StringUtil
.
isBlank
(
redisCode
)
||
!
sms
.
equals
(
redisCode
)){
throw
new
BaseException
(
ResultEnum
.
FAIL_VERIFY
);
try
{
throw
new
BaseException
(
ResultEnum
.
FAIL_VERIFY
);
}
catch
(
BaseException
e
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"code"
,
"1003"
);
map
.
put
(
"msg"
,
"验证码错误"
);
// throw new BaseException(ResultEnum.FAIL_VERIFY);
return
map
;
}
}
redisUtils
.
delete
(
key
);
//判断phone是否符合输入类型
if
(!
userId
.
matches
(
Constants
.
RegConstant
.
PHONE_REGSTR
)){
throw
new
BaseException
(
ResultEnum
.
PHONE_ERROR
);
try
{
throw
new
BaseException
(
ResultEnum
.
PHONE_ERROR
);
}
catch
(
BaseException
e
)
{
e
.
printStackTrace
();
Map
map
=
new
HashMap
();
map
.
put
(
"code"
,
"1008"
);
map
.
put
(
"msg"
,
"手机号码格式不正确"
);
// throw new BaseException(ResultEnum.FAIL_VERIFY);
return
map
;
}
}
// if(userId.equals())){
// throw new BaseException(ResultEnum.PHONE_ERROR);
// }
return
usersService
.
userByZx
(
userId
,
beInvitedCode
);
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SmsController.java
View file @
3b192d8c
...
...
@@ -10,8 +10,13 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
@Api
(
tags
=
"发送手机验证码 codeType 0注册/登录验证 1修改密码 2订单通知信息"
)
@Slf4j
@RequestMapping
(
"/api/sms"
)
...
...
@@ -36,13 +41,31 @@ public class SmsController {
@ApiImplicitParam
(
name
=
"phone"
,
value
=
"用户手机号"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"codeType"
,
value
=
"验证码类型用途 0注册/登录验证 1修改密码 2订单通知信息"
,
dataType
=
"Integer"
)})
@RequestMapping
(
"/verifyCode"
)
public
Result
verifyCode
(
String
phone
,
Integer
codeType
)
throws
Exception
{
@ResponseBody
public
Result
verifyCode
(
@RequestParam
String
phone
,
@RequestParam
Integer
codeType
)
{
Map
map
=
new
HashMap
();
//判断phone和codeType是否符合输入类型
if
(!
phone
.
matches
(
Constants
.
RegConstant
.
PHONE_REGSTR
)){
throw
new
BaseException
(
ResultEnum
.
PHONE_ERROR
);
try
{
throw
new
BaseException
(
ResultEnum
.
PHONE_ERROR
);
}
catch
(
BaseException
e
)
{
e
.
printStackTrace
();
map
.
put
(
"code"
,
"1005"
);
map
.
put
(
"msg"
,
"账号不存在,请注册"
);
return
(
Result
)
map
;
}
}
if
(
codeType
!=
Constants
.
Sms
.
CodeType
.
LOGIN_OR_REGISTER
&&
codeType
!=
Constants
.
Sms
.
CodeType
.
PASS_UPDATE
&&
codeType
!=
Constants
.
Sms
.
CodeType
.
ORDER_NOTICE
){
throw
new
BaseException
(
ResultEnum
.
CODETYPE_ERROR
);
try
{
throw
new
BaseException
(
ResultEnum
.
CODETYPE_ERROR
);
}
catch
(
BaseException
e
)
{
e
.
printStackTrace
();
map
.
put
(
"code"
,
"1009"
);
map
.
put
(
"msg"
,
"手机号码格式不正确"
);
return
(
Result
)
map
;
}
}
String
key
=
StringUtil
.
formatKeyWithPrefix
(
Constants
.
RedisKey
.
PROJECT_PRIFIX
,
Constants
.
RedisKey
.
SMS_PRIFIX
,
phone
,
codeType
+
""
);
...
...
@@ -52,6 +75,6 @@ public class SmsController {
redisUtils
.
set
(
key
,
code
,
Constants
.
Duration
.
HALF_HOUR_INT
);
boolean
flag
=
smsUtils
.
sendMessage
(
phone
,
Constants
.
Sms
.
TemplateCode
.
LOGIN_SF_REGISTER
,
code
);
return
flag
?
ResultUtils
.
returnSuccess
():
ResultUtils
.
returnFail
(
);
return
(
flag
?
ResultUtils
.
returnSuccess
():
ResultUtils
.
returnFail
()
);
}
}
\ No newline at end of file
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UploadController.java
View file @
3b192d8c
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.PageRequest
;
import
cn.wisenergy.common.utils.Result
;
import
cn.wisenergy.service.app.UploadService
;
import
io.swagger.annotations.Api
;
...
...
@@ -104,22 +105,37 @@ public class UploadController {
}
/**
* 资讯分页展示接口
* @param pageOffset
* @param pageSize
* @return
*/
@ApiOperation
(
value
=
"资讯信息接口"
,
notes
=
"资讯信息接口"
,
httpMethod
=
"GET"
,
produces
=
"application/json; charset=UTF-8"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"beginPos"
,
value
=
"从几开始"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"展示数量(条数)"
,
required
=
true
,
dataType
=
"int"
)})
@RequestMapping
(
value
=
"/shop"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
Result
find
(
Integer
beginPos
,
Integer
pageSize
)
{
Map
shopZxPage
=
uploadService
.
getList
(
beginPos
,
pageSize
);
@GetMapping
(
value
=
"/findByUserId"
)
public
Object
findByUserId
(
@RequestParam
Long
userId
)
{
return
uploadService
.
findByUserId
(
userId
);
}
@GetMapping
(
value
=
"/findAll"
)
public
Object
findAll
()
{
return
uploadService
.
findAll
();
}
return
new
Result
(
"0"
,
"success"
,
shopZxPage
);
@ApiOperation
(
value
=
"资讯信息接口"
,
notes
=
"资讯信息接口"
,
httpMethod
=
"POST"
,
produces
=
"application/json; charset=UTF-8"
)
@PostMapping
(
value
=
"/findPage"
)
public
Object
findPage
(
@RequestBody
PageRequest
pageQuery
)
{
return
uploadService
.
findPage
(
pageQuery
);
}
// /**
// * 资讯分页展示接口
// * @param pageOffset
// * @param pageSize
// * @return
// */
// @ApiOperation(value = "资讯信息接口", notes = "资讯信息接口", httpMethod = "GET", produces = "application/json; charset=UTF-8")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "beginPos", value = "从几开始", required = true, dataType = "int"),
// @ApiImplicitParam(name = "pageSize", value = "展示数量(条数)", required = true, dataType = "int")})
// @RequestMapping(value = "/shop", method = {RequestMethod.POST, RequestMethod.GET})
// public Result find(Integer beginPos, Integer pageSize) {
// Map shopZxPage = uploadService.getList(beginPos, pageSize);
//
// return new Result("0", "success", shopZxPage);
// }
}
\ 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