- 前端:支付单列表
- 前端:退款单列表
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>user-service-api</artifactId>
|
||||
|
||||
@@ -15,7 +15,8 @@ import org.springframework.web.servlet.config.annotation.*;
|
||||
@EnableWebMvc
|
||||
@Configuration
|
||||
@Import(value = {GlobalExceptionHandler.class, // 统一全局返回
|
||||
UserSecurityInterceptor.class, AdminSecurityInterceptor.class}) // 安全拦截器,实现认证和授权功能。
|
||||
UserSecurityInterceptor.class, UserAccessLogInterceptor.class,
|
||||
AdminSecurityInterceptor.class}) // 安全拦截器,实现认证和授权功能。
|
||||
public class MVCConfiguration implements WebMvcConfigurer {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -12,7 +12,6 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@@ -20,8 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
@Api("用户模块")
|
||||
public class AdminsUserController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO dubbo 2.7.2 删除,用于解决 bug
|
||||
@Reference(validation = "true", version = "${dubbo.provider.UserService.version}")
|
||||
private UserService userService;
|
||||
|
||||
// 分页
|
||||
@@ -33,9 +31,11 @@ public class AdminsUserController {
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, example = "10"),
|
||||
})
|
||||
public CommonResult<AdminsUserPageVO> page(@RequestParam(value = "nickname", required = false) String nickname,
|
||||
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
|
||||
@RequestParam(value = "status", required = false) Integer status,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
UserPageDTO userPageDTO = new UserPageDTO().setNickname(nickname).setPageNo(pageNo).setPageSize(pageSize);
|
||||
UserPageDTO userPageDTO = new UserPageDTO().setNickname(nickname).setStatus(status)
|
||||
.setPageNo(pageNo).setPageSize(pageSize);
|
||||
// 查询分页
|
||||
CommonResult<UserPageBO> result = userService.getUserPage(userPageDTO);
|
||||
// 转换结果
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package cn.iocoder.mall.user.application.controller.users;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.user.application.convert.PassportConvert;
|
||||
import cn.iocoder.mall.user.application.vo.users.UsersAccessTokenVO;
|
||||
import cn.iocoder.mall.user.sdk.annotation.PermitAll;
|
||||
import cn.iocoder.mall.user.api.MobileCodeService;
|
||||
import cn.iocoder.mall.user.api.OAuth2Service;
|
||||
import cn.iocoder.mall.user.api.UserService;
|
||||
import cn.iocoder.mall.user.api.bo.OAuth2AccessTokenBO;
|
||||
import cn.iocoder.mall.user.application.convert.PassportConvert;
|
||||
import cn.iocoder.mall.user.application.vo.users.UsersAccessTokenVO;
|
||||
import cn.iocoder.mall.user.application.vo.users.UsersMobileRegisterVO;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.user.sdk.annotation.PermitAll;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -25,14 +24,11 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api("Passport 模块")
|
||||
public class PassportController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO dubbo 2.7.2 删除,用于解决 bug
|
||||
@Reference(validation = "true", version = "${dubbo.provider.OAuth2Service.version}")
|
||||
private OAuth2Service oauth2Service;
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO dubbo 2.7.2 删除,用于解决 bug
|
||||
@Reference(validation = "true", version = "${dubbo.provider.UserService.version}")
|
||||
private UserService userService;
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO dubbo 2.7.2 删除,用于解决 bug
|
||||
@Reference(validation = "true", version = "${dubbo.provider.MobileCodeService.version}")
|
||||
private MobileCodeService mobileCodeService;
|
||||
|
||||
// TODO 功能:手机密码登陆
|
||||
|
||||
@@ -12,7 +12,6 @@ import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -29,8 +28,7 @@ import java.util.List;
|
||||
@Api(value = "用户地址API")
|
||||
public class UserAddressController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO dubbo 2.7.2 删除,用于解决 bug
|
||||
@Reference(validation = "true", version = "${dubbo.provider.UserAddressService.version}")
|
||||
private UserAddressService userAddressService;
|
||||
|
||||
@PostMapping("add")
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package cn.iocoder.mall.user.application.controller.users;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.user.application.convert.UserConvert;
|
||||
import cn.iocoder.mall.user.api.UserService;
|
||||
import cn.iocoder.mall.user.api.bo.UserBO;
|
||||
import cn.iocoder.mall.user.api.dto.UserUpdateDTO;
|
||||
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
|
||||
import cn.iocoder.mall.user.application.convert.UserConvert;
|
||||
import cn.iocoder.mall.user.application.vo.users.UsersUserVO;
|
||||
import cn.iocoder.mall.user.api.UserService;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@@ -18,8 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
@Api("用户模块")
|
||||
public class UserController {
|
||||
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO dubbo 2.7.2 删除,用于解决 bug
|
||||
@Reference(validation = "true", version = "${dubbo.provider.UserService.version}")
|
||||
private UserService userService;
|
||||
|
||||
@GetMapping("/info")
|
||||
|
||||
@@ -13,8 +13,8 @@ import java.util.List;
|
||||
public class AdminsUserPageVO {
|
||||
|
||||
@ApiModelProperty(value = "用户数组")
|
||||
private List<AdminsUserVO> users;
|
||||
private List<AdminsUserVO> list;
|
||||
@ApiModelProperty(value = "用户总数")
|
||||
private Integer count;
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
@@ -34,8 +33,7 @@ public class UserAccessLogInterceptor extends HandlerInterceptorAdapter {
|
||||
*/
|
||||
private static final ThreadLocal<Integer> USER_ID = new ThreadLocal<>();
|
||||
|
||||
@Reference
|
||||
@Autowired(required = false)
|
||||
@Reference(validation = "true", version = "${dubbo.provider.UserAccessLogService.version:1.0.0}")
|
||||
private UserAccessLogService userAccessLogService;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,6 @@ import cn.iocoder.mall.user.sdk.annotation.PermitAll;
|
||||
import cn.iocoder.mall.user.sdk.context.UserSecurityContext;
|
||||
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
@@ -23,8 +22,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
@Component
|
||||
public class UserSecurityInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
@Reference
|
||||
@Autowired(required = false)
|
||||
@Reference(validation = "true", version = "${dubbo.provider.OAuth2Service.version:1.0.0}")
|
||||
private OAuth2Service oauth2Service;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,10 +13,10 @@ public class UserPageBO implements Serializable {
|
||||
/**
|
||||
* 用户数组
|
||||
*/
|
||||
private List<UserBO> users;
|
||||
private List<UserBO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer count;
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ public class UserPageDTO {
|
||||
* 模糊查询
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
|
||||
@@ -18,9 +18,11 @@ public interface UserMapper {
|
||||
UserDO selectById(@Param("id") Integer id);
|
||||
|
||||
List<UserDO> selectListByNicknameLike(@Param("nickname") String nickname,
|
||||
@Param("status") Integer status,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
Integer selectCountByNicknameLike(@Param("nickname") String nickname);
|
||||
Integer selectCountByNicknameLike(@Param("nickname") String nickname,
|
||||
@Param("status") Integer status);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Date;
|
||||
* MobileCodeService ,实现用户登陆时需要的验证码
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.MobileCodeService.version}")
|
||||
public class MobileCodeServiceImpl implements MobileCodeService {
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.UUID;
|
||||
* OAuth2Service ,实现用户授权相关的逻辑
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OAuth2Service.version}")
|
||||
public class OAuth2ServiceImpl implements OAuth2Service {
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true")
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.UserAccessLogService.version}")
|
||||
public class UserAccessLogServiceImpl implements UserAccessLogService {
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
* @time 2019-04-06 13:26
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true")
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.UserAddressService.version}")
|
||||
public class UserAddressServiceImpl implements UserAddressService {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Date;
|
||||
* UserService ,实现和用户信息相关的逻辑
|
||||
*/
|
||||
@Service
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true")
|
||||
@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.UserService.version}")
|
||||
public class UserServiceImpl implements UserService {
|
||||
|
||||
@Autowired
|
||||
@@ -71,11 +71,12 @@ public class UserServiceImpl implements UserService {
|
||||
public CommonResult<UserPageBO> getUserPage(UserPageDTO userPageDTO) {
|
||||
UserPageBO userPageBO = new UserPageBO();
|
||||
// 查询分页数据
|
||||
int offset = userPageDTO.getPageNo() * userPageDTO.getPageSize();
|
||||
userPageBO.setUsers(UserConvert.INSTANCE.convert(userMapper.selectListByNicknameLike(userPageDTO.getNickname(),
|
||||
int offset = (userPageDTO.getPageNo() - 1) * userPageDTO.getPageSize();
|
||||
userPageBO.setList(UserConvert.INSTANCE.convert(userMapper.selectListByNicknameLike(
|
||||
userPageDTO.getNickname(), userPageDTO.getStatus(),
|
||||
offset, userPageDTO.getPageSize())));
|
||||
// 查询分页总数
|
||||
userPageBO.setCount(userMapper.selectCountByNicknameLike(userPageDTO.getNickname()));
|
||||
userPageBO.setTotal(userMapper.selectCountByNicknameLike(userPageDTO.getNickname(), userPageDTO.getStatus()));
|
||||
return CommonResult.success(userPageBO);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,14 @@ dubbo:
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.user.biz.service
|
||||
demo:
|
||||
service:
|
||||
version: 1.0.0
|
||||
provider:
|
||||
MobileCodeService:
|
||||
version: 1.0.0
|
||||
OAuth2Service:
|
||||
version: 1.0.0
|
||||
UserAccessLogService:
|
||||
version: 1.0.0
|
||||
UserAddressService:
|
||||
version: 1.0.0
|
||||
UserService:
|
||||
version: 1.0.0
|
||||
|
||||
@@ -61,6 +61,9 @@
|
||||
<if test="nickname != null">
|
||||
nickname LIKE "%"#{nickname}"%"
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
LIMIT #{offset}, #{limit}
|
||||
@@ -74,9 +77,12 @@
|
||||
<if test="nickname != null">
|
||||
nickname LIKE "%"#{nickname}"%"
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user