超v管理
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.peanut.modules.common.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.UserVip;
|
||||
import com.peanut.modules.common.service.UserVipService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 超V管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController("commonUserVip")
|
||||
@RequestMapping("common/userVip")
|
||||
public class UserVipController {
|
||||
|
||||
@Autowired
|
||||
private UserVipService vipService;
|
||||
|
||||
@RequestMapping("/getMyVipHistory")
|
||||
public R getMyVipHistory(String userId) {
|
||||
LambdaQueryWrapper<UserVip> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(UserVip::getUserId,userId);
|
||||
wrapper.orderByAsc(UserVip::getState);
|
||||
wrapper.orderByAsc(UserVip::getEndTime);
|
||||
List<UserVip> userVips = vipService.list(wrapper);
|
||||
return R.ok().put("result", userVips);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.peanut.modules.common.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.common.entity.UserVip;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UserVipDao extends BaseMapper<UserVip> {
|
||||
}
|
||||
@@ -72,6 +72,10 @@ public class MyUserEntity implements Serializable {
|
||||
* 花生币
|
||||
*/
|
||||
private BigDecimal peanutCoin;
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
private BigDecimal jf;
|
||||
/**
|
||||
* 阅读时间
|
||||
*/
|
||||
|
||||
52
src/main/java/com/peanut/modules/common/entity/UserVip.java
Normal file
52
src/main/java/com/peanut/modules/common/entity/UserVip.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.peanut.modules.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("user_vip")
|
||||
public class UserVip implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增 ID
|
||||
*/
|
||||
@TableId
|
||||
private int id;
|
||||
/**
|
||||
* 会员 ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 1超v2简易超v
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 失效时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 0有效1失效
|
||||
*/
|
||||
private Integer state;
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private MyUserEntity user;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.peanut.modules.common.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.UserVip;
|
||||
|
||||
public interface UserVipService extends IService<UserVip> {
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("myUserService")
|
||||
@Service("commonMyUserService")
|
||||
public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> implements MyUserService {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.peanut.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.modules.common.dao.UserVipDao;
|
||||
import com.peanut.modules.common.entity.UserVip;
|
||||
import com.peanut.modules.common.service.UserVipService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service("commonUserVipService")
|
||||
public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> implements UserVipService {
|
||||
}
|
||||
Reference in New Issue
Block a user