feat:ums的接口路径调整

This commit is contained in:
haoxr 2021-06-07 22:33:53 +08:00
parent 89a8f983fd
commit 3286f021f2
6 changed files with 17 additions and 12 deletions

View File

@ -35,7 +35,7 @@ public interface MemberFeignClient {
/**
* 扣减会员余额
*/
@PutMapping("/v1/members/{id}/deduct_balance")
@PutMapping("/v1/members/{id}/deduct-balance")
Result deductBalance(@PathVariable Long id, @RequestParam Long balance);

View File

@ -100,6 +100,11 @@
<artifactId>common-redis</artifactId>
</dependency>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-log</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1,4 +1,4 @@
package com.youlai.mall.ums.controller.v1;
package com.youlai.mall.ums.controller.admin;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -21,8 +21,8 @@ import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@Api(tags = "【系统管理】会员管理")
@RestController("V1-UserController")
@RequestMapping("/v1/users")
@RestController("AdminMemberController")
@RequestMapping("/api/v1/users")
@Slf4j
@AllArgsConstructor
public class MemberController {

View File

@ -1,4 +1,4 @@
package com.youlai.mall.ums.controller.v1;
package com.youlai.mall.ums.controller.admin;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
@ -25,8 +25,8 @@ import java.util.Map;
@Api(tags = "【系统管理】会员充值")
@RestController("V1-RechargeController")
@RequestMapping("/v1/recharge_orders")
@RestController("AdminRechargeController")
@RequestMapping("/api/v1/recharge-orders")
@Slf4j
public class RechargeController {

View File

@ -1,4 +1,4 @@
package com.youlai.mall.ums.controller.v2;
package com.youlai.mall.ums.controller.app;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@ -19,7 +19,7 @@ import java.util.List;
@Api(tags = "【移动端】会员地址")
@RestController
@RequestMapping("/v2/addresses")
@RequestMapping("/app-api/v1/addresses")
@Slf4j
@AllArgsConstructor
public class AddressController {

View File

@ -1,4 +1,4 @@
package com.youlai.mall.ums.controller.v2;
package com.youlai.mall.ums.controller.app;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "【移动端】会员服务")
@RestController
@RequestMapping("/v2/members")
@RequestMapping("/app-api/v1/members")
@Slf4j
@AllArgsConstructor
public class MemberController {
@ -102,7 +102,7 @@ public class MemberController {
@ApiImplicitParam(name = "id", value = "会员ID", required = true, paramType = "path", dataType = "Long"),
@ApiImplicitParam(name = "balance", value = "会员余额", required = true, paramType = "query", dataType = "Long")
})
@PutMapping("/{id}/deduct_balance")
@PutMapping("/{id}/deduct-balance")
public Result updateBalance(@PathVariable Long id, @RequestParam Long balance) {
boolean result = iUmsUserService.update(new LambdaUpdateWrapper<UmsMember>()
.setSql("balance = balance - " + balance)