init
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
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.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.PairSuccess;
|
||||
import com.ruoyi.xq.service.PairSuccessService;
|
||||
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-04-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xq/pairSuccess")
|
||||
public class PairSuccessController extends BaseController {
|
||||
|
||||
private final PairSuccessService pairSuccessService;
|
||||
|
||||
/**
|
||||
* 查询成功案例列表
|
||||
*/
|
||||
@SaCheckPermission("xq:pairSuccess:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PairSuccess> list(PairSuccess bo, PageQuery pageQuery) {
|
||||
Page<PairSuccess> page = pairSuccessService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成功案例详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xq:pairSuccess:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PairSuccess> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(pairSuccessService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成功案例
|
||||
*/
|
||||
@SaCheckPermission("xq:pairSuccess:add")
|
||||
@Log(title = "成功案例", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PairSuccess bo) {
|
||||
return toAjax(pairSuccessService.save(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成功案例
|
||||
*/
|
||||
@SaCheckPermission("xq:pairSuccess:edit")
|
||||
@Log(title = "成功案例", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PairSuccess bo) {
|
||||
return toAjax(pairSuccessService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成功案例
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xq:pairSuccess:remove")
|
||||
@Log(title = "成功案例", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(pairSuccessService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
47
ruoyi-xq/src/main/java/com/ruoyi/xq/domain/PairSuccess.java
Normal file
47
ruoyi-xq/src/main/java/com/ruoyi/xq/domain/PairSuccess.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.xq.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 成功案例对象 xq_pair_success
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("xq_pair_success")
|
||||
public class PairSuccess implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 配对成功
|
||||
*/
|
||||
private String picture;
|
||||
/**
|
||||
* 配对成功备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 1-启用 0-禁用
|
||||
*/
|
||||
private Integer enableStatus;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -52,11 +52,17 @@ public class UserStatus implements Serializable {
|
||||
* 是否允许交换手机号
|
||||
*/
|
||||
private Integer allowTransMobile;
|
||||
|
||||
/**
|
||||
* 是否允许交换微信
|
||||
*/
|
||||
private Integer allowTransWx;
|
||||
|
||||
/**
|
||||
* 是否VIP上榜
|
||||
*/
|
||||
private Integer pushVip;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class WxTransLogListVo {
|
||||
@Schema(description = "来源的头像")
|
||||
private String sourceImg;
|
||||
@Schema(description = "类型 1=消费 2-开通VIP赠送 3-购买 4-系统调账")
|
||||
private String cateId;
|
||||
private Integer cateId;
|
||||
@Schema(description = "标题分类")
|
||||
private String title;
|
||||
@Schema(description = "内容")
|
||||
|
||||
@@ -22,4 +22,7 @@ public class UserStatusUpdateAppReq {
|
||||
*/
|
||||
@Schema(description = "是否允许交换微信")
|
||||
private Integer allowTransWx;
|
||||
|
||||
@Schema(description = "是否VIP上榜")
|
||||
private Integer pushVip;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.xq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xq.domain.PairSuccess;
|
||||
|
||||
/**
|
||||
* 成功案例Mapper接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public interface PairSuccessMapper extends BaseMapper<PairSuccess> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.xq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.xq.domain.PairSuccess;
|
||||
|
||||
/**
|
||||
* 成功案例Service接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public interface PairSuccessService extends IService<PairSuccess> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.xq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.xq.domain.PairSuccess;
|
||||
import com.ruoyi.xq.mapper.PairSuccessMapper;
|
||||
import com.ruoyi.xq.service.PairSuccessService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 成功案例Service业务层处理
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PairSuccessServiceImpl extends ServiceImpl<PairSuccessMapper,PairSuccess> implements PairSuccessService {
|
||||
|
||||
}
|
||||
@@ -50,6 +50,13 @@ public class UserStatusServiceImpl extends ServiceImpl<UserStatusMapper,UserStat
|
||||
update.setId(userStatus.getId());
|
||||
update.setAllowTransMobile(req.getAllowTransMobile());
|
||||
update.setAllowTransWx(req.getAllowTransWx());
|
||||
if(req.getPushVip() != null && req.getPushVip() == 1){
|
||||
UserVip userVip = userVipService.getByUserVipMaster(req.getUserId());
|
||||
if(userVip == null){
|
||||
throw new ServiceException(ErrorEnum.VIP_AUTH.getText());
|
||||
}
|
||||
}
|
||||
update.setPushVip(req.getPushVip());
|
||||
this.updateById(update);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ public class WxTransLogServiceImpl extends ServiceImpl<WxTransLogMapper,WxTransL
|
||||
WxTransLogListVo res = new WxTransLogListVo();
|
||||
res.setUserId(record.getUserId());
|
||||
res.setUsercode(record.getUsercode());
|
||||
res.setCateId(record.getCateId());
|
||||
res.setTitle(record.getCateName());
|
||||
res.setContent(record.getRemark());
|
||||
res.setCreateTime(record.getCreateTime());
|
||||
|
||||
18
ruoyi-xq/src/main/resources/mapper/xq/PairSuccessMapper.xml
Normal file
18
ruoyi-xq/src/main/resources/mapper/xq/PairSuccessMapper.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xq.mapper.PairSuccessMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.xq.domain.PairSuccess" id="PairSuccessResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="picture" column="picture"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="enableStatus" column="enable_status"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user