init
This commit is contained in:
@@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.cai.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.cai.domain.CaiUserMember;
|
||||||
|
import com.ruoyi.cai.service.CaiUserMemberService;
|
||||||
|
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 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 2023-12-21
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cai/userMember")
|
||||||
|
public class CaiUserMemberController extends BaseController {
|
||||||
|
|
||||||
|
private final CaiUserMemberService userMemberService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userMember:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<CaiUserMember> list(CaiUserMember bo, PageQuery pageQuery) {
|
||||||
|
Page<CaiUserMember> page = userMemberService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||||
|
return TableDataInfo.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员管理详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userMember:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<CaiUserMember> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Integer id) {
|
||||||
|
return R.ok(userMemberService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userMember:add")
|
||||||
|
@Log(title = "会员管理", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody CaiUserMember bo) {
|
||||||
|
return toAjax(userMemberService.save(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userMember:edit")
|
||||||
|
@Log(title = "会员管理", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CaiUserMember bo) {
|
||||||
|
return toAjax(userMemberService.updateById(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员管理
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userMember:remove")
|
||||||
|
@Log(title = "会员管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Integer[] ids) {
|
||||||
|
return toAjax(userMemberService.removeBatchByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员管理对象 cai_user_member
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cai_user_member")
|
||||||
|
public class CaiUserMember implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Integer userId;
|
||||||
|
/**
|
||||||
|
* MID
|
||||||
|
*/
|
||||||
|
private Integer mid;
|
||||||
|
/**
|
||||||
|
* 类型 0 普通 1 超级
|
||||||
|
*/
|
||||||
|
private Integer memberType;
|
||||||
|
/**
|
||||||
|
* 过期时间
|
||||||
|
*/
|
||||||
|
private Integer expire;
|
||||||
|
/**
|
||||||
|
* 类型 0 打开 1 关闭
|
||||||
|
*/
|
||||||
|
private Integer rankHide;
|
||||||
|
/**
|
||||||
|
* 类型 0 打开 1 关闭
|
||||||
|
*/
|
||||||
|
private Integer noGreet;
|
||||||
|
/**
|
||||||
|
* 状态 0 可用 ,1 过期,2不可用
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 永久状态 0 不是 1是
|
||||||
|
*/
|
||||||
|
private Integer longs;
|
||||||
|
/**
|
||||||
|
* 过期时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime expireDate;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.cai.domain.CaiUserMember;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-21
|
||||||
|
*/
|
||||||
|
public interface CaiUserMemberMapper extends BaseMapper<CaiUserMember> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.cai.domain.CaiUserMember;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员管理Service接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-21
|
||||||
|
*/
|
||||||
|
public interface CaiUserMemberService extends IService<CaiUserMember> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.cai.domain.CaiUserMember;
|
||||||
|
import com.ruoyi.cai.mapper.CaiUserMemberMapper;
|
||||||
|
import com.ruoyi.cai.service.CaiUserMemberService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CaiUserMemberServiceImpl extends ServiceImpl<CaiUserMemberMapper,CaiUserMember> implements CaiUserMemberService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?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.cai.mapper.CaiUserMemberMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.cai.domain.CaiUserMember" id="CaiUserMemberResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="mid" column="mid"/>
|
||||||
|
<result property="memberType" column="member_type"/>
|
||||||
|
<result property="expire" column="expire"/>
|
||||||
|
<result property="rankHide" column="rank_hide"/>
|
||||||
|
<result property="noGreet" column="no_greet"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="longs" column="longs"/>
|
||||||
|
<result property="expireDate" column="expire_date"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user