管理端店铺用户相关接口
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.shopuser.ShopUserEditDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserSummaryDTO;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 店铺用户管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopUser")
|
||||
public class ShopUserController {
|
||||
|
||||
@Resource
|
||||
private ShopUserService shopUserService;
|
||||
|
||||
/**
|
||||
* 获取店铺用户概述信息
|
||||
* @param isVip 0 非vip 1 vip
|
||||
* @return 概述信息
|
||||
*/
|
||||
@SaAdminCheckPermission("shopUser:summary")
|
||||
@GetMapping("/summary")
|
||||
public CzgResult<ShopUserSummaryDTO> summary(Integer isVip) {
|
||||
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getShopId(), isVip));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺用户列表
|
||||
* @param key 昵称或手机号
|
||||
* @param isVip 0 非vip 1 vip
|
||||
* @return 用户列表
|
||||
*/
|
||||
@SaAdminCheckPermission("shopUser:list")
|
||||
@GetMapping
|
||||
public CzgResult<Page<ShopUser>> list(String key, Integer isVip) {
|
||||
return CzgResult.success(shopUserService.getPage(key, isVip));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺用户信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopUser:edit")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopUserEditDTO shopUserEditDTO) {
|
||||
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getShopId(), shopUserEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺用户余额修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopUser:editFlow")
|
||||
@PutMapping("/money")
|
||||
public CzgResult<Boolean> editMoney(@RequestBody @Validated ShopUserMoneyEditDTO shopUserMoneyEditDTO) {
|
||||
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getShopId(), shopUserMoneyEditDTO));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user