完成的商品搜索和条件功能
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.mall.system.application.controller.admins;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import com.qiniu.util.Auth;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("admins/file")
|
||||
@Api("文件模块")
|
||||
public class FileController {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Autowired
|
||||
private Auth auth;
|
||||
@Value("${qiniu.bucket}")
|
||||
private String bucket;
|
||||
|
||||
@GetMapping("/get-qiniu-token")
|
||||
public CommonResult<String> getQiniuToken() {
|
||||
String token = auth.uploadToken(bucket);
|
||||
logger.info("[qiniu_token][token({}) get]", token);
|
||||
return CommonResult.success(token);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.mall.system.application.controller.admins;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.system.api.SmsService;
|
||||
import cn.iocoder.mall.system.api.bo.sms.PageSmsSignBO;
|
||||
import cn.iocoder.mall.system.api.dto.sms.PageQuerySmsSignDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 短信服务
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:26 PM
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admins/sms/sign")
|
||||
@Api("短信服务(签名)")
|
||||
public class SmsSignController {
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("签名-page")
|
||||
public CommonResult<PageSmsSignBO> pageSign(@Validated PageQuerySmsSignDTO querySmsSignDTO) {
|
||||
return CommonResult.success(smsService.pageSmsSign(querySmsSignDTO));
|
||||
}
|
||||
|
||||
@PostMapping("add")
|
||||
@ApiOperation("签名-添加")
|
||||
public CommonResult addSign(@RequestParam("sign") String sign,
|
||||
@RequestParam("platform") Integer platform) {
|
||||
smsService.addSign(sign, platform);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("签名-更新")
|
||||
public CommonResult updateSign(@RequestParam("id") Integer id,
|
||||
@RequestParam("sign") String sign,
|
||||
@RequestParam("platform") Integer platform) {
|
||||
smsService.updateSign(id, sign, platform);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@DeleteMapping("deleted")
|
||||
@ApiOperation("签名-删除")
|
||||
public CommonResult deletedSign(@RequestParam("id") Integer id) {
|
||||
smsService.deleteSign(id);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.mall.system.application.controller.admins;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.system.api.SmsService;
|
||||
import cn.iocoder.mall.system.api.bo.sms.PageSmsTemplateBO;
|
||||
import cn.iocoder.mall.system.api.dto.sms.PageQuerySmsTemplateDTO;
|
||||
import cn.iocoder.mall.system.application.po.sms.SmsTemplateAddPO;
|
||||
import cn.iocoder.mall.system.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.*;
|
||||
|
||||
/**
|
||||
* 短信服务
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/26 12:26 PM
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admins/sms/template")
|
||||
@Api("短信服务(短信模板)")
|
||||
public class SmsTemplateController {
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("短信模板-page")
|
||||
public CommonResult<PageSmsTemplateBO> pageSign(PageQuerySmsTemplateDTO pageQuerySmsTemplateDTO) {
|
||||
return CommonResult.success(smsService.pageSmsTemplate(pageQuerySmsTemplateDTO));
|
||||
}
|
||||
|
||||
@PostMapping("add")
|
||||
@ApiOperation("短信模板-添加")
|
||||
public CommonResult addSign(SmsTemplateAddPO smsTemplateAddPO) {
|
||||
smsService.addTemplate(
|
||||
smsTemplateAddPO.getSmsSignId(),
|
||||
smsTemplateAddPO.getTemplateCode(),
|
||||
smsTemplateAddPO.getTemplate(),
|
||||
smsTemplateAddPO.getPlatform(),
|
||||
smsTemplateAddPO.getSmsType());
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("短信模板-更新")
|
||||
public CommonResult updateSign(SmsTemplateUpdatePO smsTemplateUpdatePO) {
|
||||
smsService.updateTemplate(
|
||||
smsTemplateUpdatePO.getId(),
|
||||
smsTemplateUpdatePO.getSmsSignId(),
|
||||
smsTemplateUpdatePO.getTemplateCode(),
|
||||
smsTemplateUpdatePO.getTemplate(),
|
||||
smsTemplateUpdatePO.getPlatform(),
|
||||
smsTemplateUpdatePO.getSmsType());
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@DeleteMapping("deleted")
|
||||
@ApiOperation("短信模板-删除")
|
||||
public CommonResult deletedSign(@RequestParam("id") Integer id) {
|
||||
smsService.deleteTemplate(id);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.system.application.po.sms;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.system.api.constant.SmsPlatformEnum;
|
||||
import cn.iocoder.mall.system.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.system.application.po.sms;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.system.api.constant.SmsPlatformEnum;
|
||||
import cn.iocoder.mall.system.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;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
spring:
|
||||
application:
|
||||
name: admin-application
|
||||
|
||||
# Spring Cloud 配置项
|
||||
cloud:
|
||||
# Spring Cloud Sentinel 配置项
|
||||
sentinel:
|
||||
transport:
|
||||
dashboard: s1.iocoder.cn:12088 # Sentinel Dashboard 服务地址
|
||||
eager: true # 项目启动时,直接连接到 Sentinel
|
||||
|
||||
# server
|
||||
server:
|
||||
port: 18083
|
||||
servlet:
|
||||
context-path: /admin-api/
|
||||
|
||||
admins:
|
||||
security:
|
||||
ignore_urls: /admin-api/admins/passport/login, /admin-api/admins/file/get-qiniu-token
|
||||
|
||||
# qiniu
|
||||
qiniu:
|
||||
access-key: YldfyUC7OewoWM63TPYTairqnq8GMJvNek9EGoID
|
||||
secret-key: zZ7Q8wwZRyaklVvkyLmVydA4WygOBqtc_gTYzalS
|
||||
bucket: onemall
|
||||
|
||||
swagger:
|
||||
enable: true # 暂时不去掉
|
||||
title: 管理员子系统
|
||||
description: 管理员子系统
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.mall.admin.application.controller
|
||||
Reference in New Issue
Block a user