parent
fa2fd77719
commit
23864fac88
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.admin.application.controller.admins;
|
||||
|
||||
import cn.iocoder.mall.admin.api.SmsService;
|
||||
import cn.iocoder.mall.admin.api.dto.sms.PageQuerySmsSignDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 短信服务
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:26 PM
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("sms/sign")
|
||||
@Api("短信服务(签名)")
|
||||
public class SmsSignController {
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@PostMapping("page")
|
||||
@ApiOperation("签名-page")
|
||||
public void pageSign(PageQuerySmsSignDTO querySmsSignDTO) {
|
||||
smsService.pageSmsSign(querySmsSignDTO);
|
||||
}
|
||||
|
||||
@PostMapping("add")
|
||||
@ApiOperation("签名-添加")
|
||||
public void addSign(@RequestParam("sign") String sign,
|
||||
@RequestParam("platform") Integer platform) {
|
||||
smsService.addSign(sign, platform);
|
||||
}
|
||||
|
||||
@PostMapping("update")
|
||||
@ApiOperation("签名-更新")
|
||||
public void updateSign(@RequestParam("id") Integer id,
|
||||
@RequestParam("sign") String sign,
|
||||
@RequestParam("platform") Integer platform) {
|
||||
smsService.updateSign(id, sign, platform);
|
||||
}
|
||||
|
||||
@PostMapping("deleted")
|
||||
@ApiOperation("签名-删除")
|
||||
public void deletedSign(@RequestParam("id") Integer id) {
|
||||
smsService.deleteSign(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.mall.admin.application.controller.admins;
|
||||
|
||||
import cn.iocoder.mall.admin.api.SmsService;
|
||||
import cn.iocoder.mall.admin.api.dto.sms.PageQuerySmsSignDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.sms.PageQuerySmsTemplateDTO;
|
||||
import cn.iocoder.mall.admin.application.po.sms.SmsTemplateAddPO;
|
||||
import cn.iocoder.mall.admin.application.po.sms.SmsTemplateUpdatePO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 短信服务
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:26 PM
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("sms/template")
|
||||
@Api("短信服务(短信模板)")
|
||||
public class SmsTemplateController {
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@PostMapping("page")
|
||||
@ApiOperation("短信模板-page")
|
||||
public void pageSign(PageQuerySmsTemplateDTO pageQuerySmsTemplateDTO) {
|
||||
smsService.pageSmsTemplate(pageQuerySmsTemplateDTO);
|
||||
}
|
||||
|
||||
@PostMapping("add")
|
||||
@ApiOperation("短信模板-添加")
|
||||
public void addSign(SmsTemplateAddPO smsTemplateAddPO) {
|
||||
smsService.addTemplate(
|
||||
smsTemplateAddPO.getSmsSignId(),
|
||||
smsTemplateAddPO.getTemplateCode(),
|
||||
smsTemplateAddPO.getTemplate(),
|
||||
smsTemplateAddPO.getPlatform(),
|
||||
smsTemplateAddPO.getSmsType());
|
||||
}
|
||||
|
||||
@PostMapping("update")
|
||||
@ApiOperation("短信模板-更新")
|
||||
public void updateSign(SmsTemplateUpdatePO smsTemplateUpdatePO) {
|
||||
smsService.updateTemplate(
|
||||
smsTemplateUpdatePO.getId(),
|
||||
smsTemplateUpdatePO.getSmsSignId(),
|
||||
smsTemplateUpdatePO.getTemplateCode(),
|
||||
smsTemplateUpdatePO.getTemplate(),
|
||||
smsTemplateUpdatePO.getPlatform(),
|
||||
smsTemplateUpdatePO.getSmsType());
|
||||
}
|
||||
|
||||
@PostMapping("deleted")
|
||||
@ApiOperation("短信模板-删除")
|
||||
public void deletedSign(@RequestParam("id") Integer id) {
|
||||
smsService.deleteTemplate(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:36 PM
|
||||
*/
|
||||
package cn.iocoder.mall.admin.application.po;
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.admin.application.po.sms;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.admin.api.constant.SmsPlatformEnum;
|
||||
import cn.iocoder.mall.admin.api.constant.SmsTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 短信模板 add
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:37 PM
|
||||
*/
|
||||
@ApiModel("短信模板-添加")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SmsTemplateAddPO implements Serializable {
|
||||
|
||||
@ApiModelProperty("短信签名id")
|
||||
@NotNull(message = "短信短信签名id不能为空!")
|
||||
private Integer smsSignId;
|
||||
|
||||
@ApiModelProperty("短信模板code")
|
||||
@NotNull
|
||||
@Size(min = 3, max = 50, message = "短信code在 3-50 之间")
|
||||
private String templateCode;
|
||||
|
||||
@ApiModelProperty("短信模板")
|
||||
@NotNull
|
||||
@Size(min = 3, max = 255, message = "短信在 3-255 之间")
|
||||
private String template;
|
||||
|
||||
@ApiModelProperty("短信模板-平台")
|
||||
@NotNull
|
||||
@InEnum(value = SmsPlatformEnum.class)
|
||||
private Integer platform;
|
||||
|
||||
@ApiModelProperty("短信模板-平台")
|
||||
@NotNull
|
||||
@InEnum(value = SmsTypeEnum.class)
|
||||
private Integer smsType;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.admin.application.po.sms;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.admin.api.constant.SmsPlatformEnum;
|
||||
import cn.iocoder.mall.admin.api.constant.SmsTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 短信模板 add
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:37 PM
|
||||
*/
|
||||
@ApiModel("短信模板-添加")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SmsTemplateUpdatePO implements Serializable {
|
||||
|
||||
@ApiModelProperty("短信模板id")
|
||||
@NotNull(message = "短信模板不能为空!")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("短信签名id")
|
||||
@NotNull(message = "短信短信签名id不能为空!")
|
||||
private Integer smsSignId;
|
||||
|
||||
@ApiModelProperty("短信模板code")
|
||||
@NotNull
|
||||
@Size(min = 3, max = 50, message = "短信code在 3-50 之间")
|
||||
private String templateCode;
|
||||
|
||||
@ApiModelProperty("短信模板")
|
||||
@NotNull
|
||||
@Size(min = 3, max = 255, message = "短信在 3-255 之间")
|
||||
private String template;
|
||||
|
||||
@ApiModelProperty("短信模板-平台")
|
||||
@NotNull
|
||||
@InEnum(value = SmsPlatformEnum.class)
|
||||
private Integer platform;
|
||||
|
||||
@ApiModelProperty("短信模板-平台")
|
||||
@NotNull
|
||||
@InEnum(value = SmsTypeEnum.class)
|
||||
private Integer smsType;
|
||||
}
|
||||
Loading…
Reference in new issue