App用户消息配置迁移

This commit is contained in:
2023-08-28 12:32:58 +08:00
parent 1e7b0c7f74
commit 18ea80ab50
8 changed files with 0 additions and 300 deletions

View File

@@ -1,70 +0,0 @@
package com.njcn.cssystem.controller.messageConfig;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.cssystem.pojo.param.AppInfoSetParam;
import com.njcn.cssystem.pojo.po.AppInfoSet;
import com.njcn.cssystem.service.IAppInfoSetService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.RequestUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
/**
* <p>
* 前端控制器
* </p>
* 用户推送消息配置
* @author xuyang
* @since 2023-08-21
*/
@RestController
@RequestMapping("/appInfoSet")
@Api(tags = "用户推送消息配置")
@AllArgsConstructor
@Validated
public class AppInfoSetController extends BaseController {
private final IAppInfoSetService appInfoSetService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/add")
@ApiOperation("新增用户消息推送配置")
@ApiImplicitParam(name = "appInfoSet", value = "参数实体", required = true)
@ApiIgnore
public HttpResult<String> add(@RequestBody AppInfoSet appInfoSet){
String methodDescribe = getMethodDescribe("add");
appInfoSetService.save(appInfoSet);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryByUserId")
@ApiOperation("查看用户消息推送配置")
public HttpResult<AppInfoSet> queryByUserId(){
String methodDescribe = getMethodDescribe("queryByUserId");
AppInfoSet appInfoSet = appInfoSetService.lambdaQuery().eq(AppInfoSet::getUserId,RequestUtil.getUserIndex()).one();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appInfoSet, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/update")
@ApiOperation("更新消息推送配置")
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
public HttpResult<String> update(@RequestBody AppInfoSetParam.AppInfoSetUpdateParam param){
String methodDescribe = getMethodDescribe("update");
appInfoSetService.updateAppInfo(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
}

View File

@@ -1,16 +0,0 @@
package com.njcn.cssystem.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.cssystem.pojo.po.AppInfoSet;
/**
* <p>
* Mapper 接口
* </p>
*
* @author xuyang
* @since 2023-08-21
*/
public interface AppInfoSetMapper extends BaseMapper<AppInfoSet> {
}

View File

@@ -1,21 +0,0 @@
package com.njcn.cssystem.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.cssystem.pojo.param.AppInfoSetParam;
import com.njcn.cssystem.pojo.po.AppInfoSet;
/**
* <p>
* 服务类
* </p>
*
* @author xuyang
* @since 2023-08-21
*/
public interface IAppInfoSetService extends IService<AppInfoSet> {
/**
* 更新用户消息配置
*/
void updateAppInfo(AppInfoSetParam param);
}

View File

@@ -1,30 +0,0 @@
package com.njcn.cssystem.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.cssystem.mapper.AppInfoSetMapper;
import com.njcn.cssystem.pojo.param.AppInfoSetParam;
import com.njcn.cssystem.pojo.po.AppInfoSet;
import com.njcn.cssystem.service.IAppInfoSetService;
import com.njcn.web.utils.RequestUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author xuyang
* @since 2023-08-21
*/
@Service
public class AppInfoSetServiceImpl extends ServiceImpl<AppInfoSetMapper, AppInfoSet> implements IAppInfoSetService {
@Override
public void updateAppInfo(AppInfoSetParam param) {
AppInfoSet appInfoSet = new AppInfoSet();
BeanUtils.copyProperties(param,appInfoSet);
appInfoSet.setUserId(RequestUtil.getUserIndex());
this.updateById(appInfoSet);
}
}