init
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
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.UserStatus;
|
||||
import com.ruoyi.xq.service.UserStatusService;
|
||||
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-28
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xq/userStatus")
|
||||
public class UserStatusController extends BaseController {
|
||||
|
||||
private final UserStatusService userStatusService;
|
||||
|
||||
/**
|
||||
* 查询用户状态列表
|
||||
*/
|
||||
@SaCheckPermission("xq:userStatus:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<UserStatus> list(UserStatus bo, PageQuery pageQuery) {
|
||||
Page<UserStatus> page = userStatusService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户状态详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xq:userStatus:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<UserStatus> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(userStatusService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
@SaCheckPermission("xq:userStatus:edit")
|
||||
@Log(title = "用户状态", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody UserStatus bo) {
|
||||
return toAjax(userStatusService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户状态
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xq:userStatus:remove")
|
||||
@Log(title = "用户状态", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(userStatusService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
59
ruoyi-xq/src/main/java/com/ruoyi/xq/domain/UserStatus.java
Normal file
59
ruoyi-xq/src/main/java/com/ruoyi/xq/domain/UserStatus.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.ruoyi.xq.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户状态对象 xq_user_status
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xq_user_status")
|
||||
public class UserStatus extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户号
|
||||
*/
|
||||
private String usercode;
|
||||
/**
|
||||
* 征婚状态 1-寻找中 2-已脱单 3-隐藏资料
|
||||
*/
|
||||
private Integer personalsStatus;
|
||||
/**
|
||||
* 谁可查看头像 1-所有用户 2-VIP用户 3-实名用户 4-实名认证且VIP用户 5-不公开
|
||||
*/
|
||||
private Integer showAvatar;
|
||||
/**
|
||||
* 谁可查看资料 1-所有用户 2-VIP用户 3-实名用户 4-实名认证且VIP用户
|
||||
*/
|
||||
private Integer showInfo;
|
||||
/**
|
||||
* 是否允许交换手机号
|
||||
*/
|
||||
private Integer allowTransMobile;
|
||||
/**
|
||||
* 是否允许交换微信
|
||||
*/
|
||||
private Integer allowTransWx;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.xq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xq.domain.UserStatus;
|
||||
|
||||
/**
|
||||
* 用户状态Mapper接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public interface UserStatusMapper extends BaseMapper<UserStatus> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.xq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.xq.domain.UserStatus;
|
||||
|
||||
/**
|
||||
* 用户状态Service接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public interface UserStatusService extends IService<UserStatus> {
|
||||
|
||||
}
|
||||
@@ -46,6 +46,7 @@ public class AccountChangeLogServiceImpl extends ServiceImpl<AccountChangeLogMap
|
||||
@Override
|
||||
public void saveLogNoAdminOfConsumer(User user, AccountChangeCodeEnum accountChangeCodeEnum, BigDecimal price, String traceId, Long tarUserId) {
|
||||
AccountChangeLog accountChangeLog = new AccountChangeLog();
|
||||
|
||||
accountChangeLog.setUserId(user.getId());
|
||||
accountChangeLog.setUsercode(user.getUsercode());
|
||||
accountChangeLog.setTarUserId(tarUserId);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.xq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.xq.domain.UserStatus;
|
||||
import com.ruoyi.xq.mapper.UserStatusMapper;
|
||||
import com.ruoyi.xq.service.UserStatusService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 用户状态Service业务层处理
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@Service
|
||||
public class UserStatusServiceImpl extends ServiceImpl<UserStatusMapper,UserStatus> implements UserStatusService {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
t1.nickname,t1.type,t1.mobile,t1.avatar,t1.gender,t1.age,t1.birthday,
|
||||
t1.height,t1.weight,t1.somatotype,t1.zodiac,t1.sign,t1.residence_name,t1.address_name,t1.residence_city_name,
|
||||
t1.education,t1.marriage,t1.profession,t1.annual_income,t1.company_nature,t1.for_personals,
|
||||
t1.remark,t1.status,t1.finish_base_status
|
||||
t1.remark,t1.status,t1.finish_base_status11
|
||||
from xq_user t1
|
||||
join xq_user_info t2 on t1.id = t2.user_id
|
||||
<where>
|
||||
|
||||
21
ruoyi-xq/src/main/resources/mapper/xq/UserStatusMapper.xml
Normal file
21
ruoyi-xq/src/main/resources/mapper/xq/UserStatusMapper.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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.UserStatusMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.xq.domain.UserStatus" id="UserStatusResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="usercode" column="usercode"/>
|
||||
<result property="personalsStatus" column="personals_status"/>
|
||||
<result property="showAvatar" column="show_avatar"/>
|
||||
<result property="showInfo" column="show_info"/>
|
||||
<result property="allowTransMobile" column="allow_trans_mobile"/>
|
||||
<result property="allowTransWx" column="allow_trans_wx"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
<select id="pageApp" resultType="com.ruoyi.xq.dto.app.uservisitor.vo.UserVisitorListVo">
|
||||
select t2.id as user_id, t2.avatar, t2.gender, t2.nickname, t2.birthday, t2.residence_city,
|
||||
select t2.id as user_id, t2.avatar, t2.gender, t2.nickname, t2.birthday, t2.residence_city_name,
|
||||
t2.education, t2.profession, t1.visitor_num
|
||||
from xq_user_visitor t1
|
||||
join xq_user t2 on t1.user_id = t2.id
|
||||
|
||||
Reference in New Issue
Block a user