启动成功
This commit is contained in:
@@ -8,7 +8,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages = {"cn.iocoder.mall.productservice.rpc","cn.iocoder.mall.payservice.rpc"
|
||||
,"cn.iocoder.mall.promotion.api.rpc","cn.iocoder.mall.systemservice.rpc"})
|
||||
,"cn.iocoder.mall.promotion.api.rpc","cn.iocoder.mall.systemservice.rpc","cn.iocoder.mall.userservice.rpc"})
|
||||
public class ManagementWebApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
### /admin/page 成功
|
||||
GET {{baseUrl}}/admin/page?pageNo=1&pageSize=10
|
||||
GET http://127.0.0.1:18083/management-api/admin/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /admin/create 成功
|
||||
POST {{baseUrl}}/admin/create
|
||||
POST http://127.0.0.1:18083/management-api/admin/create
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
username=admin02&password=buzhidao&name=测试管理员&departmentId=1
|
||||
|
||||
### /admin/update 成功
|
||||
POST {{baseUrl}}/admin/update
|
||||
POST http://127.0.0.1:18083/management-api/admin/update
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
id=31&username=admin02&password=buzhidao&name=测试管理员&departmentId=1
|
||||
|
||||
### /admin/update-status 成功
|
||||
POST {{baseUrl}}/admin/update-status
|
||||
POST http://127.0.0.1:18083/management-api/admin/update-status
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
adminId=31&status=1
|
||||
|
||||
### /admin/update-status 失败,参数缺失
|
||||
POST {{baseUrl}}/admin/update-status
|
||||
POST http://127.0.0.1:18083/management-api/admin/update-status
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
adminId=31
|
||||
|
||||
### admin/update-status 失败,地址不存在
|
||||
GET {{baseUrl}}/admin/update-status---
|
||||
GET http://127.0.0.1:18083/management-api/admin/update-status---
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
adminId=31&status=sss
|
||||
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
### /department/create 成功
|
||||
POST {{baseUrl}}/department/create
|
||||
POST http://127.0.0.1:18083/management-api/department/create
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
name=测试部门&pid=0&sort=0
|
||||
|
||||
### /department/update 成功
|
||||
POST {{baseUrl}}/department/update
|
||||
POST http://127.0.0.1:18083/management-api/department/update
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
id=1&name=测试部门&pid=0&sort=0
|
||||
|
||||
### /resource/delete 成功
|
||||
POST {{baseUrl}}/department/delete
|
||||
POST http://127.0.0.1:18083/management-api/department/delete
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
id=1
|
||||
|
||||
### /department/get 成功
|
||||
GET {{baseUrl}}/department/get?departmentId=1
|
||||
GET http://127.0.0.1:18083/management-api/department/get?departmentId=1
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /department/list 成功
|
||||
GET {{baseUrl}}/department/list?departmentIds=1,13
|
||||
GET http://127.0.0.1:18083/management-api/department/list?departmentIds=1,13
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /department/tree 成功
|
||||
GET {{baseUrl}}/department/tree
|
||||
GET http://127.0.0.1:18083/management-api/department/tree
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
###
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
### /passport/login 成功
|
||||
POST {{baseUrl}}/passport/login
|
||||
POST http://127.0.0.1:18083/management-api/passport/login
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
username=admin&password=buzhidao
|
||||
|
||||
### /passport/login 密码不正确
|
||||
POST {{baseUrl}}/passport/login
|
||||
POST http://127.0.0.1:18083/management-api/passport/login
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
username=admin&password=1024
|
||||
|
||||
### /passport/login 少传参数
|
||||
POST {{baseUrl}}/passport/login
|
||||
POST http://127.0.0.1:18083/management-api/passport/login
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
username=admin
|
||||
|
||||
### /passport/info 成功
|
||||
GET {{baseUrl}}/passport/info
|
||||
Authorization: Bearer {{accessToken}}
|
||||
GET http://127.0.0.1:18083/management-api/passport/info
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /passport/tree-admin-menu 成功
|
||||
GET {{baseUrl}}/passport/tree-admin-menu
|
||||
GET http://127.0.0.1:18083/management-api/passport/tree-admin-menu
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /passport/list-admin-permission 成功
|
||||
GET {{baseUrl}}/passport/list-admin-permission
|
||||
GET http://127.0.0.1:18083/management-api/passport/list-admin-permission
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
#Authorization: Bearer {{accessToken}}
|
||||
#Authorization: Bearer yudaoyuanma
|
||||
Authorization: Bearer 36dce986276b4d6c8f9f4f3b89b22810
|
||||
|
||||
###
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
### /product-spu/page 成功(全部)
|
||||
GET {{baseUrl}}/pay/transaction/page?pageNo=1&pageSize=10
|
||||
GET http://127.0.0.1:18083/management-api/pay/transaction/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
###
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
### /permission/list 成功
|
||||
GET {{baseUrl}}/permission/list-role-resource?roleId=1
|
||||
GET http://127.0.0.1:18083/management-api/permission/list-role-resource?roleId=1
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /permission/list-admin-roles 成功
|
||||
GET {{baseUrl}}/permission/list-admin-roles?adminId=1
|
||||
GET http://127.0.0.1:18083/management-api/permission/list-admin-roles?adminId=1
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
###
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
### /resource/create 成功
|
||||
POST {{baseUrl}}/resource/create
|
||||
POST http://127.0.0.1:18083/management-api/resource/create
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
name=测试菜单&permission=resource:add&type=1&sort=1&pid=0&route=/resource/list&icon=test
|
||||
|
||||
### /admin/update 成功
|
||||
POST {{baseUrl}}/resource/update
|
||||
POST http://127.0.0.1:18083/management-api/resource/update
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
id=61&name=测试菜单2&permission=resource:add&type=1&sort=1&pid=0&route=/resource/list&icon=test
|
||||
|
||||
### /resource/delete 成功
|
||||
POST {{baseUrl}}/resource/delete
|
||||
POST http://127.0.0.1:18083/management-api/resource/delete
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
resourceId=61
|
||||
|
||||
### /resource/get 成功
|
||||
GET {{baseUrl}}/resource/get?resourceId=61
|
||||
GET http://127.0.0.1:18083/management-api/resource/get?resourceId=61
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /resource/list 成功
|
||||
GET {{baseUrl}}/resource/list?resourceIds=61,63
|
||||
GET http://127.0.0.1:18083/management-api/resource/list?resourceIds=61,63
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /resource/tree 成功
|
||||
GET {{baseUrl}}/resource/tree
|
||||
GET http://127.0.0.1:18083/management-api/resource/tree
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
###
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
### /role/create 成功
|
||||
POST {{baseUrl}}/role/create
|
||||
POST http://127.0.0.1:18083/management-api/role/create
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
#Authorization: Bearer 9d250d9b6c034a6c88bf4034cdf1d4cc
|
||||
|
||||
name=测试角色
|
||||
|
||||
### /role/update 成功
|
||||
POST {{baseUrl}}/role/update
|
||||
POST http://127.0.0.1:18083/management-api/role/update
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
id=14&name=test
|
||||
|
||||
### /resource/delete 成功
|
||||
POST {{baseUrl}}/role/delete
|
||||
POST http://127.0.0.1:18083/management-api/role/delete
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
roleId=14
|
||||
|
||||
### /role/get 成功
|
||||
GET {{baseUrl}}/role/get?roleId=13
|
||||
GET http://127.0.0.1:18083/management-api/role/get?roleId=13
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /role/list-all 成功
|
||||
GET {{baseUrl}}/role/list-all
|
||||
GET http://127.0.0.1:18083/management-api/role/list-all
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /role/list 成功
|
||||
GET {{baseUrl}}/role/list?roleIds=1,13
|
||||
GET http://127.0.0.1:18083/management-api/role/list?roleIds=1,13
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /role/page 成功
|
||||
GET {{baseUrl}}/role/page?pageNo=1&pageSize=10
|
||||
GET http://127.0.0.1:18083/management-api/role/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
###
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /product-spu/page 成功(有库存 + 上架)
|
||||
GET {{baseUrl}}/product-spu/page?pageNo=1&pageSize=10&hasQuantity=true&visible=true
|
||||
GET http://127.0.0.1:18083/management-api/product-spu/page?pageNo=1&pageSize=10&hasQuantity=true&visible=true
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /product-spu/page 成功(无库存 + 下架)
|
||||
GET {{baseUrl}}/product-spu/page?pageNo=1&pageSize=10&hasQuantity=false&visible=false
|
||||
GET http://127.0.0.1:18083/management-api/product-spu/page?pageNo=1&pageSize=10&hasQuantity=false&visible=false
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
### /product-spu/create 成功
|
||||
POST http://127.0.0.1:18083/management-api/product-spu/create
|
||||
@@ -23,17 +23,17 @@ name=新商品&description=新商品描述&cid=637&sellPoint=丑&picUrls=1,2,3&v
|
||||
&skus[1].price=2&skus[1].quantity=50&skus[1].attrValueIds=2,4
|
||||
|
||||
### /product-spu/create 失败(规格不存在)
|
||||
POST {{baseUrl}}/product-spu/create
|
||||
POST http://127.0.0.1:18083/management-api/product-spu/create
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
name=测试商品标题&description=测试商品描述&cid=637&sellPoint=丑&picUrls=1,2,3&visible=true
|
||||
&skus[0].price=1&skus[0].quantity=100&skus[0].attrValueIds=1,0
|
||||
|
||||
### /product-spu/create 失败(规格数量不匹配)
|
||||
POST {{baseUrl}}/product-spu/create
|
||||
POST http://127.0.0.1:18083/management-api/product-spu/create
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
name=测试商品标题&description=测试商品描述&cid=637&sellPoint=丑&picUrls=1,2,3&visible=true
|
||||
&skus[0].price=1&skus[0].quantity=100&skus[0].attrValueIds=1,3
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
### /system-access-log/page 成功
|
||||
GET {{baseUrl}}/system-access-log/page?pageNo=1&pageSize=10
|
||||
GET http://127.0.0.1:18083/management-api/system-access-log/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
|
||||
###
|
||||
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
### /user/page 成功
|
||||
GET {{baseUrl}}/user/page?pageNo=1&pageSize=10
|
||||
GET http://127.0.0.1:18083/management-api/user/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
### /user/update 成功
|
||||
POST {{baseUrl}}/user/update
|
||||
POST http://127.0.0.1:18083/management-api/user/update
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
id=31&username=user02&password=buzhidao&name=测试管理员&departmentId=1
|
||||
|
||||
### /user/update-status 成功
|
||||
POST {{baseUrl}}/user/update-status
|
||||
POST http://127.0.0.1:18083/management-api/user/update-status
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
userId=243&status=2
|
||||
|
||||
### /user/update-status 失败,参数缺失
|
||||
POST {{baseUrl}}/user/update-status
|
||||
POST http://127.0.0.1:18083/management-api/user/update-status
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
Authorization: Bearer yudaoyuanma
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
userId=31
|
||||
|
||||
@@ -8,9 +8,9 @@ import cn.iocoder.mall.managementweb.controller.user.vo.UserRespVO;
|
||||
import cn.iocoder.mall.managementweb.controller.user.vo.UserUpdateInfoReqVO;
|
||||
import cn.iocoder.mall.managementweb.controller.user.vo.UserUpdateStatusReqVO;
|
||||
import cn.iocoder.mall.managementweb.convert.user.UserConvert;
|
||||
import cn.iocoder.mall.userservice.rpc.user.UserRpc;
|
||||
import cn.iocoder.mall.userservice.rpc.user.UserFeign;
|
||||
import cn.iocoder.mall.userservice.rpc.user.dto.UserRespDTO;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -21,16 +21,16 @@ import java.util.List;
|
||||
@Service
|
||||
public class UserManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.UserRpc.version}", validation = "false")
|
||||
private UserRpc userRpc;
|
||||
|
||||
@Autowired
|
||||
private UserFeign userFeign;
|
||||
/**
|
||||
* 更新用户信息
|
||||
*
|
||||
* @param updateInfoReqVO 更新用户信息 VO
|
||||
*/
|
||||
public void updateUserInfo(UserUpdateInfoReqVO updateInfoReqVO) {
|
||||
CommonResult<Boolean> updateUserResult = userRpc.updateUser(UserConvert.INSTANCE.convert(updateInfoReqVO));
|
||||
CommonResult<Boolean> updateUserResult = userFeign.updateUser(UserConvert.INSTANCE.convert(updateInfoReqVO));
|
||||
updateUserResult.checkError();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class UserManager {
|
||||
* @param updateStatusReqVO 更新用户状态 VO
|
||||
*/
|
||||
public void updateUserStatus(UserUpdateStatusReqVO updateStatusReqVO) {
|
||||
CommonResult<Boolean> updateUserResult = userRpc.updateUser(UserConvert.INSTANCE.convert(updateStatusReqVO));
|
||||
CommonResult<Boolean> updateUserResult = userFeign.updateUser(UserConvert.INSTANCE.convert(updateStatusReqVO));
|
||||
updateUserResult.checkError();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class UserManager {
|
||||
* @return 用户
|
||||
*/
|
||||
public UserRespVO getUser(Integer userId) {
|
||||
CommonResult<UserRespDTO> getUserResult = userRpc.getUser(userId);
|
||||
CommonResult<UserRespDTO> getUserResult = userFeign.getUser(userId);
|
||||
getUserResult.checkError();
|
||||
return UserConvert.INSTANCE.convert(getUserResult.getData());
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class UserManager {
|
||||
* @return 用户列表
|
||||
*/
|
||||
public List<UserRespVO> listUsers(List<Integer> userIds) {
|
||||
CommonResult<List<UserRespDTO>> listUserResult = userRpc.listUsers(userIds);
|
||||
CommonResult<List<UserRespDTO>> listUserResult = userFeign.listUsers(userIds);
|
||||
listUserResult.checkError();
|
||||
return UserConvert.INSTANCE.convertList(listUserResult.getData());
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class UserManager {
|
||||
* @return 用户分页结果
|
||||
*/
|
||||
public PageResult<UserRespVO> pageUser(UserPageReqVO pageVO) {
|
||||
CommonResult<PageResult<UserRespDTO>> pageUserResult = userRpc.pageUser(UserConvert.INSTANCE.convert(pageVO));
|
||||
CommonResult<PageResult<UserRespDTO>> pageUserResult = userFeign.pageUser(UserConvert.INSTANCE.convert(pageVO));
|
||||
pageUserResult.checkError();
|
||||
return UserConvert.INSTANCE.convertPage(pageUserResult.getData());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user