微信客户端初步完成, 当前版本后台充值还是1分
This commit is contained in:
parent
9b73dcf9d9
commit
685afc44df
@ -1,113 +0,0 @@
|
||||
package com.ruoyi.web.controller.app.pay;
|
||||
|
||||
|
||||
import com.jeequan.jeepay.JeepayClient;
|
||||
import com.jeequan.jeepay.response.PayOrderCreateResponse;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysSource;
|
||||
import com.ruoyi.system.domain.UserWork;
|
||||
import com.ruoyi.system.domain.dto.PublishUserWorkDto;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import com.ruoyi.system.domain.vo.PayResponseVo;
|
||||
import com.ruoyi.system.service.ISysSourceService;
|
||||
import com.ruoyi.system.service.IUserWorkService;
|
||||
import com.ruoyi.web.controller.app.baidu.GsonUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.jeequan.jeepay.model.PayOrderCreateReqModel;
|
||||
import com.jeequan.jeepay.request.PayOrderCreateRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
//@RestController
|
||||
//@RequestMapping("/pay")
|
||||
public class PayController extends BaseController {
|
||||
public static final String APPKEY = "";
|
||||
public static String APPID = "";
|
||||
public static String MCHNO = "";
|
||||
|
||||
@Autowired
|
||||
private IUserWorkService userWorkService;
|
||||
|
||||
@Autowired
|
||||
ISysSourceService sysSourceService;
|
||||
|
||||
@Autowired
|
||||
private static RedisCache redisCache;
|
||||
|
||||
public static boolean genOrder(List<PublishUserWorkDto> publishUserWorkDtoList,Long userId ,Long price){
|
||||
|
||||
String mchOrderNo = "M" + UUID.randomUUID().toString().replaceAll("-", "");
|
||||
redisCache.setCacheObject(mchOrderNo, userId + "_" + 0, 1, TimeUnit.DAYS);
|
||||
// log.info("缓存订单和用户关系: mchOrderNo=" + mchOrderNo + ", userId=" + userId);
|
||||
// 支付方式
|
||||
String wayCode = "QR_CASHIER";
|
||||
|
||||
Byte divisionMode = 0;
|
||||
|
||||
// 前端明确了支付参数的类型 payDataType
|
||||
String payDataType = "codeImgUrl";
|
||||
String authCode = "payurl";
|
||||
|
||||
PayOrderCreateRequest request = new PayOrderCreateRequest();
|
||||
PayOrderCreateReqModel model = new PayOrderCreateReqModel();
|
||||
request.setBizModel(model);
|
||||
|
||||
|
||||
model.setMchNo(MCHNO); // 商户号
|
||||
model.setAppId(APPID);
|
||||
model.setMchOrderNo(mchOrderNo);
|
||||
model.setWayCode(wayCode);
|
||||
model.setAmount(price);
|
||||
model.setReturnUrl("http://");
|
||||
// paypal通道使用USD类型货币
|
||||
model.setCurrency("CNY");
|
||||
model.setClientIp("127.0.0.1");
|
||||
model.setSubject("" + MCHNO + "");
|
||||
model.setBody("正常订单" + "[" + MCHNO + "]");
|
||||
|
||||
model.setNotifyUrl("http://62.234.19.34:8991/wxPay/result/wxRechargeCallback/"); //回调地址
|
||||
model.setReturnUrl("");
|
||||
model.setDivisionMode(divisionMode); //分账模式
|
||||
|
||||
//设置扩展参数
|
||||
JSONObject extParams = new JSONObject();
|
||||
if (StringUtils.isNotEmpty(payDataType)) {
|
||||
extParams.put("payDataType", payDataType.trim());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(authCode)) {
|
||||
extParams.put("authCode", authCode.trim());
|
||||
}
|
||||
model.setChannelExtra(extParams.toString());
|
||||
|
||||
JeepayClient jeepayClient = new JeepayClient("http://payment.pay.oetsoft.com",
|
||||
APPKEY);
|
||||
|
||||
// PayOrderCreateResponse payOrderCreateResponse = jeepayClient.execute(request);
|
||||
// System.out.println(payOrderCreateResponse.toString());
|
||||
// PayResponseVo payResponseVo = JSONObject.parseObject(payOrderCreateResponse.toString(), PayResponseVo.class);
|
||||
// String url = payResponseVo.getData().getPayData();
|
||||
// //设置Access-Control-Expose-Headers避免前端调用获取Content-Disposition出现Refused to get unsafe header异常
|
||||
|
||||
// response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
// response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("img.jpg", "UTF-8"));
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// @PostMapping("/WechatPay")
|
||||
// public AjaxResult WechatPay(@RequestBody List<PayDto> payDtoList){
|
||||
// return null;
|
||||
//
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
package com.ruoyi.web.controller.app.pay;
|
||||
|
||||
|
||||
import com.jeequan.jeepay.JeepayClient;
|
||||
import com.jeequan.jeepay.response.PayOrderCreateResponse;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysSource;
|
||||
import com.ruoyi.system.domain.UserWork;
|
||||
import com.ruoyi.system.domain.dto.PublishUserWorkDto;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import com.ruoyi.system.domain.vo.PayResponseVo;
|
||||
import com.ruoyi.system.service.ISysSourceService;
|
||||
import com.ruoyi.system.service.IUserWorkService;
|
||||
import com.ruoyi.web.controller.app.baidu.GsonUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.jeequan.jeepay.model.PayOrderCreateReqModel;
|
||||
import com.jeequan.jeepay.request.PayOrderCreateRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PayService {
|
||||
public static final String APPKEY = "";
|
||||
public static String APPID = "";
|
||||
public static String MCHNO = "";
|
||||
|
||||
@Autowired
|
||||
private IUserWorkService userWorkService;
|
||||
|
||||
@Autowired
|
||||
private ISysSourceService sysSourceService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
|
||||
|
||||
public boolean genOrder(List<Long> orderIdList, Long Price, Long userId) {
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
// 订单号, 自己生成,用来标识这一次支付.
|
||||
String mchOrderNo = "M" + UUID.randomUUID().toString().replaceAll("-", "");
|
||||
|
||||
// 将订单号以字符串拼接
|
||||
String result = orderIdList.stream()
|
||||
.map(Object::toString)
|
||||
.collect(Collectors.joining("_"));
|
||||
|
||||
System.out.println("订单id: "+result);
|
||||
|
||||
// 缓存订单和用户关系,
|
||||
// 这里值应该是 orderIdList + Price + userId
|
||||
System.out.println("userId"+userId);
|
||||
System.out.println("mchOrderNo: " + mchOrderNo);
|
||||
System.out.println(redisCache);
|
||||
System.out.println("result: "+result);
|
||||
|
||||
redisCache.setCacheObject(mchOrderNo, userId.toString() + "_" + result, 1, TimeUnit.DAYS);
|
||||
System.out.println(redisCache.getCacheObject(mchOrderNo).toString());
|
||||
// log.info("缓存订单和用户关系: mchOrderNo=" + mchOrderNo + ", userId=" + userId);
|
||||
|
||||
|
||||
// //---------------------------------------------------测试环境 先注释掉--------------------------------------------------------
|
||||
// // 支付方式
|
||||
// String wayCode = "QR_CASHIER";
|
||||
//
|
||||
// Byte divisionMode = 0;
|
||||
//
|
||||
// // 前端明确了支付参数的类型 payDataType
|
||||
// String payDataType = "codeImgUrl";
|
||||
// String authCode = "payurl";
|
||||
//
|
||||
// PayOrderCreateRequest request = new PayOrderCreateRequest();
|
||||
// PayOrderCreateReqModel model = new PayOrderCreateReqModel();
|
||||
// request.setBizModel(model);
|
||||
//
|
||||
//
|
||||
// model.setMchNo(MCHNO); // 商户号
|
||||
// model.setAppId(APPID);
|
||||
// model.setMchOrderNo(mchOrderNo);
|
||||
// model.setWayCode(wayCode);
|
||||
// model.setAmount(Price);
|
||||
// model.setReturnUrl("http://");
|
||||
// // paypal通道使用USD类型货币
|
||||
// model.setCurrency("CNY");
|
||||
// model.setClientIp("127.0.0.1");
|
||||
// model.setSubject("" + MCHNO + "");
|
||||
// model.setBody("正常订单" + "[" + MCHNO + "]");
|
||||
//
|
||||
// // 支付回调地址
|
||||
// model.setNotifyUrl("http://62.234.19.34:8991/wxPay/result/wxRechargeCallback/"+result); //回调地址
|
||||
// model.setReturnUrl("");
|
||||
// model.setDivisionMode(divisionMode); //分账模式
|
||||
//
|
||||
// //设置扩展参数
|
||||
// JSONObject extParams = new JSONObject();
|
||||
// if (StringUtils.isNotEmpty(payDataType)) {
|
||||
// extParams.put("payDataType", payDataType.trim());
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(authCode)) {
|
||||
// extParams.put("authCode", authCode.trim());
|
||||
// }
|
||||
// model.setChannelExtra(extParams.toString());
|
||||
//
|
||||
// JeepayClient jeepayClient = new JeepayClient("http://payment.pay.oetsoft.com",
|
||||
// APPKEY);
|
||||
//
|
||||
// PayOrderCreateResponse payOrderCreateResponse = jeepayClient.execute(request);
|
||||
// System.out.println(payOrderCreateResponse.toString());
|
||||
// PayResponseVo payResponseVo = JSONObject.parseObject(payOrderCreateResponse.toString(), PayResponseVo.class);
|
||||
// String url = payResponseVo.getData().getPayData();
|
||||
//
|
||||
// //-------------------------------------------------测试环境先注释掉-----------------------------------------------------------
|
||||
|
||||
// //设置Access-Control-Expose-Headers避免前端调用获取Content-Disposition出现Refused to get unsafe header异常
|
||||
//
|
||||
// response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
// response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("img.jpg", "UTF-8"));
|
||||
|
||||
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
System.out.println(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// @PostMapping("/WechatPay")
|
||||
// public AjaxResult WechatPay(@RequestBody List<PayDto> payDtoList){
|
||||
// return null;
|
||||
//
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.DailySource;
|
||||
import com.ruoyi.system.service.IDailySourceService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 资源位每天统计Controller
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/source")
|
||||
public class DailySourceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDailySourceService dailySourceService;
|
||||
|
||||
/**
|
||||
* 查询资源位每天统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:source:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DailySource dailySource)
|
||||
{
|
||||
startPage();
|
||||
List<DailySource> list = dailySourceService.selectDailySourceList(dailySource);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资源位每天统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:source:export')")
|
||||
@Log(title = "资源位每天统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DailySource dailySource)
|
||||
{
|
||||
List<DailySource> list = dailySourceService.selectDailySourceList(dailySource);
|
||||
ExcelUtil<DailySource> util = new ExcelUtil<DailySource>(DailySource.class);
|
||||
util.exportExcel(response, list, "资源位每天统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源位每天统计详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:source:query')")
|
||||
@GetMapping(value = "/{dailySourceId}")
|
||||
public AjaxResult getInfo(@PathVariable("dailySourceId") Long dailySourceId)
|
||||
{
|
||||
return success(dailySourceService.selectDailySourceByDailySourceId(dailySourceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资源位每天统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:source:add')")
|
||||
@Log(title = "资源位每天统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DailySource dailySource)
|
||||
{
|
||||
return toAjax(dailySourceService.insertDailySource(dailySource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资源位每天统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:source:edit')")
|
||||
@Log(title = "资源位每天统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DailySource dailySource)
|
||||
{
|
||||
return toAjax(dailySourceService.updateDailySource(dailySource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源位每天统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:source:remove')")
|
||||
@Log(title = "资源位每天统计", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dailySourceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dailySourceIds)
|
||||
{
|
||||
return toAjax(dailySourceService.deleteDailySourceByDailySourceIds(dailySourceIds));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysUserFollow;
|
||||
import com.ruoyi.system.service.ISysUserFollowService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户关注Controller
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/follow")
|
||||
public class SysUserFollowController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysUserFollowService sysUserFollowService;
|
||||
|
||||
/**
|
||||
* 查询用户关注列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:follow:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUserFollow sysUserFollow)
|
||||
{
|
||||
startPage();
|
||||
List<SysUserFollow> list = sysUserFollowService.selectSysUserFollowList(sysUserFollow);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户关注列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:follow:export')")
|
||||
@Log(title = "用户关注", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUserFollow sysUserFollow)
|
||||
{
|
||||
List<SysUserFollow> list = sysUserFollowService.selectSysUserFollowList(sysUserFollow);
|
||||
ExcelUtil<SysUserFollow> util = new ExcelUtil<SysUserFollow>(SysUserFollow.class);
|
||||
util.exportExcel(response, list, "用户关注数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户关注详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:follow:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysUserFollowService.selectSysUserFollowById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户关注
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:follow:add')")
|
||||
@Log(title = "用户关注", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysUserFollow sysUserFollow)
|
||||
{
|
||||
return toAjax(sysUserFollowService.insertSysUserFollow(sysUserFollow));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户关注
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:follow:edit')")
|
||||
@Log(title = "用户关注", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysUserFollow sysUserFollow)
|
||||
{
|
||||
return toAjax(sysUserFollowService.updateSysUserFollow(sysUserFollow));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户关注
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:follow:remove')")
|
||||
@Log(title = "用户关注", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysUserFollowService.deleteSysUserFollowByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysUserLike;
|
||||
import com.ruoyi.system.service.ISysUserLikeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户点赞Controller
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/like")
|
||||
public class SysUserLikeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysUserLikeService sysUserLikeService;
|
||||
|
||||
/**
|
||||
* 查询用户点赞列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:like:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUserLike sysUserLike)
|
||||
{
|
||||
startPage();
|
||||
List<SysUserLike> list = sysUserLikeService.selectSysUserLikeList(sysUserLike);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户点赞列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:like:export')")
|
||||
@Log(title = "用户点赞", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUserLike sysUserLike)
|
||||
{
|
||||
List<SysUserLike> list = sysUserLikeService.selectSysUserLikeList(sysUserLike);
|
||||
ExcelUtil<SysUserLike> util = new ExcelUtil<SysUserLike>(SysUserLike.class);
|
||||
util.exportExcel(response, list, "用户点赞数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户点赞详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:like:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysUserLikeService.selectSysUserLikeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户点赞
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:like:add')")
|
||||
@Log(title = "用户点赞", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysUserLike sysUserLike)
|
||||
{
|
||||
return toAjax(sysUserLikeService.insertSysUserLike(sysUserLike));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户点赞
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:like:edit')")
|
||||
@Log(title = "用户点赞", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysUserLike sysUserLike)
|
||||
{
|
||||
return toAjax(sysUserLikeService.updateSysUserLike(sysUserLike));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户点赞
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:like:remove')")
|
||||
@Log(title = "用户点赞", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysUserLikeService.deleteSysUserLikeByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysUserNotification;
|
||||
import com.ruoyi.system.service.ISysUserNotificationService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户消息通知Controller
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/notification")
|
||||
public class SysUserNotificationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysUserNotificationService sysUserNotificationService;
|
||||
|
||||
/**
|
||||
* 查询用户消息通知列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notification:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUserNotification sysUserNotification)
|
||||
{
|
||||
startPage();
|
||||
List<SysUserNotification> list = sysUserNotificationService.selectSysUserNotificationList(sysUserNotification);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户消息通知列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notification:export')")
|
||||
@Log(title = "用户消息通知", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUserNotification sysUserNotification)
|
||||
{
|
||||
List<SysUserNotification> list = sysUserNotificationService.selectSysUserNotificationList(sysUserNotification);
|
||||
ExcelUtil<SysUserNotification> util = new ExcelUtil<SysUserNotification>(SysUserNotification.class);
|
||||
util.exportExcel(response, list, "用户消息通知数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户消息通知详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notification:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysUserNotificationService.selectSysUserNotificationById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户消息通知
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notification:add')")
|
||||
@Log(title = "用户消息通知", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysUserNotification sysUserNotification)
|
||||
{
|
||||
return toAjax(sysUserNotificationService.insertSysUserNotification(sysUserNotification));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户消息通知
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notification:edit')")
|
||||
@Log(title = "用户消息通知", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysUserNotification sysUserNotification)
|
||||
{
|
||||
return toAjax(sysUserNotificationService.updateSysUserNotification(sysUserNotification));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户消息通知
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notification:remove')")
|
||||
@Log(title = "用户消息通知", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysUserNotificationService.deleteSysUserNotificationByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 资源位每天统计对象 daily_source
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
public class DailySource extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键自增 */
|
||||
private Long dailySourceId;
|
||||
|
||||
/** 资源位id */
|
||||
@Excel(name = "资源位id")
|
||||
private Long sourceId;
|
||||
|
||||
/** 用户MR在线时长 */
|
||||
@Excel(name = "用户MR在线时长")
|
||||
private Long uMrTime;
|
||||
|
||||
/** 被购买总数 */
|
||||
@Excel(name = "被购买总数")
|
||||
private Long bought;
|
||||
|
||||
/** 互动次数 */
|
||||
@Excel(name = "互动次数")
|
||||
private Long interactions;
|
||||
|
||||
/** 分享次数 */
|
||||
@Excel(name = "分享次数")
|
||||
private Long shares;
|
||||
|
||||
/** 每天时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "每天时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date date;
|
||||
|
||||
public void setDailySourceId(Long dailySourceId)
|
||||
{
|
||||
this.dailySourceId = dailySourceId;
|
||||
}
|
||||
|
||||
public Long getDailySourceId()
|
||||
{
|
||||
return dailySourceId;
|
||||
}
|
||||
public void setSourceId(Long sourceId)
|
||||
{
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public Long getSourceId()
|
||||
{
|
||||
return sourceId;
|
||||
}
|
||||
public void setuMrTime(Long uMrTime)
|
||||
{
|
||||
this.uMrTime = uMrTime;
|
||||
}
|
||||
|
||||
public Long getuMrTime()
|
||||
{
|
||||
return uMrTime;
|
||||
}
|
||||
public void setBought(Long bought)
|
||||
{
|
||||
this.bought = bought;
|
||||
}
|
||||
|
||||
public Long getBought()
|
||||
{
|
||||
return bought;
|
||||
}
|
||||
public void setInteractions(Long interactions)
|
||||
{
|
||||
this.interactions = interactions;
|
||||
}
|
||||
|
||||
public Long getInteractions()
|
||||
{
|
||||
return interactions;
|
||||
}
|
||||
public void setShares(Long shares)
|
||||
{
|
||||
this.shares = shares;
|
||||
}
|
||||
|
||||
public Long getShares()
|
||||
{
|
||||
return shares;
|
||||
}
|
||||
public void setDate(Date date)
|
||||
{
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public Date getDate()
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dailySourceId", getDailySourceId())
|
||||
.append("sourceId", getSourceId())
|
||||
.append("uMrTime", getuMrTime())
|
||||
.append("bought", getBought())
|
||||
.append("interactions", getInteractions())
|
||||
.append("shares", getShares())
|
||||
.append("date", getDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户关注对象 sys_user_follow
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
public class SysUserFollow extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 关注人用户ID */
|
||||
@Excel(name = "关注人用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 被关注人用户ID */
|
||||
@Excel(name = "被关注人用户ID")
|
||||
private Long followedUserId;
|
||||
|
||||
/** 状态(0正常 */
|
||||
@Excel(name = "状态", readConverterExp = "状态(0正常")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setFollowedUserId(Long followedUserId)
|
||||
{
|
||||
this.followedUserId = followedUserId;
|
||||
}
|
||||
|
||||
public Long getFollowedUserId()
|
||||
{
|
||||
return followedUserId;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("followedUserId", getFollowedUserId())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户点赞对象 sys_user_like
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
public class SysUserLike extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 点赞人用户ID */
|
||||
@Excel(name = "点赞人用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 被点赞的目标ID */
|
||||
@Excel(name = "被点赞的目标ID")
|
||||
private Long targetId;
|
||||
|
||||
/** 点赞类型(1帖子 */
|
||||
@Excel(name = "点赞类型", readConverterExp = "点赞类型(1帖子")
|
||||
private String targetType;
|
||||
|
||||
/** 状态(0正常 */
|
||||
@Excel(name = "状态", readConverterExp = "状态(0正常")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setTargetId(Long targetId)
|
||||
{
|
||||
this.targetId = targetId;
|
||||
}
|
||||
|
||||
public Long getTargetId()
|
||||
{
|
||||
return targetId;
|
||||
}
|
||||
public void setTargetType(String targetType)
|
||||
{
|
||||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
public String getTargetType()
|
||||
{
|
||||
return targetType;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("targetId", getTargetId())
|
||||
.append("targetType", getTargetType())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户消息通知对象 sys_user_notification
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
public class SysUserNotification extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 接收消息的用户ID */
|
||||
@Excel(name = "接收消息的用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 发送消息的用户ID */
|
||||
@Excel(name = "发送消息的用户ID")
|
||||
private Long senderId;
|
||||
|
||||
/** 消息类型(1关注 */
|
||||
@Excel(name = "消息类型", readConverterExp = "消息类型(1关注")
|
||||
private String type;
|
||||
|
||||
/** 相关目标ID */
|
||||
@Excel(name = "相关目标ID")
|
||||
private Long targetId;
|
||||
|
||||
/** 目标类型(1帖子 */
|
||||
@Excel(name = "目标类型", readConverterExp = "目标类型(1帖子")
|
||||
private String targetType;
|
||||
|
||||
/** 状态(0未读 */
|
||||
@Excel(name = "状态", readConverterExp = "状态(0未读")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setSenderId(Long senderId)
|
||||
{
|
||||
this.senderId = senderId;
|
||||
}
|
||||
|
||||
public Long getSenderId()
|
||||
{
|
||||
return senderId;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setTargetId(Long targetId)
|
||||
{
|
||||
this.targetId = targetId;
|
||||
}
|
||||
|
||||
public Long getTargetId()
|
||||
{
|
||||
return targetId;
|
||||
}
|
||||
public void setTargetType(String targetType)
|
||||
{
|
||||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
public String getTargetType()
|
||||
{
|
||||
return targetType;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("senderId", getSenderId())
|
||||
.append("type", getType())
|
||||
.append("targetId", getTargetId())
|
||||
.append("targetType", getTargetType())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
package com.ruoyi.system.domain.dto;public class MRTimeDto {
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DailySource;
|
||||
|
||||
/**
|
||||
* 资源位每天统计Mapper接口
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
public interface DailySourceMapper
|
||||
{
|
||||
/**
|
||||
* 查询资源位每天统计
|
||||
*
|
||||
* @param dailySourceId 资源位每天统计主键
|
||||
* @return 资源位每天统计
|
||||
*/
|
||||
public DailySource selectDailySourceByDailySourceId(Long dailySourceId);
|
||||
|
||||
/**
|
||||
* 查询资源位每天统计列表
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 资源位每天统计集合
|
||||
*/
|
||||
public List<DailySource> selectDailySourceList(DailySource dailySource);
|
||||
|
||||
/**
|
||||
* 新增资源位每天统计
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDailySource(DailySource dailySource);
|
||||
|
||||
/**
|
||||
* 修改资源位每天统计
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDailySource(DailySource dailySource);
|
||||
|
||||
/**
|
||||
* 删除资源位每天统计
|
||||
*
|
||||
* @param dailySourceId 资源位每天统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySourceByDailySourceId(Long dailySourceId);
|
||||
|
||||
/**
|
||||
* 批量删除资源位每天统计
|
||||
*
|
||||
* @param dailySourceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySourceByDailySourceIds(Long[] dailySourceIds);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserFollow;
|
||||
|
||||
/**
|
||||
* 用户关注Mapper接口
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
public interface SysUserFollowMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户关注
|
||||
*
|
||||
* @param id 用户关注主键
|
||||
* @return 用户关注
|
||||
*/
|
||||
public SysUserFollow selectSysUserFollowById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户关注列表
|
||||
*
|
||||
* @param sysUserFollow 用户关注
|
||||
* @return 用户关注集合
|
||||
*/
|
||||
public List<SysUserFollow> selectSysUserFollowList(SysUserFollow sysUserFollow);
|
||||
|
||||
/**
|
||||
* 新增用户关注
|
||||
*
|
||||
* @param sysUserFollow 用户关注
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysUserFollow(SysUserFollow sysUserFollow);
|
||||
|
||||
/**
|
||||
* 修改用户关注
|
||||
*
|
||||
* @param sysUserFollow 用户关注
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysUserFollow(SysUserFollow sysUserFollow);
|
||||
|
||||
/**
|
||||
* 删除用户关注
|
||||
*
|
||||
* @param id 用户关注主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserFollowById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户关注
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserFollowByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserLike;
|
||||
|
||||
/**
|
||||
* 用户点赞Mapper接口
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
public interface SysUserLikeMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户点赞
|
||||
*
|
||||
* @param id 用户点赞主键
|
||||
* @return 用户点赞
|
||||
*/
|
||||
public SysUserLike selectSysUserLikeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户点赞列表
|
||||
*
|
||||
* @param sysUserLike 用户点赞
|
||||
* @return 用户点赞集合
|
||||
*/
|
||||
public List<SysUserLike> selectSysUserLikeList(SysUserLike sysUserLike);
|
||||
|
||||
/**
|
||||
* 新增用户点赞
|
||||
*
|
||||
* @param sysUserLike 用户点赞
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysUserLike(SysUserLike sysUserLike);
|
||||
|
||||
/**
|
||||
* 修改用户点赞
|
||||
*
|
||||
* @param sysUserLike 用户点赞
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysUserLike(SysUserLike sysUserLike);
|
||||
|
||||
/**
|
||||
* 删除用户点赞
|
||||
*
|
||||
* @param id 用户点赞主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserLikeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户点赞
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserLikeByIds(Long[] ids);
|
||||
|
||||
public List<SysUserLike> selectSysUserLikeByUserIdAndTargetId(Long userId);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserNotification;
|
||||
|
||||
/**
|
||||
* 用户消息通知Mapper接口
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
public interface SysUserNotificationMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户消息通知
|
||||
*
|
||||
* @param id 用户消息通知主键
|
||||
* @return 用户消息通知
|
||||
*/
|
||||
public SysUserNotification selectSysUserNotificationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户消息通知列表
|
||||
*
|
||||
* @param sysUserNotification 用户消息通知
|
||||
* @return 用户消息通知集合
|
||||
*/
|
||||
public List<SysUserNotification> selectSysUserNotificationList(SysUserNotification sysUserNotification);
|
||||
|
||||
/**
|
||||
* 新增用户消息通知
|
||||
*
|
||||
* @param sysUserNotification 用户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysUserNotification(SysUserNotification sysUserNotification);
|
||||
|
||||
/**
|
||||
* 修改用户消息通知
|
||||
*
|
||||
* @param sysUserNotification 用户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysUserNotification(SysUserNotification sysUserNotification);
|
||||
|
||||
/**
|
||||
* 删除用户消息通知
|
||||
*
|
||||
* @param id 用户消息通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserNotificationById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户消息通知
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserNotificationByIds(Long[] ids);
|
||||
|
||||
public List<SysUserNotification> unreadNotifiaction(Long userId);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DailySource;
|
||||
|
||||
/**
|
||||
* 资源位每天统计Service接口
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
public interface IDailySourceService
|
||||
{
|
||||
/**
|
||||
* 查询资源位每天统计
|
||||
*
|
||||
* @param dailySourceId 资源位每天统计主键
|
||||
* @return 资源位每天统计
|
||||
*/
|
||||
public DailySource selectDailySourceByDailySourceId(Long dailySourceId);
|
||||
|
||||
/**
|
||||
* 查询资源位每天统计列表
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 资源位每天统计集合
|
||||
*/
|
||||
public List<DailySource> selectDailySourceList(DailySource dailySource);
|
||||
|
||||
/**
|
||||
* 新增资源位每天统计
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDailySource(DailySource dailySource);
|
||||
|
||||
/**
|
||||
* 修改资源位每天统计
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDailySource(DailySource dailySource);
|
||||
|
||||
/**
|
||||
* 批量删除资源位每天统计
|
||||
*
|
||||
* @param dailySourceIds 需要删除的资源位每天统计主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySourceByDailySourceIds(Long[] dailySourceIds);
|
||||
|
||||
/**
|
||||
* 删除资源位每天统计信息
|
||||
*
|
||||
* @param dailySourceId 资源位每天统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySourceByDailySourceId(Long dailySourceId);
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.DailySourceMapper;
|
||||
import com.ruoyi.system.domain.DailySource;
|
||||
import com.ruoyi.system.service.IDailySourceService;
|
||||
|
||||
/**
|
||||
* 资源位每天统计Service业务层处理
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-09
|
||||
*/
|
||||
@Service
|
||||
public class DailySourceServiceImpl implements IDailySourceService
|
||||
{
|
||||
@Autowired
|
||||
private DailySourceMapper dailySourceMapper;
|
||||
|
||||
/**
|
||||
* 查询资源位每天统计
|
||||
*
|
||||
* @param dailySourceId 资源位每天统计主键
|
||||
* @return 资源位每天统计
|
||||
*/
|
||||
@Override
|
||||
public DailySource selectDailySourceByDailySourceId(Long dailySourceId)
|
||||
{
|
||||
return dailySourceMapper.selectDailySourceByDailySourceId(dailySourceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资源位每天统计列表
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 资源位每天统计
|
||||
*/
|
||||
@Override
|
||||
public List<DailySource> selectDailySourceList(DailySource dailySource)
|
||||
{
|
||||
return dailySourceMapper.selectDailySourceList(dailySource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资源位每天统计
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDailySource(DailySource dailySource)
|
||||
{
|
||||
return dailySourceMapper.insertDailySource(dailySource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资源位每天统计
|
||||
*
|
||||
* @param dailySource 资源位每天统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDailySource(DailySource dailySource)
|
||||
{
|
||||
return dailySourceMapper.updateDailySource(dailySource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资源位每天统计
|
||||
*
|
||||
* @param dailySourceIds 需要删除的资源位每天统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDailySourceByDailySourceIds(Long[] dailySourceIds)
|
||||
{
|
||||
return dailySourceMapper.deleteDailySourceByDailySourceIds(dailySourceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源位每天统计信息
|
||||
*
|
||||
* @param dailySourceId 资源位每天统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDailySourceByDailySourceId(Long dailySourceId)
|
||||
{
|
||||
return dailySourceMapper.deleteDailySourceByDailySourceId(dailySourceId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysUserFollowMapper;
|
||||
import com.ruoyi.system.domain.SysUserFollow;
|
||||
import com.ruoyi.system.service.ISysUserFollowService;
|
||||
|
||||
/**
|
||||
* 用户关注Service业务层处理
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
@Service
|
||||
public class SysUserFollowServiceImpl implements ISysUserFollowService
|
||||
{
|
||||
@Autowired
|
||||
private SysUserFollowMapper sysUserFollowMapper;
|
||||
|
||||
/**
|
||||
* 查询用户关注
|
||||
*
|
||||
* @param id 用户关注主键
|
||||
* @return 用户关注
|
||||
*/
|
||||
@Override
|
||||
public SysUserFollow selectSysUserFollowById(Long id)
|
||||
{
|
||||
return sysUserFollowMapper.selectSysUserFollowById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户关注列表
|
||||
*
|
||||
* @param sysUserFollow 用户关注
|
||||
* @return 用户关注
|
||||
*/
|
||||
@Override
|
||||
public List<SysUserFollow> selectSysUserFollowList(SysUserFollow sysUserFollow)
|
||||
{
|
||||
return sysUserFollowMapper.selectSysUserFollowList(sysUserFollow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户关注
|
||||
*
|
||||
* @param sysUserFollow 用户关注
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysUserFollow(SysUserFollow sysUserFollow)
|
||||
{
|
||||
sysUserFollow.setCreateTime(DateUtils.getNowDate());
|
||||
return sysUserFollowMapper.insertSysUserFollow(sysUserFollow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户关注
|
||||
*
|
||||
* @param sysUserFollow 用户关注
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysUserFollow(SysUserFollow sysUserFollow)
|
||||
{
|
||||
sysUserFollow.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysUserFollowMapper.updateSysUserFollow(sysUserFollow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户关注
|
||||
*
|
||||
* @param ids 需要删除的用户关注主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysUserFollowByIds(Long[] ids)
|
||||
{
|
||||
return sysUserFollowMapper.deleteSysUserFollowByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户关注信息
|
||||
*
|
||||
* @param id 用户关注主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysUserFollowById(Long id)
|
||||
{
|
||||
return sysUserFollowMapper.deleteSysUserFollowById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysUserLikeMapper;
|
||||
import com.ruoyi.system.domain.SysUserLike;
|
||||
import com.ruoyi.system.service.ISysUserLikeService;
|
||||
|
||||
/**
|
||||
* 用户点赞Service业务层处理
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
@Service
|
||||
public class SysUserLikeServiceImpl implements ISysUserLikeService
|
||||
{
|
||||
@Autowired
|
||||
private SysUserLikeMapper sysUserLikeMapper;
|
||||
|
||||
/**
|
||||
* 查询用户点赞
|
||||
*
|
||||
* @param id 用户点赞主键
|
||||
* @return 用户点赞
|
||||
*/
|
||||
@Override
|
||||
public SysUserLike selectSysUserLikeById(Long id)
|
||||
{
|
||||
return sysUserLikeMapper.selectSysUserLikeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户点赞列表
|
||||
*
|
||||
* @param sysUserLike 用户点赞
|
||||
* @return 用户点赞
|
||||
*/
|
||||
@Override
|
||||
public List<SysUserLike> selectSysUserLikeList(SysUserLike sysUserLike)
|
||||
{
|
||||
return sysUserLikeMapper.selectSysUserLikeList(sysUserLike);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户点赞
|
||||
*
|
||||
* @param sysUserLike 用户点赞
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysUserLike(SysUserLike sysUserLike)
|
||||
{
|
||||
sysUserLike.setCreateTime(DateUtils.getNowDate());
|
||||
return sysUserLikeMapper.insertSysUserLike(sysUserLike);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户点赞
|
||||
*
|
||||
* @param sysUserLike 用户点赞
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysUserLike(SysUserLike sysUserLike)
|
||||
{
|
||||
sysUserLike.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysUserLikeMapper.updateSysUserLike(sysUserLike);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户点赞
|
||||
*
|
||||
* @param ids 需要删除的用户点赞主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysUserLikeByIds(Long[] ids)
|
||||
{
|
||||
return sysUserLikeMapper.deleteSysUserLikeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户点赞信息
|
||||
*
|
||||
* @param id 用户点赞主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysUserLikeById(Long id)
|
||||
{
|
||||
return sysUserLikeMapper.deleteSysUserLikeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserLike> selectSysUserLikeByUserIdAndTargetId(Long userId) {
|
||||
return sysUserLikeMapper.selectSysUserLikeByUserIdAndTargetId(userId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,157 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.SysUserFollow;
|
||||
import com.ruoyi.system.domain.SysUserLike;
|
||||
import com.ruoyi.system.domain.vo.UserMessageVo;
|
||||
import com.ruoyi.system.service.ISysUserFollowService;
|
||||
import com.ruoyi.system.service.ISysUserLikeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysUserNotificationMapper;
|
||||
import com.ruoyi.system.domain.SysUserNotification;
|
||||
import com.ruoyi.system.service.ISysUserNotificationService;
|
||||
|
||||
/**
|
||||
* 用户消息通知Service业务层处理
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-12-02
|
||||
*/
|
||||
@Service
|
||||
public class SysUserNotificationServiceImpl implements ISysUserNotificationService
|
||||
{
|
||||
@Autowired
|
||||
private SysUserNotificationMapper sysUserNotificationMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysUserFollowService userFollowService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserLikeService userLikeService;
|
||||
|
||||
/**
|
||||
* 查询用户消息通知
|
||||
*
|
||||
* @param id 用户消息通知主键
|
||||
* @return 用户消息通知
|
||||
*/
|
||||
@Override
|
||||
public SysUserNotification selectSysUserNotificationById(Long id)
|
||||
{
|
||||
return sysUserNotificationMapper.selectSysUserNotificationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户消息通知列表
|
||||
*
|
||||
* @param sysUserNotification 用户消息通知
|
||||
* @return 用户消息通知
|
||||
*/
|
||||
@Override
|
||||
public List<SysUserNotification> selectSysUserNotificationList(SysUserNotification sysUserNotification)
|
||||
{
|
||||
return sysUserNotificationMapper.selectSysUserNotificationList(sysUserNotification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户消息通知
|
||||
*
|
||||
* @param sysUserNotification 用户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysUserNotification(SysUserNotification sysUserNotification)
|
||||
{
|
||||
sysUserNotification.setCreateTime(DateUtils.getNowDate());
|
||||
return sysUserNotificationMapper.insertSysUserNotification(sysUserNotification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户消息通知
|
||||
*
|
||||
* @param sysUserNotification 用户消息通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysUserNotification(SysUserNotification sysUserNotification)
|
||||
{
|
||||
sysUserNotification.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysUserNotificationMapper.updateSysUserNotification(sysUserNotification);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户消息通知
|
||||
*
|
||||
* @param ids 需要删除的用户消息通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysUserNotificationByIds(Long[] ids)
|
||||
{
|
||||
return sysUserNotificationMapper.deleteSysUserNotificationByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户消息通知信息
|
||||
*
|
||||
* @param id 用户消息通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysUserNotificationById(Long id)
|
||||
{
|
||||
return sysUserNotificationMapper.deleteSysUserNotificationById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserNotification> unreadNotifiaction(Long userId)
|
||||
{
|
||||
return sysUserNotificationMapper.unreadNotifiaction(userId);
|
||||
}
|
||||
|
||||
|
||||
// 获取指定用户的id对应的消息
|
||||
@Override
|
||||
public UserMessageVo getUserMessages(Long userId)
|
||||
{
|
||||
UserMessageVo userMessageVo = new UserMessageVo();
|
||||
|
||||
SysUserFollow followed = new SysUserFollow();
|
||||
followed.setFollowedUserId(userId);
|
||||
|
||||
//获取关注我的相关信息
|
||||
userMessageVo.setFollowedByList(userFollowService.selectSysUserFollowList(followed));
|
||||
|
||||
//我关注的相关信息
|
||||
SysUserFollow following = new SysUserFollow();
|
||||
following.setUserId(userId);
|
||||
userMessageVo.setFollowingList(userFollowService.selectSysUserFollowList(following));
|
||||
|
||||
//点赞我的列表, 查询所有给我的作品点赞的信息
|
||||
userMessageVo.setLikedByList(userLikeService.selectSysUserLikeByUserIdAndTargetId(userId));
|
||||
|
||||
//我点赞的列表
|
||||
SysUserLike myLike = new SysUserLike();
|
||||
myLike.setUserId(userId);
|
||||
userMessageVo.setMyLikeList(userLikeService.selectSysUserLikeList(myLike));
|
||||
|
||||
// 未读消息列表
|
||||
|
||||
List<SysUserNotification> unreadNotifications = sysUserNotificationMapper.unreadNotifiaction(userId);
|
||||
|
||||
|
||||
userMessageVo.setLatestNotifications(unreadNotifications);
|
||||
|
||||
|
||||
// 未读消息总数
|
||||
userMessageVo.setUnreadCount(Long.valueOf(unreadNotifications.size()));
|
||||
|
||||
return userMessageVo;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.system.domain.DailySys;
|
||||
import com.ruoyi.system.domain.dto.SeOnlineTimeDto;
|
||||
import com.ruoyi.system.domain.dto.SeUserCountDto;
|
||||
import com.ruoyi.system.service.IDailySysService;
|
||||
import com.ruoyi.system.service.ISysUserCountService;
|
||||
import com.ruoyi.system.service.ISysUserStService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class SysUserCountServiceImpl implements ISysUserCountService {
|
||||
public class SysUserStServiceImpl implements ISysUserStService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@ -39,4 +39,15 @@ public class SysUserCountServiceImpl implements ISysUserCountService {
|
||||
return seUserCount;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SeUserCountDto> getUserCountByTime(LocalDate startDate, LocalDate endDate){
|
||||
List<SeUserCountDto> seUserCount = dailySysService.getSeUserCount(startDate, endDate);
|
||||
return seUserCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SeOnlineTimeDto> gettOnlineTime(LocalDate startDate, LocalDate endDate){
|
||||
return dailySysService.gettOnlineTime(startDate, endDate);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
<?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.system.mapper.SysUserFollowMapper">
|
||||
|
||||
<resultMap type="SysUserFollow" id="SysUserFollowResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="followedUserId" column="followed_user_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysUserFollowVo">
|
||||
select id, user_id, followed_user_id, status, create_time, update_time from sys_user_follow
|
||||
</sql>
|
||||
|
||||
<select id="selectSysUserFollowList" parameterType="SysUserFollow" resultMap="SysUserFollowResult">
|
||||
<include refid="selectSysUserFollowVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="followedUserId != null "> and followed_user_id = #{followedUserId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysUserFollowById" parameterType="Long" resultMap="SysUserFollowResult">
|
||||
<include refid="selectSysUserFollowVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUserFollow" parameterType="SysUserFollow" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_user_follow
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="followedUserId != null">followed_user_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="followedUserId != null">#{followedUserId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysUserFollow" parameterType="SysUserFollow">
|
||||
update sys_user_follow
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="followedUserId != null">followed_user_id = #{followedUserId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysUserFollowById" parameterType="Long">
|
||||
delete from sys_user_follow where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysUserFollowByIds" parameterType="String">
|
||||
delete from sys_user_follow where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,86 @@
|
||||
<?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.system.mapper.SysUserLikeMapper">
|
||||
|
||||
<resultMap type="SysUserLike" id="SysUserLikeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="targetId" column="target_id" />
|
||||
<result property="targetType" column="target_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysUserLikeVo">
|
||||
select id, user_id, target_id, target_type, status, create_time, update_time from sys_user_like
|
||||
</sql>
|
||||
|
||||
<select id="selectSysUserLikeList" parameterType="SysUserLike" resultMap="SysUserLikeResult">
|
||||
<include refid="selectSysUserLikeVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="targetId != null "> and target_id = #{targetId}</if>
|
||||
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysUserLikeById" parameterType="Long" resultMap="SysUserLikeResult">
|
||||
<include refid="selectSysUserLikeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectSysUserLikeByUserIdAndTargetId" resultType="list" resultMap="SysUserLikeResult">
|
||||
select l.*
|
||||
from sys_user_like l
|
||||
inner join user_work w on l.target_id = w.work_id
|
||||
where l.user_id = #{userId}
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUserLike" parameterType="SysUserLike" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_user_like
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="targetId != null">target_id,</if>
|
||||
<if test="targetType != null and targetType != ''">target_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="targetId != null">#{targetId},</if>
|
||||
<if test="targetType != null and targetType != ''">#{targetType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysUserLike" parameterType="SysUserLike">
|
||||
update sys_user_like
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="targetId != null">target_id = #{targetId},</if>
|
||||
<if test="targetType != null and targetType != ''">target_type = #{targetType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysUserLikeById" parameterType="Long">
|
||||
delete from sys_user_like where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysUserLikeByIds" parameterType="String">
|
||||
delete from sys_user_like where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,94 @@
|
||||
<?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.system.mapper.SysUserNotificationMapper">
|
||||
|
||||
<resultMap type="SysUserNotification" id="SysUserNotificationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="senderId" column="sender_id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="targetId" column="target_id" />
|
||||
<result property="targetType" column="target_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysUserNotificationVo">
|
||||
select id, user_id, sender_id, type, target_id, target_type, status, create_time, update_time from sys_user_notification
|
||||
</sql>
|
||||
|
||||
<select id="selectSysUserNotificationList" parameterType="SysUserNotification" resultMap="SysUserNotificationResult">
|
||||
<include refid="selectSysUserNotificationVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="senderId != null "> and sender_id = #{senderId}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="targetId != null "> and target_id = #{targetId}</if>
|
||||
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysUserNotificationById" parameterType="Long" resultMap="SysUserNotificationResult">
|
||||
<include refid="selectSysUserNotificationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="unreadNotifiaction" resultType="com.ruoyi.system.domain.SysUserNotification">
|
||||
select *
|
||||
from sys_user_notification
|
||||
where user_id = #{userId} and status = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUserNotification" parameterType="SysUserNotification" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_user_notification
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="senderId != null">sender_id,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="targetId != null">target_id,</if>
|
||||
<if test="targetType != null">target_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="senderId != null">#{senderId},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="targetId != null">#{targetId},</if>
|
||||
<if test="targetType != null">#{targetType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysUserNotification" parameterType="SysUserNotification">
|
||||
update sys_user_notification
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="senderId != null">sender_id = #{senderId},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="targetId != null">target_id = #{targetId},</if>
|
||||
<if test="targetType != null">target_type = #{targetType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysUserNotificationById" parameterType="Long">
|
||||
delete from sys_user_notification where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysUserNotificationByIds" parameterType="String">
|
||||
delete from sys_user_notification where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user