init
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
package com.ruoyi.xq.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.WxTransData;
|
||||
import com.ruoyi.xq.service.WxTransDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 微信交换数据
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xq/wxTransData")
|
||||
public class WxTransDataController extends BaseController {
|
||||
|
||||
private final WxTransDataService wxTransDataService;
|
||||
|
||||
/**
|
||||
* 查询微信交换数据列表
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransData:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WxTransData> list(WxTransData bo, PageQuery pageQuery) {
|
||||
Page<WxTransData> page = wxTransDataService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信交换数据详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransData:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<WxTransData> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(wxTransDataService.getById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改微信交换数据
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransData:edit")
|
||||
@Log(title = "微信交换数据", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WxTransData bo) {
|
||||
return toAjax(wxTransDataService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信交换数据
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransData:remove")
|
||||
@Log(title = "微信交换数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(wxTransDataService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.xq.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.WxTransLog;
|
||||
import com.ruoyi.xq.service.WxTransLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 微信交换记录
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xq/wxTransLog")
|
||||
public class WxTransLogController extends BaseController {
|
||||
|
||||
private final WxTransLogService wxTransLogService;
|
||||
|
||||
/**
|
||||
* 查询微信交换记录列表
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WxTransLog> list(WxTransLog bo, PageQuery pageQuery) {
|
||||
Page<WxTransLog> page = wxTransLogService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信交换记录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransLog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<WxTransLog> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(wxTransLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信交换记录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xq:wxTransLog:remove")
|
||||
@Log(title = "微信交换记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(wxTransLogService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
@@ -9,16 +9,13 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.xq.domain.UserExtend;
|
||||
import com.ruoyi.xq.domain.WxTransOrder;
|
||||
import com.ruoyi.xq.dto.app.account.AccountDetailVo;
|
||||
import com.ruoyi.xq.dto.app.account.AccountInfoVO;
|
||||
import com.ruoyi.xq.dto.app.account.*;
|
||||
import com.ruoyi.xq.dto.app.pay.OrderCreateVo;
|
||||
import com.ruoyi.xq.dto.app.wxtrans.GenWxTransOrderReq;
|
||||
import com.ruoyi.xq.dto.app.wxtrans.WxTransPriceAppVo;
|
||||
import com.ruoyi.xq.enums.common.SystemConfigEnum;
|
||||
import com.ruoyi.xq.manager.SystemConfigManager;
|
||||
import com.ruoyi.xq.service.AccountChangeLogService;
|
||||
import com.ruoyi.xq.service.UserExtendService;
|
||||
import com.ruoyi.xq.service.WxTransOrderService;
|
||||
import com.ruoyi.xq.service.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -38,6 +35,10 @@ public class AccountAppController {
|
||||
private WxTransOrderService wxTransOrderService;
|
||||
@Autowired
|
||||
private SystemConfigManager systemConfigManager;
|
||||
@Autowired
|
||||
private WxTransDataService wxTransDataService;
|
||||
@Autowired
|
||||
private WxTransLogService wxTransLogService;
|
||||
|
||||
@GetMapping("/info")
|
||||
@Operation(summary = "当前用户信息的账户余额情况")
|
||||
@@ -74,7 +75,7 @@ public class AccountAppController {
|
||||
@Log(title = "生成微信交换订单", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<OrderCreateVo> createWxTransOrder(@RequestBody GenWxTransOrderReq req){
|
||||
Long userId = LoginHelper.getUserId();
|
||||
WxTransOrder vipOrder = wxTransOrderService.createVipOrder(userId, req.getWxTransNum());
|
||||
WxTransOrder vipOrder = wxTransOrderService.createWxTransOrder(userId, req.getWxTransNum());
|
||||
OrderCreateVo result = new OrderCreateVo();
|
||||
result.setPrice(vipOrder.getWxPrice());
|
||||
result.setOrderNo(vipOrder.getOrderNo());
|
||||
@@ -82,5 +83,32 @@ public class AccountAppController {
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@PostMapping("/wxTrans/star")
|
||||
@Operation(summary = "发起交换微信")
|
||||
@Log(title = "发起交换微信", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<Void> starWxTrans(@RequestBody StarWxTransReq starWxTransReq){
|
||||
starWxTransReq.setSponsorUserId(LoginHelper.getUserId());
|
||||
wxTransDataService.start(starWxTransReq);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/wxTrans/data/page")
|
||||
@Operation(summary = "查询交换微信数据")
|
||||
@Log(title = "发起交换微信", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<PageModel<WxTransDataListAppVo>> wxTransDataPage(PageQuery pageQuery, WxTransDataQuery wxTransDataQuery){
|
||||
wxTransDataQuery.setUserId(LoginHelper.getUserId());
|
||||
Page<WxTransDataListAppVo> page = wxTransDataService.pageApp(pageQuery, wxTransDataQuery);
|
||||
return R.ok(PageModel.build(page));
|
||||
}
|
||||
|
||||
@GetMapping("/wxTrans/log/page")
|
||||
@Operation(summary = "查询交换微信账户明细")
|
||||
@Log(title = "查询交换微信账户明细", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<PageModel<WxTransLogListVo>> wxTransLogPage(PageQuery pageQuery, WxTransLogQuery query){
|
||||
query.setUserId(LoginHelper.getUserId());
|
||||
Page<WxTransLogListVo> page = wxTransLogService.pageApp(pageQuery, query);
|
||||
return R.ok(PageModel.build(page));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user