完成的商品搜索和条件功能
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.mall.system.rest.controller.file;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 文件模块(Admins API)
|
||||
*
|
||||
* author: sin
|
||||
* time: 2020/4/20 9:41 上午
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admins/file")
|
||||
@Api(tags = "文件模块")
|
||||
public class AdminsFileController {
|
||||
|
||||
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,57 @@
|
||||
package cn.iocoder.mall.system.rest.controller.sms;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.biz.bo.smsSign.ListSmsSignBO;
|
||||
import cn.iocoder.mall.system.biz.dto.smsSign.ListSmsSignDTO;
|
||||
import cn.iocoder.mall.system.biz.service.sms.SmsService;
|
||||
import cn.iocoder.mall.system.rest.convert.sms.AdminsSmsConvert;
|
||||
import cn.iocoder.mall.system.rest.request.sms.AddSignRequest;
|
||||
import cn.iocoder.mall.system.rest.request.sms.UpdateSignRequest;
|
||||
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 AdminsSmsSignController {
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("签名-page")
|
||||
public CommonResult<PageResult<ListSmsSignBO>> pageSign(@Validated ListSmsSignDTO listSmsSignDTO) {
|
||||
return CommonResult.success(smsService.listSmsSign(listSmsSignDTO));
|
||||
}
|
||||
|
||||
@PostMapping("add")
|
||||
@ApiOperation("签名-添加")
|
||||
public CommonResult<?> addSign(@RequestBody AddSignRequest addSignRequest) {
|
||||
smsService.addSign(AdminsSmsConvert.INSTANCE.convert(addSignRequest));
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("签名-更新")
|
||||
public CommonResult<?> updateSign(@RequestBody UpdateSignRequest updateSignRequest) {
|
||||
smsService.updateSign(AdminsSmsConvert.INSTANCE.convert(updateSignRequest));
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@DeleteMapping("deleted")
|
||||
@ApiOperation("签名-删除")
|
||||
public CommonResult<?> deletedSign(@RequestParam("id") Integer id) {
|
||||
smsService.deleteSign(id);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.iocoder.mall.system.rest.controller.sms;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.system.biz.bo.smsTemplate.ListSmsTemplateBO;
|
||||
import cn.iocoder.mall.system.biz.service.sms.SmsService;
|
||||
import cn.iocoder.mall.system.rest.convert.sms.AdminsSmsConvert;
|
||||
import cn.iocoder.mall.system.rest.request.sms.AddSmsTemplateRequest;
|
||||
import cn.iocoder.mall.system.rest.request.sms.ListSmsTemplateRequest;
|
||||
import cn.iocoder.mall.system.rest.request.sms.UpdateSmsTemplateRequest;
|
||||
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 AdminsSmsTemplateController {
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@PostMapping("page")
|
||||
@ApiOperation("短信模板-page")
|
||||
public CommonResult<PageResult<ListSmsTemplateBO>> pageSign(@RequestBody ListSmsTemplateRequest request) {
|
||||
return CommonResult.success(smsService.listSmsTemplate(AdminsSmsConvert.INSTANCE.convert(request)));
|
||||
}
|
||||
|
||||
@PostMapping("add")
|
||||
@ApiOperation("短信模板-添加")
|
||||
public CommonResult addSign(@RequestBody AddSmsTemplateRequest smsTemplateAddPO) {
|
||||
smsService.addTemplate(
|
||||
smsTemplateAddPO.getSmsSignId(),
|
||||
smsTemplateAddPO.getTemplateCode(),
|
||||
smsTemplateAddPO.getTemplate(),
|
||||
smsTemplateAddPO.getPlatform(),
|
||||
smsTemplateAddPO.getSmsType());
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("短信模板-更新")
|
||||
public CommonResult updateSign(@RequestBody UpdateSmsTemplateRequest 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,32 @@
|
||||
package cn.iocoder.mall.system.rest.convert.sms;
|
||||
|
||||
import cn.iocoder.mall.system.biz.dto.smsSign.AddSignDTO;
|
||||
import cn.iocoder.mall.system.biz.dto.smsSign.UpdateSignDTO;
|
||||
import cn.iocoder.mall.system.biz.dto.smsTemplate.ListSmsTemplateDTO;
|
||||
import cn.iocoder.mall.system.rest.request.sms.AddSignRequest;
|
||||
import cn.iocoder.mall.system.rest.request.sms.UpdateSignRequest;
|
||||
import cn.iocoder.mall.system.rest.request.sms.ListSmsTemplateRequest;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* sms admins convert
|
||||
*
|
||||
* author: sin
|
||||
* time: 2020/4/20 11:07 上午
|
||||
*/
|
||||
@Mapper
|
||||
public interface AdminsSmsConvert {
|
||||
|
||||
AdminsSmsConvert INSTANCE = Mappers.getMapper(AdminsSmsConvert.class);
|
||||
|
||||
@Mappings({})
|
||||
AddSignDTO convert(AddSignRequest bean);
|
||||
|
||||
@Mappings({})
|
||||
UpdateSignDTO convert(UpdateSignRequest bean);
|
||||
|
||||
@Mappings({})
|
||||
ListSmsTemplateDTO convert(ListSmsTemplateRequest bean);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.mall.system.rest.request.admin;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: jiangweifan
|
||||
* @Date: 2020/5/12
|
||||
* @Description: 管理员 - 用户信息 - 更新用户信息
|
||||
*/
|
||||
@ApiModel("更新用户信息Request")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdminsUserUpdateRequest {
|
||||
|
||||
@ApiModelProperty(name = "id", value = "用户编号", required = true, example = "1")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(name = "nickname", value = "昵称", required = true, example = "小王")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(name = "avatar", value = "头像", required = true, example = "http://www.iocoder.cn/xxx.jpg")
|
||||
private String avatar;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.system.rest.request.sms;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 添加 sign
|
||||
*
|
||||
* author: sin
|
||||
* time: 2020/4/20 11:10 上午
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AddSignRequest implements Serializable {
|
||||
|
||||
private String sign;
|
||||
|
||||
private Integer platform;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.system.rest.request.sms;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.system.biz.enums.sms.SmsPlatformEnum;
|
||||
import cn.iocoder.mall.system.biz.enums.sms.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 AddSmsTemplateRequest 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,30 @@
|
||||
package cn.iocoder.mall.system.rest.request.sms;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* page 短信模板 query
|
||||
*
|
||||
* @author Sin
|
||||
* @time 2019/5/19 4:32 PM
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ListSmsTemplateRequest extends PageParam {
|
||||
|
||||
@NotNull
|
||||
private String id;
|
||||
|
||||
@NotNull
|
||||
private Integer smsSignId;
|
||||
|
||||
@NotNull
|
||||
private String template;
|
||||
|
||||
@NotNull
|
||||
private String applyStatus;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.mall.system.rest.request.sms;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 更新签名
|
||||
* <p>
|
||||
* author: sin
|
||||
* time: 2020/4/20 11:02 上午
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UpdateSignRequest implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String sign;
|
||||
|
||||
private Integer platform;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.mall.system.rest.request.sms;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.system.biz.enums.sms.SmsPlatformEnum;
|
||||
import cn.iocoder.mall.system.biz.enums.sms.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 UpdateSmsTemplateRequest 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;
|
||||
}
|
||||
12
moved/system/system-rest/src/main/resources/rest.yaml
Normal file
12
moved/system/system-rest/src/main/resources/rest.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
# 服务器的配置项
|
||||
server:
|
||||
port: 18083
|
||||
servlet:
|
||||
context-path: /system-api/
|
||||
|
||||
# Swagger 配置项
|
||||
swagger:
|
||||
title: 管理员子系统
|
||||
description: 管理员子系统
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.mall.system.rest.controller
|
||||
Reference in New Issue
Block a user