48 changed files with 421 additions and 671 deletions
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* <p> |
||||
* |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-26 |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@Accessors(chain = true) |
||||
@TableName("common_push_file") |
||||
@ApiModel(value = "PushFile对象") |
||||
public class PushFile extends CommonEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
private String id; |
||||
|
||||
@ApiModelProperty("文件获取地址") |
||||
private String fileUrl; |
||||
|
||||
@ApiModelProperty("文件名称") |
||||
private String fileName; |
||||
|
||||
@ApiModelProperty("容器名称") |
||||
private String bucketName; |
||||
|
||||
@ApiModelProperty("原文件名") |
||||
private String original; |
||||
|
||||
@ApiModelProperty("文件类型") |
||||
private String type; |
||||
|
||||
@ApiModelProperty("文件大小") |
||||
private Long fileSize; |
||||
|
||||
} |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||
import java.io.Serializable; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 推送记录 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-17 |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@Accessors(chain = true) |
||||
@TableName("common_push_record") |
||||
@ApiModel(value = "PushRecord对象", description = "") |
||||
public class PushRecord extends CommonEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
private String id; |
||||
|
||||
@ApiModelProperty("标题") |
||||
private String title; |
||||
|
||||
@ApiModelProperty("别名用户ID") |
||||
private String aliasUserId; |
||||
|
||||
@ApiModelProperty("通知类型级别") |
||||
private String typeLevel; |
||||
|
||||
@ApiModelProperty("别名类型") |
||||
private String aliasType; |
||||
|
||||
@ApiModelProperty("推送描述") |
||||
private String description; |
||||
|
||||
@ApiModelProperty("通知内容") |
||||
private String content; |
||||
|
||||
@ApiModelProperty("后续动作内容") |
||||
private String afterActionContent; |
||||
|
||||
@ApiModelProperty("应用ID") |
||||
private String applicationId; |
||||
|
||||
@ApiModelProperty("是否震动") |
||||
private String isVibration; |
||||
|
||||
@ApiModelProperty("是否响铃") |
||||
private String isSound; |
||||
|
||||
@ApiModelProperty("自定义铃声") |
||||
private String customSound; |
||||
|
||||
|
||||
} |
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
||||
import java.io.Serializable; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* <p> |
||||
* |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-16 |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@Accessors(chain = true) |
||||
@TableName("common_push_third_party_manage") |
||||
@ApiModel(value = "PushThirdPartyManage对象", description = "") |
||||
public class PushThirdPartyManage extends CommonEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
private String id; |
||||
|
||||
@ApiModelProperty("第三方ID") |
||||
private String thirdPartyId; |
||||
|
||||
@ApiModelProperty("企业名称") |
||||
private String enterpName; |
||||
|
||||
@ApiModelProperty("自定义推送类型ID") |
||||
private String pushTypeId; |
||||
|
||||
@ApiModelProperty("是否震动") |
||||
private String isVibration; |
||||
|
||||
@ApiModelProperty("是否响铃") |
||||
private String isSound; |
||||
|
||||
@ApiModelProperty("自定义铃声") |
||||
private String customSound; |
||||
|
||||
} |
@ -1,36 +0,0 @@
@@ -1,36 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.api.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
*<p> |
||||
* 用户和消息推送关联表 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/2/24 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("sys_user_push") |
||||
public class UserPush implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 用户ID |
||||
*/ |
||||
private String userId; |
||||
|
||||
/** |
||||
* 推送ID |
||||
*/ |
||||
private String pushId; |
||||
|
||||
} |
@ -1,77 +0,0 @@
@@ -1,77 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.Message; |
||||
import com.cloud.kicc.commonbiz.service.IMessageService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* <p> |
||||
* 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author entfrm开发团队-王翔 |
||||
* @since 2022-11-15 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON +"/message") |
||||
@RequiredArgsConstructor |
||||
@Api(tags = "消息模块") |
||||
public class MessageController { |
||||
|
||||
private final IMessageService iMessageService; |
||||
|
||||
private LambdaQueryWrapper<Message> getQueryWrapper(Message message) { |
||||
return new LambdaQueryWrapper<Message>() |
||||
.eq(StrUtil.isNotBlank(message.getStatus()), Message::getStatus, message.getStatus()) |
||||
.eq(StrUtil.isNotBlank(message.getType()), Message::getType, message.getType()); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperation(value = "分页查询", notes = "分页查询") |
||||
public R list(Page page, Message message) { |
||||
IPage<Message> result = iMessageService.page(page, getQueryWrapper(message)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("/{id:\\w+}") |
||||
@ApiOperation(value = "根据id获取", notes = "根据id获取") |
||||
public R getById(@PathVariable("id") String id) { |
||||
Message message = iMessageService.getById(id); |
||||
return R.ok(message); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
@ApiOperation(value = "保存", notes = "保存") |
||||
public R save(@RequestBody Message message) { |
||||
iMessageService.save(message); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
@ApiOperation(value = "修改", notes = "修改") |
||||
public R update(@RequestBody Message message) { |
||||
iMessageService.updateById(message); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
@ApiOperation(value = "删除", notes = "删除") |
||||
public R remove(@PathVariable String[] ids) { |
||||
iMessageService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushFile; |
||||
import com.cloud.kicc.commonbiz.service.IPushFileService; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-26 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON + "/pushFile") |
||||
@RequiredArgsConstructor |
||||
public class PushFileController { |
||||
|
||||
private final IPushFileService iPushFileService; |
||||
|
||||
private LambdaQueryWrapper<PushFile> getQueryWrapper(PushFile pushFile) { |
||||
return new LambdaQueryWrapper<PushFile>() |
||||
.like(StrUtil.isNotBlank(pushFile.getFileName()), PushFile::getFileName, pushFile.getFileName()); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperation(value = "分页查询") |
||||
public R list(Page page, PushFile pushFile) { |
||||
IPage<PushFile> list = iPushFileService.page(page, getQueryWrapper(pushFile)); |
||||
return R.ok(list.getRecords(), list.getTotal()); |
||||
} |
||||
|
||||
@PostMapping("/upload") |
||||
public Map upload(@RequestPart("file") MultipartFile file) { |
||||
return iPushFileService.uploadFile(file); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
@ApiOperation(value = "删除文件") |
||||
public R remove(@PathVariable String[] ids) { |
||||
for (int i = 0; i < ids.length; ++i) |
||||
iPushFileService.deleteFile(ids[i]); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,78 @@
@@ -0,0 +1,78 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushMessage; |
||||
import com.cloud.kicc.commonbiz.service.IPushMessageService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* <p> |
||||
* 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author entfrm开发团队-王翔 |
||||
* @since 2022-11-15 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON +"/pushMessage") |
||||
@RequiredArgsConstructor |
||||
@Api(tags = "消息模块") |
||||
public class PushMessageController { |
||||
|
||||
private final IPushMessageService iPushMessageService; |
||||
|
||||
private LambdaQueryWrapper<PushMessage> getQueryWrapper(PushMessage pushMessage) { |
||||
return new LambdaQueryWrapper<PushMessage>() |
||||
.eq(StrUtil.isNotBlank(pushMessage.getSendUserId()), PushMessage::getSendUserId, pushMessage.getSendUserId()) |
||||
.like(StrUtil.isNotBlank(pushMessage.getAlias()), PushMessage::getAlias, pushMessage.getAlias()) |
||||
.eq(StrUtil.isNotBlank(pushMessage.getTitle()), PushMessage::getTitle, pushMessage.getTitle()); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
@ApiOperation(value = "分页查询") |
||||
public R list(Page page, PushMessage pushMessage) { |
||||
IPage<PushMessage> result = iPushMessageService.page(page, getQueryWrapper(pushMessage)); |
||||
return R.ok(result.getRecords(), result.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("/{id:\\w+}") |
||||
@ApiOperation(value = "根据id获取") |
||||
public R getById(@PathVariable("id") String id) { |
||||
PushMessage pushMessage = iPushMessageService.getById(id); |
||||
return R.ok(pushMessage); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
@ApiOperation(value = "保存") |
||||
public R save(@RequestBody PushMessage pushMessage) { |
||||
iPushMessageService.save(pushMessage); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
@ApiOperation(value = "修改") |
||||
public R update(@RequestBody PushMessage pushMessage) { |
||||
iPushMessageService.updateById(pushMessage); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
@ApiOperation(value = "删除") |
||||
public R remove(@PathVariable String[] ids) { |
||||
iPushMessageService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -1,80 +0,0 @@
@@ -1,80 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushRecord; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushThirdParty; |
||||
import com.cloud.kicc.commonbiz.service.IPushRecordService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* <p> |
||||
* 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-17 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON + "/pushRecord") |
||||
@RequiredArgsConstructor |
||||
@Api(tags = "推送消息记录") |
||||
public class PushRecordController { |
||||
|
||||
private final IPushRecordService iPushRecordService; |
||||
|
||||
private LambdaQueryWrapper<PushRecord> getQueryWrapper(PushRecord pushRecord) { |
||||
return new LambdaQueryWrapper<PushRecord>() |
||||
.like(StrUtil.isNotBlank(pushRecord.getTitle()), PushRecord::getTitle, pushRecord.getTitle()) |
||||
.eq(StrUtil.isNotBlank(pushRecord.getApplicationId()), PushRecord::getApplicationId, pushRecord.getApplicationId()) |
||||
.eq(StrUtil.isNotBlank(pushRecord.getAliasUserId()), PushRecord::getAliasUserId, pushRecord.getAliasUserId()) |
||||
.eq(StrUtil.isNotBlank(pushRecord.getAliasType()), PushRecord::getAliasType, pushRecord.getAliasType()); |
||||
} |
||||
|
||||
@ApiOperation("分页查询") |
||||
@GetMapping("/list") |
||||
public R list(Page page, PushRecord pushRecord) { |
||||
IPage<PushThirdParty> list = iPushRecordService.page(page, getQueryWrapper(pushRecord)); |
||||
return R.ok(list.getRecords(), list.getTotal()); |
||||
} |
||||
|
||||
@ApiOperation("根据ID查询") |
||||
@GetMapping("/{id:\\w+}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
return R.ok(iPushRecordService.getById(id)); |
||||
} |
||||
|
||||
@ApiOperation("保存") |
||||
@PostMapping("/save") |
||||
public R save(@Valid @RequestBody PushRecord pushRecord) { |
||||
iPushRecordService.save(pushRecord); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@ApiOperation("修改") |
||||
@PutMapping("/update") |
||||
public R update(@Valid @RequestBody PushRecord pushRecord) { |
||||
iPushRecordService.updateById(pushRecord); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@ApiOperation("删除") |
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R<Boolean> removeById(@PathVariable String[] ids) { |
||||
iPushRecordService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -1,76 +0,0 @@
@@ -1,76 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushThirdPartyManage; |
||||
import com.cloud.kicc.commonbiz.service.IPushThirdPartyManageService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* <p> |
||||
* 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-16 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON + "/pushThirdPartyManage") |
||||
@RequiredArgsConstructor |
||||
@Api(tags = "第三方管理") |
||||
public class PushThirdPartyManageController { |
||||
|
||||
private final IPushThirdPartyManageService iPushThirdPartyManageService; |
||||
|
||||
private LambdaQueryWrapper<PushThirdPartyManage> getQueryWrapper(PushThirdPartyManage pushThirdPartyManage) { |
||||
return new LambdaQueryWrapper<PushThirdPartyManage>() |
||||
.eq(StrUtil.isNotBlank(pushThirdPartyManage.getEnterpName()), PushThirdPartyManage::getEnterpName, pushThirdPartyManage.getEnterpName()); |
||||
} |
||||
|
||||
@ApiOperation("分页查询") |
||||
@GetMapping("/list") |
||||
public R list(Page page, PushThirdPartyManage pushThirdPartyManage) { |
||||
IPage<PushThirdPartyManage> list = iPushThirdPartyManageService.page(page, getQueryWrapper(pushThirdPartyManage)); |
||||
return R.ok(list.getRecords(), list.getTotal()); |
||||
} |
||||
|
||||
@ApiOperation("根据ID查询") |
||||
@GetMapping("/{id:\\w+}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
return R.ok(iPushThirdPartyManageService.getById(id)); |
||||
} |
||||
|
||||
@ApiOperation("保存") |
||||
@PostMapping("/save") |
||||
public R save(@Valid @RequestBody PushThirdPartyManage pushThirdPartyManage) { |
||||
iPushThirdPartyManageService.save(pushThirdPartyManage); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@ApiOperation("修改") |
||||
@PutMapping("/update") |
||||
public R update(@Valid @RequestBody PushThirdPartyManage pushThirdPartyManage) { |
||||
iPushThirdPartyManageService.updateById(pushThirdPartyManage); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@ApiOperation("删除") |
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R<Boolean> removeById(@PathVariable String[] ids) { |
||||
iPushThirdPartyManageService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.PushThirdPartyManage; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-16 |
||||
*/ |
||||
public interface PushThirdPartyManageMapper extends BaseMapper<PushThirdPartyManage> { |
||||
|
||||
} |
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.cloud.kicc.commonbiz.api.entity.UserPush; |
||||
|
||||
/** |
||||
*<p> |
||||
* Mapper 接口 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/2/24 |
||||
*/ |
||||
public interface UserPushMapper extends BaseMapper<UserPush> { |
||||
|
||||
} |
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushFile; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-26 |
||||
*/ |
||||
public interface IPushFileService extends IService<PushFile> { |
||||
|
||||
/** |
||||
* 上传文件 |
||||
* @param file |
||||
* @return |
||||
*/ |
||||
Map uploadFile(MultipartFile file); |
||||
|
||||
/** |
||||
* 删除文件 |
||||
* @param id |
||||
* @return Boolean |
||||
*/ |
||||
void deleteFile(String id); |
||||
|
||||
} |
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.PushRecord; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-17 |
||||
*/ |
||||
public interface IPushRecordService extends IService<PushRecord> { |
||||
|
||||
} |
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.PushThirdPartyManage; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-16 |
||||
*/ |
||||
public interface IPushThirdPartyManageService extends IService<PushThirdPartyManage> { |
||||
|
||||
} |
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.cloud.kicc.commonbiz.api.entity.UserPush; |
||||
|
||||
/** |
||||
*<p> |
||||
* 服务类 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/2/24 |
||||
*/ |
||||
public interface UserPushService extends IService<UserPush> { |
||||
|
||||
} |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.Message; |
||||
import com.cloud.kicc.commonbiz.mapper.MessageMapper; |
||||
import com.cloud.kicc.commonbiz.service.IMessageService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author entfrm开发团队-王翔 |
||||
* @since 2022-11-15 |
||||
*/ |
||||
@Service |
||||
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements IMessageService { |
||||
|
||||
} |
@ -0,0 +1,72 @@
@@ -0,0 +1,72 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import cn.hutool.core.io.FileUtil; |
||||
import cn.hutool.core.util.IdUtil; |
||||
import cn.hutool.core.util.ObjectUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.common.core.exception.CheckedException; |
||||
import com.cloud.kicc.commonbiz.api.entity.PushFile; |
||||
import com.cloud.kicc.commonbiz.mapper.PushFileMapper; |
||||
import com.cloud.kicc.commonbiz.service.IPushFileService; |
||||
import com.pig4cloud.plugin.oss.OssProperties; |
||||
import com.pig4cloud.plugin.oss.service.OssTemplate; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.SneakyThrows; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-26 |
||||
*/ |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
public class PushFileServiceImpl extends ServiceImpl<PushFileMapper, PushFile> implements IPushFileService { |
||||
|
||||
private final OssProperties ossProperties; |
||||
private final OssTemplate ossTemplate; |
||||
|
||||
@Override |
||||
public Map uploadFile(MultipartFile file) { |
||||
String fileName = IdUtil.simpleUUID() + StrUtil.DOT + FileUtil.extName(file.getOriginalFilename()); |
||||
Map<String, String> resultMap = new HashMap<>(4); |
||||
resultMap.put("bucketName", ossProperties.getBucketName()); |
||||
resultMap.put("fileName", fileName); |
||||
resultMap.put("url", String.format("/system_proxy/system/file/getFile/%s/%s", ossProperties.getBucketName(), fileName)); |
||||
try { |
||||
ossTemplate.putObject(ossProperties.getBucketName(), fileName, file.getContentType(), file.getInputStream()); |
||||
super.save(new PushFile() |
||||
.setFileUrl(resultMap.get("url")) |
||||
.setFileName(fileName) |
||||
.setOriginal(file.getOriginalFilename()) |
||||
.setFileSize(file.getSize()) |
||||
.setType(FileUtil.extName(file.getOriginalFilename())) |
||||
.setBucketName(ossProperties.getBucketName()) |
||||
); |
||||
} catch (Exception e) { |
||||
throw new CheckedException("上传失败"); |
||||
} |
||||
return resultMap; |
||||
} |
||||
|
||||
@Override |
||||
@SneakyThrows |
||||
@Transactional(rollbackFor = Exception.class) |
||||
public void deleteFile(String id) { |
||||
PushFile file = super.getById(id); |
||||
if (ObjectUtil.isNotEmpty(file)) { |
||||
ossTemplate.removeObject(ossProperties.getBucketName(), file.getFileName()); |
||||
this.removeById(id); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.PushMessage; |
||||
import com.cloud.kicc.commonbiz.mapper.PushMessageMapper; |
||||
import com.cloud.kicc.commonbiz.service.IPushMessageService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author entfrm开发团队-王翔 |
||||
* @since 2022-11-15 |
||||
*/ |
||||
@Service |
||||
public class PushMessageServiceImpl extends ServiceImpl<PushMessageMapper, PushMessage> implements IPushMessageService { |
||||
|
||||
} |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.PushRecord; |
||||
import com.cloud.kicc.commonbiz.mapper.PushRecordMapper; |
||||
import com.cloud.kicc.commonbiz.service.IPushRecordService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-17 |
||||
*/ |
||||
@Service |
||||
public class PushRecordServiceImpl extends ServiceImpl<PushRecordMapper, PushRecord> implements IPushRecordService { |
||||
|
||||
} |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.cloud.kicc.commonbiz.api.entity.PushThirdPartyManage; |
||||
import com.cloud.kicc.commonbiz.mapper.PushThirdPartyManageMapper; |
||||
import com.cloud.kicc.commonbiz.service.IPushThirdPartyManageService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author wangxiang4 |
||||
* @since 2023-02-16 |
||||
*/ |
||||
@Service |
||||
public class PushThirdPartyManageServiceImpl extends ServiceImpl<PushThirdPartyManageMapper, PushThirdPartyManage> implements IPushThirdPartyManageService { |
||||
|
||||
} |
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.cloud.kicc.commonbiz.api.entity.UserPush; |
||||
import com.cloud.kicc.commonbiz.mapper.UserPushMapper; |
||||
import com.cloud.kicc.commonbiz.service.UserPushService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
*<p> |
||||
* 服务实现类 |
||||
*</p> |
||||
* |
||||
* @Author: entfrm开发团队-王翔 |
||||
* @Date: 2022/2/24 |
||||
*/ |
||||
@Service |
||||
public class UserPushServiceImpl extends ServiceImpl<UserPushMapper, UserPush> implements UserPushService { |
||||
|
||||
} |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushCertificationMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.UserPushMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.PushFileMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushManageMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.MessageMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.PushMessageMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushRecordMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushThirdPartyManageMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushTodoAuthMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushTypeMapper"> |
||||
|
||||
</mapper> |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
<?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.cloud.kicc.commonbiz.mapper.PushWhitelistMapper"> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue