From ca1df8ab561fb8cba631695385b35ba96386cda1 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Wed, 06 Mar 2024 14:41:32 +0800
Subject: [PATCH] 短信模版
---
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml | 6
src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.xml | 59 ++++
src/main/java/org/springblade/common/utils/SmsUtils.java | 122 +++++++++
src/main/java/org/springblade/modules/smsTemplate/vo/SmsTemplateVO.java | 35 ++
src/main/java/org/springblade/modules/smsTemplate/service/impl/SmsTemplateServiceImpl.java | 70 +++++
src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.java | 60 ++++
src/main/java/org/springblade/modules/smsTemplate/controller/SmsTemplateController.java | 126 +++++++++
src/main/java/org/springblade/modules/smsTemplate/service/ISmsTemplateService.java | 60 ++++
src/main/java/org/springblade/modules/smsTemplate/dto/SmsTemplateDTO.java | 34 ++
src/main/java/org/springblade/modules/smsTemplate/entity/SmsTemplateEntity.java | 99 +++++++
src/main/java/org/springblade/modules/smsTemplate/wrapper/SmsTemplateWrapper.java | 50 +++
11 files changed, 715 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/springblade/common/utils/SmsUtils.java b/src/main/java/org/springblade/common/utils/SmsUtils.java
new file mode 100644
index 0000000..5085764
--- /dev/null
+++ b/src/main/java/org/springblade/common/utils/SmsUtils.java
@@ -0,0 +1,122 @@
+package org.springblade.common.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+public class SmsUtils {
+
+ private static Logger logger = LoggerFactory.getLogger(SmsUtils.class);
+
+ public static String buildRequestXMLString(String id, String pwd, String serviceid, String phone, String content) {
+ StringBuffer sb = new StringBuffer();
+
+ sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
+ .append("<svc_init ver=\"2.0.0\">")
+ .append("<sms ver=\"2.0.0\">")
+ .append("<client>")
+ .append("<id>").append(id).append("</id>")
+ .append("<pwd>").append(pwd).append("</pwd>")
+ .append("<serviceid>").append(serviceid).append("</serviceid>")
+ .append("</client>")
+ .append("<sms_info>")
+ .append("<phone>").append(phone).append("</phone>")
+ .append("<content>").append(content).append("</content>")
+ .append("</sms_info>")
+ .append("</sms>")
+ .append(" </svc_init>");
+
+ logger.info("buildRequestXMLString:" + sb.toString());
+ return sb.toString();
+ }
+
+ public static String postXMLSendSMSRequest(String servletUrl, String content) {
+ String result = null;
+
+ BufferedReader br = null;
+ OutputStreamWriter out = null;
+ HttpURLConnection con = null;
+
+ try {
+ URL url = new URL(servletUrl);
+
+ con = (HttpURLConnection) url.openConnection();
+ con.setDoOutput(true);
+ con.setRequestMethod("POST");
+
+ out = new OutputStreamWriter(con.getOutputStream(), "UTF-8");
+
+ out.write(content);
+
+ out.flush();
+
+ br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+
+ String line = null;
+
+ StringBuilder sb = new StringBuilder();
+
+ while ((line = br.readLine()) != null) {
+ sb.append(line);
+ }
+
+ result = sb.toString();
+
+ System.out.println(result);
+ logger.info("postXMLSendSMSRequest:" + result);
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (con != null) {
+ con.disconnect();
+ con = null;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ //下面的MAS_ID、PASSWORD仅供测试使用,正式使用由移动公司分配
+ String MAS_ID = "182";
+ String PASSWORD = "bYcLgYwXOZspDzEnaGsNHAGUykKEiexknHY9H98xVTQ8Zbeya8bexQ==";
+// Map map = new HashMap<>();
+// map.put("ip", "127.0.0.1");
+// map.put("port", "3306");
+// map.put("tenantCode", "test001");
+// StrSubstitutor strSubstitutor = new StrSubstitutor(map);
+// String url3 = "jdbc:mysql://${ip}:${port}/${tenantCode}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Shanghai";
+// String context3 = strSubstitutor.replace(url3);
+// System.out.println(context3);
+
+// String reqXML = buildRequestXMLString(MAS_ID, PASSWORD, "", "18720768376", "测试短信");
+
+// postXMLSendSMSRequest("http://218.204.110.232:8080/emc/HttpSendSMSService", reqXML);
+ }
+}
+
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
index c6629cd..b6e9864 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
@@ -99,12 +99,6 @@
<if test="placeExt.startTime != null and placeExt.startTime != '' and placeExt.endTime != null and placeExt.endTime != '' ">
AND jpe.create_time BETWEEN #{placeExt.startTime} and #{placeExt.endTime}
</if>
- <if test="houseCodeList != null and houseCodeList.size()>0">
- and jp.house_code in
- <foreach collection="houseCodeList" item="houseCode" separator="," open="(" close=")">
- #{houseCode}
- </foreach>
- </if>
order by jpe.create_time desc,jpe.id desc
</select>
diff --git a/src/main/java/org/springblade/modules/smsTemplate/controller/SmsTemplateController.java b/src/main/java/org/springblade/modules/smsTemplate/controller/SmsTemplateController.java
new file mode 100644
index 0000000..52e7006
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/controller/SmsTemplateController.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import org.springblade.modules.smsTemplate.vo.SmsTemplateVO;
+import org.springblade.modules.smsTemplate.wrapper.SmsTemplateWrapper;
+import org.springblade.modules.smsTemplate.service.ISmsTemplateService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 短信模版表 控制器
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-smsTemplate/smsTemplate")
+@Api(value = "短信模版表", tags = "短信模版表接口")
+public class SmsTemplateController extends BladeController {
+
+ private final ISmsTemplateService smsTemplateService;
+
+ /**
+ * 短信模版表 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入smsTemplate")
+ public R<SmsTemplateVO> detail(SmsTemplateEntity smsTemplate) {
+ SmsTemplateEntity detail = smsTemplateService.getOne(Condition.getQueryWrapper(smsTemplate));
+ return R.data(SmsTemplateWrapper.build().entityVO(detail));
+ }
+ /**
+ * 短信模版表 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入smsTemplate")
+ public R<IPage<SmsTemplateVO>> list(SmsTemplateEntity smsTemplate, Query query) {
+ IPage<SmsTemplateEntity> pages = smsTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(smsTemplate));
+ return R.data(SmsTemplateWrapper.build().pageVO(pages));
+ }
+
+ /**
+ * 短信模版表 自定义分页
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入smsTemplate")
+ public R<IPage<SmsTemplateVO>> page(SmsTemplateVO smsTemplate, Query query) {
+ IPage<SmsTemplateVO> pages = smsTemplateService.selectSmsTemplatePage(Condition.getPage(query), smsTemplate);
+ return R.data(pages);
+ }
+
+ /**
+ * 短信模版表 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入smsTemplate")
+ public R save(@Valid @RequestBody SmsTemplateEntity smsTemplate) {
+ return R.status(smsTemplateService.save(smsTemplate));
+ }
+
+ /**
+ * 短信模版表 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入smsTemplate")
+ public R update(@Valid @RequestBody SmsTemplateEntity smsTemplate) {
+ return R.status(smsTemplateService.updateById(smsTemplate));
+ }
+
+ /**
+ * 短信模版表 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入smsTemplate")
+ public R submit(@Valid @RequestBody SmsTemplateEntity smsTemplate) {
+ return R.status(smsTemplateService.saveOrUpdate(smsTemplate));
+ }
+
+ /**
+ * 短信模版表 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 7)
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(smsTemplateService.removeBatchByIds(Func.toLongList(ids)));
+ }
+
+
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/dto/SmsTemplateDTO.java b/src/main/java/org/springblade/modules/smsTemplate/dto/SmsTemplateDTO.java
new file mode 100644
index 0000000..c038971
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/dto/SmsTemplateDTO.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.dto;
+
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 短信模版表 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SmsTemplateDTO extends SmsTemplateEntity {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/entity/SmsTemplateEntity.java b/src/main/java/org/springblade/modules/smsTemplate/entity/SmsTemplateEntity.java
new file mode 100644
index 0000000..d17ff87
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/entity/SmsTemplateEntity.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * 短信模版表对象 blade_sms_template
+ *
+ * @author ${context.author}
+ * @date 2024-03-06 14:25:48
+ */
+@ApiModel(value = "BladeSmsTemplate对象", description = "短信模版表")
+@Data
+@TableName("blade_sms_template")
+public class SmsTemplateEntity implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * id
+ */
+ @ApiModelProperty(value = "主键ID", example = "")
+ @TableId(value = "id", type = IdType.ASSIGN_ID)
+ private Integer id;
+
+ /**
+ * 机构id
+ */
+ @ApiModelProperty(value = "机构id", example = "")
+ @TableField("dept_id")
+ private Integer deptId;
+
+ /**
+ * 模板内容
+ */
+ @ApiModelProperty(value = "模板内容", example = "")
+ @TableField("content")
+ private String content;
+
+ /**
+ * 创建时间
+ */
+ @ApiModelProperty(value = "创建时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField(value = "create_time",fill = FieldFill.INSERT)
+ private Date createTime;
+
+ /**
+ * 更新时间
+ */
+ @ApiModelProperty(value = "更新时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField(value = "update_time",fill = FieldFill.UPDATE)
+ private Date updateTime;
+
+ /**
+ * 创建人
+ */
+ @ApiModelProperty(value = "创建人", example = "")
+ @TableField("create_by")
+ private Long createBy;
+
+ /**
+ * 0:否 1:是
+ */
+ @ApiModelProperty(value = "0:否 1:是", example = "")
+ @TableField("is_delete")
+ private String isDelete;
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.java b/src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.java
new file mode 100644
index 0000000..72ca218
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.mapper;
+
+import org.springblade.modules.smsTemplate.dto.SmsTemplateDTO;
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import org.springblade.modules.smsTemplate.vo.SmsTemplateVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 短信模版表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+public interface SmsTemplateMapper extends BaseMapper<SmsTemplateEntity> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param smsTemplate
+ * @return
+ */
+ List<SmsTemplateVO> selectSmsTemplatePage(IPage page, SmsTemplateVO smsTemplate);
+
+
+
+ /**
+ * 查询短信模版表
+ *
+ * @param id 短信模版表ID
+ * @return 短信模版表
+ */
+ public SmsTemplateDTO selectBladeSmsTemplateById(Integer id);
+
+ /**
+ * 查询短信模版表列表
+ *
+ * @param bladeSmsTemplateDTO 短信模版表
+ * @return 短信模版表集合
+ */
+ public List<SmsTemplateDTO> selectBladeSmsTemplateList(SmsTemplateDTO bladeSmsTemplateDTO);
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.xml b/src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.xml
new file mode 100644
index 0000000..d38f610
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/mapper/SmsTemplateMapper.xml
@@ -0,0 +1,59 @@
+<?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="org.springblade.modules.smsTemplate.mapper.SmsTemplateMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="smsTemplateResultMap" type="org.springblade.modules.smsTemplate.entity.SmsTemplateEntity">
+ </resultMap>
+
+
+ <select id="selectSmsTemplatePage" resultMap="smsTemplateResultMap">
+ select * from blade_sms_template where is_deleted = 0
+ </select>
+
+
+
+ <resultMap type="org.springblade.modules.smsTemplate.dto.SmsTemplateDTO" id="BladeSmsTemplateDTOResult">
+ <result property="id" column="id" />
+ <result property="deptId" column="dept_id" />
+ <result property="content" column="content" />
+ <result property="createTime" column="create_time" />
+ <result property="updateTime" column="update_time" />
+ <result property="createBy" column="create_by" />
+ <result property="isDelete" column="is_delete" />
+ </resultMap>
+
+ <sql id="selectBladeSmsTemplate">
+ select
+ id,
+ dept_id,
+ content,
+ create_time,
+ update_time,
+ create_by,
+ is_delete
+ from
+ blade_sms_template
+ </sql>
+
+ <select id="selectBladeSmsTemplateById" parameterType="int" resultMap="BladeSmsTemplateDTOResult">
+ <include refid="selectBladeSmsTemplate"/>
+ where
+ id = #{id}
+ </select>
+
+ <select id="selectBladeSmsTemplateList" parameterType="org.springblade.modules.smsTemplate.dto.SmsTemplateDTO" resultMap="BladeSmsTemplateDTOResult">
+ <include refid="selectBladeSmsTemplate"/>
+ <where>
+ <if test="id != null "> and id = #{id}</if>
+ <if test="deptId != null "> and dept_id = #{deptId}</if>
+ <if test="content != null and content != ''"> and content = #{content}</if>
+ <if test="createTime != null "> and create_time = #{createTime}</if>
+ <if test="updateTime != null "> and update_time = #{updateTime}</if>
+ <if test="createBy != null "> and create_by = #{createBy}</if>
+ <if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
+ </where>
+ </select>
+
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/smsTemplate/service/ISmsTemplateService.java b/src/main/java/org/springblade/modules/smsTemplate/service/ISmsTemplateService.java
new file mode 100644
index 0000000..1522d5f
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/service/ISmsTemplateService.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.smsTemplate.dto.SmsTemplateDTO;
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import org.springblade.modules.smsTemplate.vo.SmsTemplateVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 短信模版表 服务类
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+public interface ISmsTemplateService extends IService<SmsTemplateEntity> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param smsTemplate
+ * @return
+ */
+ IPage<SmsTemplateVO> selectSmsTemplatePage(IPage<SmsTemplateVO> page, SmsTemplateVO smsTemplate);
+ /**
+ * 查询短信模版表
+ *
+ * @param id 短信模版表ID
+ * @return 短信模版表
+ */
+ public SmsTemplateDTO selectBladeSmsTemplateById(Integer id);
+
+ /**
+ * 查询短信模版表列表
+ *
+ * @param SmsTemplateDTO 短信模版表
+ * @return 短信模版表集合
+ */
+ public List<SmsTemplateDTO> selectBladeSmsTemplateList(SmsTemplateDTO SmsTemplateDTO);
+
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/service/impl/SmsTemplateServiceImpl.java b/src/main/java/org/springblade/modules/smsTemplate/service/impl/SmsTemplateServiceImpl.java
new file mode 100644
index 0000000..72f38fc
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/service/impl/SmsTemplateServiceImpl.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.modules.smsTemplate.dto.SmsTemplateDTO;
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import org.springblade.modules.smsTemplate.vo.SmsTemplateVO;
+import org.springblade.modules.smsTemplate.mapper.SmsTemplateMapper;
+import org.springblade.modules.smsTemplate.service.ISmsTemplateService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 短信模版表 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+@Service
+public class SmsTemplateServiceImpl extends ServiceImpl<SmsTemplateMapper, SmsTemplateEntity> implements ISmsTemplateService {
+
+ @Override
+ public IPage<SmsTemplateVO> selectSmsTemplatePage(IPage<SmsTemplateVO> page, SmsTemplateVO smsTemplate) {
+ List<SmsTemplateVO> smsTemplateVOS = baseMapper.selectSmsTemplatePage(page, smsTemplate);
+ return page.setRecords(smsTemplateVOS);
+ }
+
+ /**
+ * 查询短信模版表
+ *
+ * @param id 短信模版表ID
+ * @return 短信模版表
+ */
+ @Override
+ public SmsTemplateDTO selectBladeSmsTemplateById(Integer id)
+ {
+ return this.baseMapper.selectBladeSmsTemplateById(id);
+ }
+
+ /**
+ * 查询短信模版表列表
+ *
+ * @param SmsTemplateDTO 短信模版表
+ * @return 短信模版表集合
+ */
+ @Override
+ public List<SmsTemplateDTO> selectBladeSmsTemplateList(SmsTemplateDTO SmsTemplateDTO)
+ {
+ return this.baseMapper.selectBladeSmsTemplateList(SmsTemplateDTO);
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/vo/SmsTemplateVO.java b/src/main/java/org/springblade/modules/smsTemplate/vo/SmsTemplateVO.java
new file mode 100644
index 0000000..08afa1f
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/vo/SmsTemplateVO.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.vo;
+
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import org.springblade.core.tool.node.INode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 短信模版表 视图实体类
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SmsTemplateVO extends SmsTemplateEntity {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/smsTemplate/wrapper/SmsTemplateWrapper.java b/src/main/java/org/springblade/modules/smsTemplate/wrapper/SmsTemplateWrapper.java
new file mode 100644
index 0000000..2ed77fc
--- /dev/null
+++ b/src/main/java/org/springblade/modules/smsTemplate/wrapper/SmsTemplateWrapper.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.smsTemplate.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.smsTemplate.entity.SmsTemplateEntity;
+import org.springblade.modules.smsTemplate.vo.SmsTemplateVO;
+import java.util.Objects;
+
+/**
+ * 短信模版表 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2024-03-06
+ */
+public class SmsTemplateWrapper extends BaseEntityWrapper<SmsTemplateEntity, SmsTemplateVO> {
+
+ public static SmsTemplateWrapper build() {
+ return new SmsTemplateWrapper();
+ }
+
+ @Override
+ public SmsTemplateVO entityVO(SmsTemplateEntity smsTemplate) {
+ SmsTemplateVO smsTemplateVO = Objects.requireNonNull(BeanUtil.copy(smsTemplate, SmsTemplateVO.class));
+
+ //User createUser = UserCache.getUser(smsTemplate.getCreateUser());
+ //User updateUser = UserCache.getUser(smsTemplate.getUpdateUser());
+ //smsTemplateVO.setCreateUserName(createUser.getName());
+ //smsTemplateVO.setUpdateUserName(updateUser.getName());
+
+ return smsTemplateVO;
+ }
+
+
+}
--
Gitblit v1.9.3