master
王皓雯 6 years ago
parent 68c75b0650
commit 9b9d066459

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>mall-admin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="cloudfoundry.standalone.app" version="1.0"/>
</faceted-project>

@ -0,0 +1,142 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.macro.mall</groupId>
<artifactId>mall-admin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mall-admin</name>
<description>mall-admin project for mall</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.14.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<skipTests>true</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>com.macro.mall</groupId>
<artifactId>mall-mbg</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--MyBatis分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
<!--JWT(Json Web Token)登录支持-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.5.0</version>
</dependency>
<!--集成logstash-->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>4.8</version>
</dependency>
<!--集成druid连接池-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<!--lombok依赖-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>mall/${project.artifactId}:${project.version}</imageName>
<dockerHost>http://192.168.1.71:2375</dockerHost>
<baseImage>java:8</baseImage>
<entryPoint>["java", "-jar", "-Dspring.profiles.active=prod","/${project.build.finalName}.jar"]</entryPoint>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,18 @@
package com.macro.mall;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Ó¦ÓÃÆô¯Èë¿Ú
*/
@SpringBootApplication
@MapperScan({"com.macro.mall.mapper","com.macro.mall.dao"})
@EnableTransactionManagement
public class MallAdminApplication {
public static void main(String[] args) {
SpringApplication.run(MallAdminApplication.class, args);
}
}

@ -1 +0,0 @@
package com.sock.mall.bo; import com.sock.mall.model.UmsAdmin; import com.sock.mall.model.UmsPermission; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; /** * SpringSecurity需要的用户详情 */ public class AdminUserDetails implements UserDetails { private UmsAdmin umsAdmin; private List<UmsPermission> permissionList; public AdminUserDetails(UmsAdmin umsAdmin,List<UmsPermission> permissionList) { this.umsAdmin = umsAdmin; this.permissionList = permissionList; } @Override public Collection<? extends GrantedAuthority> getAuthorities() { //返回当前用户的权限 return permissionList.stream() .filter(permission -> permission.getValue()!=null) .map(permission ->new SimpleGrantedAuthority(permission.getValue())) .collect(Collectors.toList()); } @Override /*登录密码*/ public String getPassword() { return umsAdmin.getPassword(); } @Override /*登录名称*/ public String getUsername() { return umsAdmin.getUsername(); } @Override /*有效性验证(是否过期)*/ public boolean isAccountNonExpired() { return true; } @Override /*有效性验证(是否被锁)*/ public boolean isAccountNonLocked() { return true; } @Override /*验证证书是否有效*/ public boolean isCredentialsNonExpired() { return true; } @Override /*状态判断890-*/ public boolean isEnabled() { return umsAdmin.getStatus().equals(1); } }

@ -1 +0,0 @@
package com.sock.mall.bo; /** * Controller层的日志封装类 */ public class WebLog { /** * 操作描述 */ private String description; /** * 操作用户 */ private String username; /** * 操作时间 */ private Long startTime; /** * 消耗时间 */ private Integer spendTime; /** * 根路径 */ private String basePath; /** * URI */ private String uri; /** * URL */ private String url; /** * 请求类型 */ private String method; /** * IP地址 */ private String ip; private Object parameter; private Object result; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public Long getStartTime() { return startTime; } public void setStartTime(Long startTime) { this.startTime = startTime; } public Integer getSpendTime() { return spendTime; } public void setSpendTime(Integer spendTime) { this.spendTime = spendTime; } public String getBasePath() { return basePath; } public void setBasePath(String basePath) { this.basePath = basePath; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } public Object getParameter() { return parameter; } public void setParameter(Object parameter) { this.parameter = parameter; } public Object getResult() { return result; } public void setResult(Object result) { this.result = result; } }

@ -1,43 +0,0 @@
package com.macro.mall.component;
import com.macro.mall.dto.CommonResult;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult;
/**
* HibernateValidator
*/
@Aspect
@Component
@Order(2)
public class BindingResultAspect {
@Pointcut("execution(public * com.macro.mall.controller.*.*(..))")
/*SpringMVC的参数验证*/
/*Spring验证的错误返回BindingResult*/
public void BindingResult() {
}
@Around("BindingResult()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
/*Around(value="BindingResult()"*/
Object[] args = joinPoint.getArgs();
for (Object arg : args) {
if (arg instanceof BindingResult) {
/*参数正常,验证通过*/
BindingResult result = (BindingResult) arg;
if (result.hasErrors()) {
/*传递参数有误*/
return new CommonResult().validateFailed(result);
/* 验证不通过,产生异常*/
/*返回错误文件,错误信息*/
}
}
}
return joinPoint.proceed();//调用AOP中环绕通知中proceed方法
}
}

@ -1,60 +0,0 @@
package com.macro.mall.component;
import com.macro.mall.util.JwtTokenUtil;
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.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* JWT
*/
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
private static final Logger LOGGER = LoggerFactory.getLogger(JwtAuthenticationTokenFilter.class);
/*声明Log4jUtils类处理Logger的操作*/
@Autowired
private UserDetailsService userDetailsService;//用户详细信息服务
@Autowired
private JwtTokenUtil jwtTokenUtil;//jwt登录授权
@Value("${jwt.tokenHeader}")
private String tokenHeader;//登录表头
@Value("${jwt.tokenHead}")
private String tokenHead;
@Override
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain) throws ServletException, IOException {
/*Filter方法实现过滤功能*/
String authHeader = request.getHeader(this.tokenHeader);
if (authHeader != null && authHeader.startsWith(this.tokenHead)) {
String authToken = authHeader.substring(this.tokenHead.length());// The part after "Bearer "
String username = jwtTokenUtil.getUserNameFromToken(authToken);
LOGGER.info("checking username:{}", username);
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
if (jwtTokenUtil.validateToken(authToken, userDetails)) {
/*将验证信息放入SecurityContextHolder中UsernamePasswordAuthenticationToken是Security验证账号密码的工具类*/
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
LOGGER.info("authenticated user:{}", username);
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
}
chain.doFilter(request, response);//将请求转发给过滤器链上下一个对象
}
}

@ -1,26 +0,0 @@
package com.macro.mall.component;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.util.JsonUtil;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* token访
*/
@Component
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {//密码输入错误
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(JsonUtil.objectToJson(new CommonResult().unauthorized(authException.getMessage())));
response.getWriter().flush();
}
}

@ -1,28 +0,0 @@
package com.macro.mall.component;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.util.JsonUtil;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 访
*/
@Component
public class RestfulAccessDeniedHandler implements AccessDeniedHandler{//没有访问权限
@Override
public void handle(HttpServletRequest request,
HttpServletResponse response,
AccessDeniedException e) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(JsonUtil.objectToJson(new CommonResult().forbidden(e.getMessage())));
response.getWriter().flush();
}
}

@ -1,127 +0,0 @@
package com.macro.mall.component;
import com.macro.mall.bo.WebLog;
import com.macro.mall.util.JsonUtil;
import com.macro.mall.util.RequestUtil;
import io.swagger.annotations.ApiOperation;
import net.logstash.logback.marker.Markers;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
@Aspect//将java类定义为切面类
@Component
@Order(1)
public class WebLogAspect {
private static final Logger LOGGER = LoggerFactory.getLogger(WebLogAspect.class);
private ThreadLocal<Long> startTime = new ThreadLocal<>();
/**
*
* ~*
* ~*controller
* ~*
* ~..
*/
@Pointcut("execution(public * com.macro.mall.controller.*.*(..))")
public void webLog() {
}
@Before("webLog()")
public void doBefore(JoinPoint joinPoint) throws Throwable {
startTime.set(System.currentTimeMillis());
}
@AfterReturning(value = "webLog()", returning = "ret")
public void doAfterReturning(Object ret) throws Throwable {
}
@Around("webLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
//获取当前请求对象
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
//记录请求信息(通过logstash传入elasticsearch)
WebLog webLog = new WebLog();
Object result = joinPoint.proceed();
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method.isAnnotationPresent(ApiOperation.class)) {
ApiOperation log = method.getAnnotation(ApiOperation.class);
webLog.setDescription(log.value());
}
long endTime = System.currentTimeMillis();
webLog.setBasePath(RequestUtil.getBasePath(request));
webLog.setIp(request.getRemoteUser());
webLog.setMethod(request.getMethod());
webLog.setParameter(getParameter(method, joinPoint.getArgs()));
webLog.setResult(result);
webLog.setSpendTime((int) (endTime - startTime.get()));
webLog.setStartTime(startTime.get());
webLog.setUri(request.getRequestURI());
webLog.setUrl(request.getRequestURL().toString());
Map<String,Object> logMap = new HashMap<>();
logMap.put("url",webLog.getUrl());
logMap.put("method",webLog.getMethod());
logMap.put("parameter",webLog.getParameter());
logMap.put("spendTime",webLog.getSpendTime());
logMap.put("description",webLog.getDescription());
// LOGGER.info("{}", JsonUtil.objectToJson(webLog));
LOGGER.info(Markers.appendEntries(logMap),JsonUtil.objectToJson(webLog));
return result;//处理完请求,返回内容
}
/**
*
*/
private Object getParameter(Method method, Object[] args) {
List<Object> argList = new ArrayList<>();//ArrayList[]是LIst[Object]的子类
Parameter[] parameters = method.getParameters();
for (int i = 0; i < parameters.length; i++) {
RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class);//getAnnotation用于返回元素的指定类型的注释
if (requestBody != null) {//对应Http请求body不为空
argList.add(args[i]);//增加
}
RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class);
if (requestParam != null) {//请求参数不为空
Map<String, Object> map = new HashMap<>(); //map容器
String key = parameters[i].getName();//获取名称
if (!StringUtils.isEmpty(requestParam.value())) {//值不空key返回参数值
key = requestParam.value();
}
map.put(key, args[i]);//将argue[i]放入key中
argList.add(map);//增加一个mapmap中放着i=n时的arg值
}
}
if (argList.size() == 0) {//长度为0时返回空
return null;
} else if (argList.size() == 1) {//长度为1时返回整张表的值
return argList.get(0);
} else {
return argList;
}
}
}

@ -1,21 +0,0 @@
package com.macro.mall.config;
import com.aliyun.oss.OSSClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class OssConfig {//阿里云OSS配置类用来获取基本信息
@Value("${aliyun.oss.endpoint}")
private String ALIYUN_OSS_ENDPOINT;//OSS端口
@Value("${aliyun.oss.accessKeyId}")
private String ALIYUN_OSS_ACCESSKEYID;//访问密钥ID
@Value("${aliyun.oss.accessKeySecret}")
private String ALIYUN_OSS_ACCESSKEYSECRET;//附属密钥
@Bean
public OSSClient ossClient(){//OSS服务的java客户端与OSS服务进行交互
return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET);
}
}

@ -1,132 +0,0 @@
package com.macro.mall.config;
import com.macro.mall.bo.AdminUserDetails;
import com.macro.mall.component.JwtAuthenticationTokenFilter;
import com.macro.mall.component.RestAuthenticationEntryPoint;
import com.macro.mall.component.RestfulAccessDeniedHandler;
import com.macro.mall.model.UmsAdmin;
import com.macro.mall.model.UmsPermission;
import com.macro.mall.service.UmsAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.util.List;
/**
* SpringSecurity
*/
@Configuration//Configure方法用来配置访问资源对应的权限
@EnableWebSecurity//开启Spring Security:在配置类头上加注解@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled=true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {//SecurityConfig类
@Autowired
private UmsAdminService adminService;//服务
@Autowired
private RestfulAccessDeniedHandler restfulAccessDeniedHandler;//被拒绝者
@Autowired
private RestAuthenticationEntryPoint restAuthenticationEntryPoint;//重新认证
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity.csrf()// 由于使用的是JWT所以不需要csrf
.disable()
.sessionManagement()// 基于token因此不需要session
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers(HttpMethod.GET, // 允许对于网站静态资源的无授权访问
"/",
"/*.html",
"/favicon.ico",
"/**/*.html",
"/**/*.css",
"/**/*.js",
"/swagger-resources/**",
"/v2/api-docs/**"
)
/*permitAll()方法声明允许在未验证时任何访问到的资源和URL如果不加则连访问/login 都会一直被重定向*/
.permitAll()
.antMatchers("/admin/login", "/admin/register")// 对登录注册要允许匿名访问
.permitAll()
.antMatchers(HttpMethod.OPTIONS)//跨域请求会先进行一次options请求
.permitAll()
.antMatchers("/**")//测试时全部运行访问
.permitAll()
.anyRequest()// 除上面外的所有请求全部需要鉴权认证
.authenticated();
/*HttpSecurity类类似XML配置中的<http>元素可以配置基于web的安全请求,默认下,它会作用于所有的请求*/
// 禁用缓存
httpSecurity.headers().cacheControl();
// 添加JWT filter
httpSecurity.addFilterBefore(jwtAuthenticationTokenFilter(), UsernamePasswordAuthenticationFilter.class);
//添加自定义未授权和未登录结果返回
httpSecurity.exceptionHandling()
.accessDeniedHandler(restfulAccessDeniedHandler)
.authenticationEntryPoint(restAuthenticationEntryPoint);
}
@Override
/*只有密码登录才能访问*/
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService())
.passwordEncoder(passwordEncoder());
}
@Bean
public PasswordEncoder passwordEncoder() {//密码编码
return new Md5PasswordEncoder();
}
@Bean
public UserDetailsService userDetailsService() {
//获取登录用户信息
return username -> {
UmsAdmin admin = adminService.getAdminByUsername(username);
if (admin != null) {
List<UmsPermission> permissionList = adminService.getPermissionList(admin.getId());
return new AdminUserDetails(admin,permissionList);
}
throw new UsernameNotFoundException("用户名或密码错误");
};
}
@Bean
public JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter(){
return new JwtAuthenticationTokenFilter();//返回新的过滤器类
}
/**
*
*/
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("*");//增加
config.setAllowCredentials(true);//设置
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
bean.setOrder(0);
return new CorsFilter(source);//返回新的过滤器的值
}
}

@ -1,37 +0,0 @@
package com.macro.mall.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* Swagger2API
*/
@Configuration
@EnableSwagger2
public class Swagger2Config {//swagger2配置
@Bean
public Docket createRestApi(){
return new Docket(DocumentationType.SWAGGER_2)//标签
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.macro.mall.controller"))
.paths(PathSelectors.any())
.build();
}
/*自定义返回信息*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("mall后台系统")
.description("mall后台模块")
.contact("macro")
.version("1.0")
.build();
}
}

@ -1,33 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.CmsPrefrenceArea;
import com.macro.mall.service.CmsPrefrenceAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* Controller
*/
@Controller//控制器处理由DispatcherServlet分发的请求
@Api(tags = "CmsPrefrenceAreaController", description = "商品优选管理")
@RequestMapping("/prefrenceArea")//映射
public class CmsPrefrenceAreaController {
@Autowired//注入资源,减少设置
private CmsPrefrenceAreaService prefrenceAreaService;
@ApiOperation("获取所有商品优选")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)//表示当请求/listAll.do的时候访问的是CmsPrefrenceAreaController的liseAll方法
@ResponseBody//对象转换写入body区返回JSON数据或者XML
public Object listAll() {
List<CmsPrefrenceArea> prefrenceAreaList = prefrenceAreaService.listAll();
return new CommonResult().success(prefrenceAreaList);//成功则返回包括全部商品的listAll表
}
}

@ -1,44 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.CmsSubject;
import com.macro.mall.service.CmsSubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "CmsSubjectController", description = "商品专题管理")
@RequestMapping("/subject")
public class CmsSubjectController {
@Autowired
private CmsSubjectService subjectService;
@ApiOperation("获取全部商品专题")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
@ResponseBody
public Object listAll() {
List<CmsSubject> subjectList = subjectService.listAll();
return new CommonResult().success(subjectList);
}
@ApiOperation(value = "根据专题名称分页获取专题")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
/*@RequestParam绑定HTTPServletRequest请求参数到控制器参数*/
public Object getList(@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
List<CmsSubject> subjectList = subjectService.list(keyword, pageNum, pageSize);
return new CommonResult().pageSuccess(subjectList);
}

@ -1,34 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.OmsCompanyAddress;
import com.macro.mall.service.OmsCompanyAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* Controller
* Created by macro on 2018/10/18.
*/
@Controller
@Api(tags = "OmsCompanyAddressController", description = "收货地址管理")
@RequestMapping("/companyAddress")
public class OmsCompanyAddressController {
@Autowired
private OmsCompanyAddressService companyAddressService;
@ApiOperation("获取所有收货地址")
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ResponseBody
public Object list() {
List<OmsCompanyAddress> companyAddressList = companyAddressService.list();
return new CommonResult().success(companyAddressList);
}
}

@ -1,110 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.*;
import com.macro.mall.model.OmsOrder;
import com.macro.mall.service.OmsOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
* Created by macro on 2018/10/11.
*/
@Controller
@Api(tags = "OmsOrderController", description = "订单管理")
@RequestMapping("/order")
public class OmsOrderController {
@Autowired
private OmsOrderService orderService;
@ApiOperation("查询订单")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(OmsOrderQueryParam queryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<OmsOrder> orderList = orderService.list(queryParam, pageSize, pageNum);
return new CommonResult().pageSuccess(orderList);
}
@ApiOperation("批量发货")
@RequestMapping(value = "/update/delivery", method = RequestMethod.POST)
@ResponseBody
public Object delivery(@RequestBody List<OmsOrderDeliveryParam> deliveryParamList) {
int count = orderService.delivery(deliveryParamList);//请求发送订单数量
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量关闭订单")
@RequestMapping(value = "/update/close", method = RequestMethod.POST)
@ResponseBody
public Object close(@RequestParam("ids") List<Long> ids,@RequestParam String note) {
int count = orderService.close(ids,note);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量删除订单")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = orderService.delete(ids);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取订单详情:订单信息、商品信息、操作记录")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object detail(@PathVariable Long id) {
OmsOrderDetail orderDetailResult = orderService.detail(id);
return new CommonResult().success(orderDetailResult);
}
@ApiOperation("修改收货人信息")
@RequestMapping(value = "/update/receiverInfo", method = RequestMethod.POST)
@ResponseBody
public Object updateReceiverInfo(@RequestBody OmsReceiverInfoParam receiverInfoParam) {
int count = orderService.updateReceiverInfo(receiverInfoParam);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改订单费用信息")
@RequestMapping(value = "/update/moneyInfo", method = RequestMethod.POST)
@ResponseBody
public Object updateReceiverInfo(@RequestBody OmsMoneyInfoParam moneyInfoParam) {
int count = orderService.updateMoneyInfo(moneyInfoParam);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("备注订单")
@RequestMapping(value = "/update/note", method = RequestMethod.POST)
@ResponseBody
public Object updateNote(@RequestParam("id") Long id,
@RequestParam("note") String note,
@RequestParam("status") Integer status) {//状态
int count = orderService.updateNote(id,note,status);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
}

@ -1,68 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.OmsOrderReturnApplyResult;
import com.macro.mall.dto.OmsReturnApplyQueryParam;
import com.macro.mall.dto.OmsUpdateStatusParam;
import com.macro.mall.model.OmsOrderReturnApply;
import com.macro.mall.service.OmsOrderReturnApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 退
*/
@Controller
@Api(tags = "OmsOrderReturnApplyController", description = "订单退货申请管理")
@RequestMapping("/returnApply")
public class OmsOrderReturnApplyController {//退货请求
@Autowired
private OmsOrderReturnApplyService returnApplyService;
@ApiOperation("分页查询退货申请")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(OmsReturnApplyQueryParam queryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<OmsOrderReturnApply> returnApplyList = returnApplyService.list(queryParam, pageSize, pageNum);
return new CommonResult().pageSuccess(returnApplyList);
}
@ApiOperation("批量删除申请")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = returnApplyService.delete(ids);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取退货申请详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
/*@PathVariable绑定URL占位符参数到控制器参数中*/
public Object getItem(@PathVariable Long id) {
OmsOrderReturnApplyResult result = returnApplyService.getItem(id);
return new CommonResult().success(result);
}
@ApiOperation("修改申请状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateStatus(@PathVariable Long id, @RequestBody OmsUpdateStatusParam statusParam) {
int count = returnApplyService.updateStatus(id, statusParam);
if (count > 0) {
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
}

@ -1,85 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.OmsOrderReturnReason;
import com.macro.mall.service.OmsOrderReturnReasonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 退Controller
*/
@Controller
@Api(tags = "OmsOrderReturnReasonController", description = "退货原因管理")
@RequestMapping("/returnReason")
public class OmsOrderReturnReasonController {
@Autowired
private OmsOrderReturnReasonService orderReturnReasonService;
@ApiOperation("添加退货原因")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody OmsOrderReturnReason returnReason) {//添加退货原因
int count = orderReturnReasonService.create(returnReason);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改退货原因")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody OmsOrderReturnReason returnReason) {
int count = orderReturnReasonService.update(id,returnReason);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量删除退货原因")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = orderReturnReasonService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("分页查询全部退货原因")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<OmsOrderReturnReason> reasonList = orderReturnReasonService.list(pageSize,pageNum);
return new CommonResult().pageSuccess(reasonList);
}
@ApiOperation("获取单个退货原因详情信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
OmsOrderReturnReason reason = orderReturnReasonService.getItem(id);
return new CommonResult().success(reason);
}
@ApiOperation("修改退货原因启用状态")
@RequestMapping(value = "/update/status", method = RequestMethod.POST)
@ResponseBody
public Object updateStatus(@RequestParam(value = "status") Integer status,
@RequestParam("ids") List<Long> ids) {//修改状态
int count = orderReturnReasonService.updateStatus(ids,status);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
}

@ -1,40 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.OmsOrderSetting;
import com.macro.mall.service.OmsOrderSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
* <EFBFBD>Controller
*/
@Controller
@Api(tags = "OmsOrderSettingController", description = "땐데<EB9590>零밗잿")
@RequestMapping("/orderSetting")
public class OmsOrderSettingController {
@Autowired
private OmsOrderSettingService orderSettingService;
@ApiOperation("삿혤寧땍땐데<EB9590>零")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {//삿혤斤口
OmsOrderSetting orderSetting = orderSettingService.getItem(id);
return new CommonResult().success(orderSetting);
}
@ApiOperation("錦맣寧땍땐데<EB9590>零")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody OmsOrderSetting orderSetting) {
int count = orderSettingService.update(id,orderSetting);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
}

@ -1,42 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.OssCallbackResult;
import com.macro.mall.dto.OssPolicyResult;
import com.macro.mall.service.impl.OssServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* Oss
*/
@Controller
@Api(tags = "OssController",description = "Oss管理")
@RequestMapping("/aliyun/oss")
public class OssController {
@Autowired
private OssServiceImpl ossService;//阿里云服务
@ApiOperation(value = "oss上传签名生成")
@RequestMapping(value = "/policy",method = RequestMethod.GET)
@ResponseBody
public Object policy() {
OssPolicyResult result = ossService.policy();
return new CommonResult().success(result);
}
@ApiOperation(value = "oss上传成功回调")//阿里云存储
@RequestMapping(value = "callback",method = RequestMethod.POST)
@ResponseBody
public Object callback(HttpServletRequest request) {
OssCallbackResult ossCallbackResult = ossService.callback(request);
return new CommonResult().success(ossCallbackResult);
}
}

@ -1,138 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.PmsBrandParam;
import com.macro.mall.service.PmsBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "PmsBrandController",description = "商品品牌管理")
@RequestMapping("/brand")
public class PmsBrandController {
@Autowired
private PmsBrandService brandService;//品牌服务
@ApiOperation(value = "获取全部品牌列表")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:read')")//将登陆用户的roles/permissions参数传到方法中
public Object getList() {//获取列表
return new CommonResult().success(brandService.listAllBrand());
}
@ApiOperation(value = "添加品牌")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:create')")
public Object create(@Validated @RequestBody PmsBrandParam pmsBrand, BindingResult result) {//添加
CommonResult commonResult;
int count = brandService.createBrand(pmsBrand);
if (count == 1) {
commonResult = new CommonResult().success(count);
} else {
commonResult = new CommonResult().failed();
}
return commonResult;
}
@ApiOperation(value = "更新品牌")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:update')")
public Object update(@PathVariable("id") Long id,
@Validated @RequestBody PmsBrandParam pmsBrandParam,
BindingResult result) {
CommonResult commonResult;
int count = brandService.updateBrand(id, pmsBrandParam);
if (count == 1) {
commonResult = new CommonResult().success(count);
} else {
commonResult = new CommonResult().failed();
}
return commonResult;
}
@ApiOperation(value = "删除品牌")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:delete')")
public Object delete(@PathVariable("id") Long id) {
int count = brandService.deleteBrand(id);
if (count == 1) {
return new CommonResult().success(null);
} else {
return new CommonResult().failed();
}
}
@ApiOperation(value = "根据品牌名称分页获取品牌列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:read')")
public Object getList(@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
return new CommonResult().pageSuccess(brandService.listBrand(keyword, pageNum, pageSize));
}
@ApiOperation(value = "根据编号查询品牌信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:read')")
public Object getItem(@PathVariable("id") Long id) {//获取信息
return new CommonResult().success(brandService.getBrand(id));
}
@ApiOperation(value = "批量删除品牌")
@RequestMapping(value = "/delete/batch", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:delete')")
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
int count = brandService.deleteBrand(ids);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量更新显示状态")
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:update')")
public Object updateShowStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("showStatus") Integer showStatus) {//更新状态
int count = brandService.updateShowStatus(ids, showStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation(value = "批量更新厂家制造商状态")
@RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:update')")
public Object updateFactoryStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("factoryStatus") Integer factoryStatus) {
int count = brandService.updateFactoryStatus(ids, factoryStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

@ -1,84 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.model.PmsProductAttributeCategory;
import com.macro.mall.service.PmsProductAttributeCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "PmsProductAttributeCategoryController", description = "商品属性分类管理")
@RequestMapping("/productAttribute/category")
public class PmsProductAttributeCategoryController {
@Autowired
private PmsProductAttributeCategoryService productAttributeCategoryService;
@ApiOperation("添加商品属性分类")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestParam String name) {
int count = productAttributeCategoryService.create(name);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改商品属性分类")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestParam String name) {
int count = productAttributeCategoryService.update(id, name);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("删除单个商品属性分类")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
@ResponseBody
public Object delete(@PathVariable Long id) {
int count = productAttributeCategoryService.delete(id);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("获取单个商品属性分类信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
PmsProductAttributeCategory productAttributeCategory = productAttributeCategoryService.getItem(id);
return new CommonResult().success(productAttributeCategory);
}
@ApiOperation("分页获取所有商品属性分类")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object getList(@RequestParam(defaultValue = "5") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum) {
List<PmsProductAttributeCategory> productAttributeCategoryList = productAttributeCategoryService.getList(pageSize, pageNum);
return new CommonResult().pageSuccess(productAttributeCategoryList);
}
@ApiOperation("获取所有商品属性分类及其下属性")
@RequestMapping(value = "/list/withAttr", method = RequestMethod.GET)
@ResponseBody
public Object getListWithAttr() {
List<PmsProductAttributeCategoryItem> productAttributeCategoryResultList = productAttributeCategoryService.getListWithAttr();
return new CommonResult().success(productAttributeCategoryResultList);
}
}

@ -1,94 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.PmsProductAttributeParam;
import com.macro.mall.dto.ProductAttrInfo;
import com.macro.mall.model.PmsProductAttribute;
import com.macro.mall.service.PmsProductAttributeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "PmsProductAttributeController", description = "商品属性管理")
@RequestMapping("/productAttribute")
public class PmsProductAttributeController {
@Autowired
private PmsProductAttributeService productAttributeService;//商品属性服务
@ApiOperation("根据分类查询属性列表或参数列表")
@ApiImplicitParams({@ApiImplicitParam(name = "type", value = "0表示属性1表示参数", required = true, paramType = "query", dataType = "integer")})
@RequestMapping(value = "/list/{cid}", method = RequestMethod.GET)
@ResponseBody
public Object getList(@PathVariable Long cid,
@RequestParam(value = "type") Integer type,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {//获取列表
List<PmsProductAttribute> productAttributeList = productAttributeService.getList(cid, type, pageSize, pageNum);
return new CommonResult().pageSuccess(productAttributeList);
}
@ApiOperation("添加商品属性信息")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody PmsProductAttributeParam productAttributeParam, BindingResult bindingResult) {
int count = productAttributeService.create(productAttributeParam);//商品属性服务
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改商品属性信息")
@RequestMapping(value = "/update/{id}",method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id,@RequestBody PmsProductAttributeParam productAttributeParam,BindingResult bindingResult){//更新属性内容
int count = productAttributeService.update(id,productAttributeParam);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("查询单个商品属性")
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id){//获取信息
PmsProductAttribute productAttribute = productAttributeService.getItem(id);
return new CommonResult().success(productAttribute);
}
@ApiOperation("批量删除商品属性")
@RequestMapping(value = "/delete",method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids){
int count = productAttributeService.delete(ids);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("根据商品分类的id获取商品属性及属性分类")
@RequestMapping(value = "/attrInfo/{productCategoryId}",method = RequestMethod.GET)
@ResponseBody
public Object getAttrInfo(@PathVariable Long productCategoryId){//获取属性信息
List<ProductAttrInfo> productAttrInfoList = productAttributeService.getProductAttrInfo(productCategoryId);
return new CommonResult().success(productAttrInfoList);
}
}

@ -1,126 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.PmsProductCategoryParam;
import com.macro.mall.dto.PmsProductCategoryWithChildrenItem;
import com.macro.mall.model.PmsProductCategory;
import com.macro.mall.service.PmsProductCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "PmsProductCategoryController", description = "商品分类管理")
@RequestMapping("/productCategory")
public class PmsProductCategoryController {//商品分类控制器
@Autowired
private PmsProductCategoryService productCategoryService;//商品分类服务
@ApiOperation("添加产品分类")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:create')")
public Object create(@Validated @RequestBody PmsProductCategoryParam productCategoryParam,
BindingResult result) {
int count = productCategoryService.create(productCategoryParam);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改商品分类")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:update')")
public Object update(@PathVariable Long id,
@Validated
@RequestBody PmsProductCategoryParam productCategoryParam,
BindingResult result) {
int count = productCategoryService.update(id, productCategoryParam);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("分页查询商品分类")
@RequestMapping(value = "/list/{parentId}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:read')")
public Object getList(@PathVariable Long parentId,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<PmsProductCategory> productCategoryList = productCategoryService.getList(parentId, pageSize, pageNum);
return new CommonResult().pageSuccess(productCategoryList);
}
@ApiOperation("根据id获取商品分类")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:read')")
public Object getItem(@PathVariable Long id) {
PmsProductCategory productCategory = productCategoryService.getItem(id);
return new CommonResult().success(productCategory);
}
@ApiOperation("删除商品分类")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:delete')")
public Object delete(@PathVariable Long id) {
int count = productCategoryService.delete(id);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改导航栏显示状态")
@RequestMapping(value = "/update/navStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:update')")
public Object updateNavStatus(@RequestParam("ids") List<Long> ids, @RequestParam("navStatus") Integer navStatus) {
int count = productCategoryService.updateNavStatus(ids, navStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("修改显示状态")
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:update')")
public Object updateShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus) {
int count = productCategoryService.updateShowStatus(ids, showStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("查询所有一级分类及子分类")
@RequestMapping(value = "/list/withChildren", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:productCategory:read')")
public Object listWithChildren() {//携带子分类
List<PmsProductCategoryWithChildrenItem> list = productCategoryService.listWithChildren();
return new CommonResult().success(list);
}
}

@ -1,153 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.PmsProductParam;
import com.macro.mall.dto.PmsProductQueryParam;
import com.macro.mall.dto.PmsProductResult;
import com.macro.mall.model.PmsProduct;
import com.macro.mall.service.PmsProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "PmsProductController", description = "商品管理")
@RequestMapping("/product")
public class PmsProductController {
@Autowired
private PmsProductService productService;
@ApiOperation("创建商品")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:create')")
public Object create(@RequestBody PmsProductParam productParam, BindingResult bindingResult) {//创建(添加)商品
int count = productService.create(productParam);//商品服务
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("根据商品id获取商品编辑信息")
@RequestMapping(value = "/updateInfo/{id}", method = RequestMethod.GET)//更新信息
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:read')")
public Object getUpdateInfo(@PathVariable Long id) {
PmsProductResult productResult = productService.getUpdateInfo(id);
return new CommonResult().success(productResult);
}
@ApiOperation("更新商品")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public Object update(@PathVariable Long id, @RequestBody PmsProductParam productParam, BindingResult bindingResult) {
int count = productService.update(id, productParam);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("查询商品")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:read')")
public Object getList(PmsProductQueryParam productQueryParam,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<PmsProduct> productList = productService.list(productQueryParam, pageSize, pageNum);
return new CommonResult().pageSuccess(productList);
}
@ApiOperation("根据商品名称或货号模糊查询")
@RequestMapping(value = "/simpleList", method = RequestMethod.GET)
@ResponseBody
public Object getList(String keyword) {//模糊查询
List<PmsProduct> productList = productService.list(keyword);
return new CommonResult().success(productList);
}
@ApiOperation("批量修改审核状态")
@RequestMapping(value = "/update/verifyStatus",method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public Object updateVerifyStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("verifyStatus") Integer verifyStatus,//审核状态
@RequestParam("detail") String detail) {
int count = productService.updateVerifyStatus(ids, verifyStatus, detail);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("批量上下架")
@RequestMapping(value = "/update/publishStatus",method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public Object updatePublishStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("publishStatus") Integer publishStatus) {
int count = productService.updatePublishStatus(ids, publishStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("批量推荐商品")
@RequestMapping(value = "/update/recommendStatus",method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("recommendStatus") Integer recommendStatus) {
int count = productService.updateRecommendStatus(ids, recommendStatus);//更新推荐状态
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("批量设为新品")
@RequestMapping(value = "/update/newStatus",method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:update')")
public Object updateNewStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("newStatus") Integer newStatus) {
int count = productService.updateNewStatus(ids, newStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
@ApiOperation("批量修改删除状态")
@RequestMapping(value = "/update/deleteStatus",method = RequestMethod.POST)
@ResponseBody
@PreAuthorize("hasAuthority('pms:product:delete')")
public Object updateDeleteStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("deleteStatus") Integer deleteStatus) {
int count = productService.updateDeleteStatus(ids, deleteStatus);
if (count > 0) {
return new CommonResult().success(count);
} else {
return new CommonResult().failed();
}
}
}

@ -1,42 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.PmsSkuStock;
import com.macro.mall.service.PmsSkuStockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* skuController
*/
@Controller
@Api(tags = "PmsSkuStockController", description = "sku商品库存管理")
@RequestMapping("/sku")
public class PmsSkuStockController {
@Autowired
private PmsSkuStockService skuStockService;
@ApiOperation("根据商品编号及编号模糊搜索sku库存")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public Object getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {//获取列表
List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);//sku存储列表
return new CommonResult().success(skuStockList);
}
@ApiOperation("批量更新库存信息")
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
int count = skuStockService.update(pid,skuStockList);//sku存储服务
if(count>0){
return new CommonResult().success(count);
}else{
return new CommonResult().failed();
}
}
}

@ -1,76 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.SmsCouponParam;
import com.macro.mall.model.SmsCoupon;
import com.macro.mall.service.SmsCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsCouponController", description = "优惠券管理")
@RequestMapping("/coupon")
public class SmsCouponController {
@Autowired
private SmsCouponService couponService;
@ApiOperation("添加优惠券")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object add(@RequestBody SmsCouponParam couponParam) {//添加
int count = couponService.create(couponParam);//优惠券服务
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("删除优惠券")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public Object delete(@PathVariable Long id) {
int count = couponService.delete(id);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改优惠券")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id,@RequestBody SmsCouponParam couponParam) {
int count = couponService.update(id,couponParam);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("根据优惠券名称和类型分页获取优惠券列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "type",required = false) Integer type,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsCoupon> couponList = couponService.list(name,type,pageSize,pageNum);
return new CommonResult().pageSuccess(couponList);
}
@ApiOperation("获取单个优惠券的详细信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {//获取信息
SmsCouponParam couponParam = couponService.getItem(id);
return new CommonResult().success(couponParam);
}
}

@ -1,37 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsCouponHistory;
import com.macro.mall.service.SmsCouponHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsCouponHistoryController",description = "优惠券领取记录管理")
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {
@Autowired
private SmsCouponHistoryService historyService;
@ApiOperation("根据优惠券id使用状态订单编号分页获取领取记录")
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "couponId",required = false) Long couponId,
@RequestParam(value = "useStatus",required = false) Integer useStatus,//使用状态
@RequestParam(value = "orderSn",required = false) String orderSn,//订单编号
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
List<SmsCouponHistory> historyList = historyService.list(couponId,useStatus,orderSn,pageSize,pageNum);
return new CommonResult().pageSuccess(historyList);
}
}

@ -1,84 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsFlashPromotion;
import com.macro.mall.service.SmsFlashPromotionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsFlashPromotionController",description = "限时购活动管理")
@RequestMapping("/flash")
public class SmsFlashPromotionController {
@Autowired
private SmsFlashPromotionService flashPromotionService;//限时促销服务
@ApiOperation("添加活动")
@RequestMapping(value = "/create",method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody SmsFlashPromotion flashPromotion){
int count = flashPromotionService.create(flashPromotion);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("编辑活动信息")
@RequestMapping(value = "/update/{id}",method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotion flashPromotion){
int count = flashPromotionService.update(id,flashPromotion);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("删除活动信息")
@RequestMapping(value = "/delete/{id}",method = RequestMethod.POST)
@ResponseBody
public Object delete(@PathVariable Long id){
int count = flashPromotionService.delete(id);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改上下线状态")
@RequestMapping(value = "/update/status/{id}",method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id,Integer status){
int count = flashPromotionService.updateStatus(id,status);//更新状态
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取活动详情")
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id){//获取信息
SmsFlashPromotion flashPromotion = flashPromotionService.getItem(id);
return new CommonResult().success(flashPromotion);
}
@ApiOperation("根据活动名称分页查询")
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ResponseBody
public Object getItem(@RequestParam(value = "keyword",required = false)String keyword,//活动关键字
@RequestParam(value = "pageSize",defaultValue = "5")Integer pageSize,
@RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum){
List<SmsFlashPromotion> flashPromotionList = flashPromotionService.list(keyword,pageSize,pageNum);
return new CommonResult().pageSuccess(flashPromotionList);
}
}

@ -1,75 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.SmsFlashPromotionProduct;
import com.macro.mall.model.SmsFlashPromotionProductRelation;
import com.macro.mall.service.SmsFlashPromotionProductRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsFlashPromotionProductRelationController", description = "限时购和商品关系管理")
@RequestMapping("/flashProductRelation")
public class SmsFlashPromotionProductRelationController {
@Autowired
private SmsFlashPromotionProductRelationService relationService;//限时促销商品关联服务
@ApiOperation("批量选择商品添加关联")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsFlashPromotionProductRelation> relationList) {
int count = relationService.create(relationList);//关联服务
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改关联相关信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotionProductRelation relation) {
int count = relationService.update(id,relation);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("删除关联")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public Object delete(@PathVariable Long id) {
int count = relationService.delete(id);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取管理商品促销信息")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {//根据商品id获取信息
SmsFlashPromotionProductRelation relation = relationService.getItem(id);
return new CommonResult().success(relation);
}
@ApiOperation("分页查询不同场次关联及商品信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "flashPromotionId")Long flashPromotionId,//限时促销id
@RequestParam(value = "flashPromotionSessionId")Long flashPromotionSessionId,//限时促销会场id
@RequestParam(value = "pageSize",defaultValue = "5")Integer pageSize,
@RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum) {
List<SmsFlashPromotionProduct> flashPromotionProductList = relationService.list(flashPromotionId,flashPromotionSessionId,pageSize,pageNum);
return new CommonResult().pageSuccess(flashPromotionProductList);
}
}

@ -1,91 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.SmsFlashPromotionSessionDetail;
import com.macro.mall.model.SmsFlashPromotionSession;
import com.macro.mall.service.SmsFlashPromotionSessionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsFlashPromotionSessionController", description = "限时购场次管理")
@RequestMapping("/flashSession")
public class SmsFlashPromotionSessionController {
@Autowired
private SmsFlashPromotionSessionService flashPromotionSessionService;
@ApiOperation("添加场次")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody SmsFlashPromotionSession promotionSession) {
int count = flashPromotionSessionService.create(promotionSession);//限时促销会场服务
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改场次")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotionSession promotionSession) {
int count = flashPromotionSessionService.update(id,promotionSession);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改启用状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateStatus(@PathVariable Long id, Integer status) {
int count = flashPromotionSessionService.updateStatus(id,status);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("删除场次")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public Object delete(@PathVariable Long id) {
int count = flashPromotionSessionService.delete(id);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取场次详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
SmsFlashPromotionSession promotionSession = flashPromotionSessionService.getItem(id);
return new CommonResult().success(promotionSession);
}
@ApiOperation("获取全部场次")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list() {//获取信息成列表
List<SmsFlashPromotionSession> promotionSessionList = flashPromotionSessionService.list();
return new CommonResult().success(promotionSessionList);
}
@ApiOperation("获取全部可选场次及其数量")
@RequestMapping(value = "/selectList", method = RequestMethod.GET)
@ResponseBody
public Object selectList(Long flashPromotionId) {//可选择列表
List<SmsFlashPromotionSessionDetail> promotionSessionList = flashPromotionSessionService.selectList(flashPromotionId);
return new CommonResult().success(promotionSessionList);
}
}

@ -1,83 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeAdvertise;
import com.macro.mall.service.SmsHomeAdvertiseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 广Controller
*/
@Controller
@Api(tags = "SmsHomeAdvertiseController", description = "首页轮播广告管理")
@RequestMapping("/home/advertise")
public class SmsHomeAdvertiseController {
@Autowired
private SmsHomeAdvertiseService advertiseService;
@ApiOperation("添加广告")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody SmsHomeAdvertise advertise) {
int count = advertiseService.create(advertise);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("删除广告")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = advertiseService.delete(ids);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("修改上下线状态")
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateStatus(@PathVariable Long id, Integer status) {
int count = advertiseService.updateStatus(id, status);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("获取广告详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
SmsHomeAdvertise advertise = advertiseService.getItem(id);
return new CommonResult().success(advertise);
}
@ApiOperation("修改广告")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody SmsHomeAdvertise advertise) {
int count = advertiseService.update(id, advertise);
if (count > 0)
return new CommonResult().success(count);
return new CommonResult().failed();
}
@ApiOperation("分页查询广告")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "name", required = false) String name,//名称
@RequestParam(value = "type", required = false) Integer type,//类型
@RequestParam(value = "endTime", required = false) String endTime,//结束时间
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeAdvertise> advertiseList = advertiseService.list(name, type, endTime, pageSize, pageNum);
return new CommonResult().pageSuccess(advertiseList);
}
}

@ -1,77 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeBrand;
import com.macro.mall.service.SmsHomeBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeBrandController", description = "看女틔탬밗잿")
@RequestMapping("/home/brand")
public class SmsHomeBrandController {
@Autowired
private SmsHomeBrandService homeBrandService;
@ApiOperation("警속看女股수틔탬")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeBrand> homeBrandList) {
int count = homeBrandService.create(homeBrandList);//看女틔탬륩蛟
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("錦맣틔탬탤埼")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {//뫘劤탤埼
int count = homeBrandService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆<ED88BD>뇜股수틔탬")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = homeBrandService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆錦맣股수榴檄")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = homeBrandService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("롸女꿴璂股수틔탬")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "brandName", required = false) String brandName,//틔탬츰냔
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,//股수榴檄
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeBrand> homeBrandList = homeBrandService.list(brandName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -1,77 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeNewProduct;
import com.macro.mall.service.SmsHomeNewProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeNewProductController", description = "首页新品管理")
@RequestMapping("/home/newProduct")
public class SmsHomeNewProductController {
@Autowired
private SmsHomeNewProductService homeNewProductService;
@ApiOperation("添加首页推荐品牌")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeNewProduct> homeBrandList) {
int count = homeNewProductService.create(homeBrandList);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改推荐排序")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {
int count = homeNewProductService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = homeNewProductService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = homeNewProductService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "productName", required = false) String productName,//商品名称
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -1,77 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeRecommendProduct;
import com.macro.mall.service.SmsHomeRecommendProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeRecommendProductController", description = "看女훙폭股수밗잿")
@RequestMapping("/home/recommendProduct")
public class SmsHomeRecommendProductController {
@Autowired
private SmsHomeRecommendProductService recommendProductService;
@ApiOperation("警속看女股수")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
int count = recommendProductService.create(homeBrandList);//股수<E882A1>틔륩蛟
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("錦맣股수탤埼")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {
int count = recommendProductService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆<ED88BD>뇜股수")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = recommendProductService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆錦맣股수榴檄")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = recommendProductService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("롸女꿴璂股수")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "productName", required = false) String productName,
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -1,77 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.SmsHomeRecommendSubject;
import com.macro.mall.service.SmsHomeRecommendSubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "SmsHomeRecommendSubjectController", description = "看女淚痙股수밗잿")
@RequestMapping("/home/recommendSubject")
public class SmsHomeRecommendSubjectController {
@Autowired
private SmsHomeRecommendSubjectService recommendSubjectService;
@ApiOperation("警속看女股수淚痙")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeRecommendSubject> homeBrandList) {
int count = recommendSubjectService.create(homeBrandList);//股수淚痙륩蛟
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("錦맣股수탤埼")
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
@ResponseBody
public Object updateSort(@PathVariable Long id, Integer sort) {
int count = recommendSubjectService.updateSort(id,sort);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆<ED88BD>뇜股수")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = recommendSubjectService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("툽좆錦맣股수榴檄")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public Object updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
int count = recommendSubjectService.updateRecommendStatus(ids,recommendStatus);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("롸女꿴璂股수")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "subjectName", required = false) String subjectName,//淚痙츰냔
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
List<SmsHomeRecommendSubject> homeBrandList = recommendSubjectService.list(subjectName,recommendStatus,pageSize,pageNum);
return new CommonResult().pageSuccess(homeBrandList);
}
}

@ -1,178 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.UmsAdminLoginParam;
import com.macro.mall.dto.UmsAdminParam;
import com.macro.mall.model.UmsAdmin;
import com.macro.mall.model.UmsPermission;
import com.macro.mall.model.UmsRole;
import com.macro.mall.service.UmsAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
@Controller
@Api(tags = "UmsAdminController", description = "后台用户管理")
@RequestMapping("/admin")
public class UmsAdminController {
@Autowired
private UmsAdminService adminService;//后台用户服务
@Value("${jwt.tokenHeader}")
private String tokenHeader;
@Value("${jwt.tokenHead}")
private String tokenHead;
@ApiOperation(value = "用户注册")
@RequestMapping(value = "/register", method = RequestMethod.POST)
@ResponseBody
public Object register(@RequestBody UmsAdminParam umsAdminParam, BindingResult result) {
UmsAdmin umsAdmin = adminService.register(umsAdminParam);//用户服务
if (umsAdmin == null) {
new CommonResult().failed();
}
return new CommonResult().success(umsAdmin);
}
@ApiOperation(value = "登录以后返回token")
@RequestMapping(value = "/login", method = RequestMethod.POST)
@ResponseBody
public Object login(@RequestBody UmsAdminLoginParam umsAdminLoginParam, BindingResult result) {//登录
String token = adminService.login(umsAdminLoginParam.getUsername(), umsAdminLoginParam.getPassword());//用户名密码登录返回token
if (token == null) {
return new CommonResult().validateFailed("用户名或密码错误");
}
Map<String, String> tokenMap = new HashMap<>();//建立新的哈希表存储token值
tokenMap.put("token", token);
tokenMap.put("tokenHead", tokenHead);
return new CommonResult().success(tokenMap);
}
@ApiOperation(value = "刷新token")
@RequestMapping(value = "/token/refresh", method = RequestMethod.GET)
@ResponseBody
public Object refreshToken(HttpServletRequest request) {//Http请求
String token = request.getHeader(tokenHeader);//请求获取表头
String refreshToken = adminService.refreshToken(token);
if (refreshToken == null) {
return new CommonResult().failed();
}
Map<String, String> tokenMap = new HashMap<>();
tokenMap.put("token", token);
tokenMap.put("tokenHead", tokenHead);
return new CommonResult().success(tokenMap);
}
@ApiOperation(value = "获取当前登录用户信息")
@RequestMapping(value = "/info", method = RequestMethod.GET)
@ResponseBody
public Object getAdminInfo(Principal principal) {//获取用户信息
/*AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();*/
String username = principal.getName();
UmsAdmin umsAdmin = adminService.getAdminByUsername(username);
Map<String, Object> data = new HashMap<>();
data.put("username", umsAdmin.getUsername());
data.put("roles", new String[]{"TEST"});//用户角色
data.put("icon", umsAdmin.getIcon());//用户头像
return new CommonResult().success(data);
}
@ApiOperation(value = "退出功能")
@RequestMapping(value = "/logout", method = RequestMethod.POST)
@ResponseBody
public Object logout() {
return new CommonResult().success(null);
}
@ApiOperation("根据用户名或姓名分页获取用户列表")
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "name",required = false) String name,//用户名
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
List<UmsAdmin> adminList = adminService.list(name,pageSize,pageNum);
return new CommonResult().pageSuccess(adminList);
}
@ApiOperation("获取指定用户信息")
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id){//根据id获取用户信息
UmsAdmin admin = adminService.getItem(id);
return new CommonResult().success(admin);
}
@ApiOperation("获取指定用户信息")
@RequestMapping(value = "/update/{id}",method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id,@RequestBody UmsAdmin admin){
int count = adminService.update(id,admin);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("删除指定用户信息")
@RequestMapping(value = "/delete/{id}",method = RequestMethod.POST)
@ResponseBody
public Object delete(@PathVariable Long id){
int count = adminService.delete(id);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("给用户分配角色")
@RequestMapping(value = "/role/update",method = RequestMethod.POST)
@ResponseBody
public Object updateRole(@RequestParam("adminId") Long adminId,//更新角色内容
@RequestParam("roleIds") List<Long> roleIds){
int count = adminService.updateRole(adminId,roleIds);
if(count>=0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取指定用户的角色")
@RequestMapping(value = "/role/{adminId}",method = RequestMethod.GET)
@ResponseBody
public Object getRoleList(@PathVariable Long adminId){//获取指定用户角色列表
List<UmsRole> roleList = adminService.getRoleList(adminId);
return new CommonResult().success(roleList);
}
@ApiOperation("给用户分配+ - 权限")
@RequestMapping(value = "/permission/update",method = RequestMethod.POST)
@ResponseBody
public Object updatePermission(@RequestParam Long adminId,
@RequestParam("permissionIds") List<Long> permissionIds){
int count = adminService.updatePermission(adminId,permissionIds);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取用户所有权限(包括+ - 权限)")
@RequestMapping(value = "/permission/{adminId}",method = RequestMethod.GET)
@ResponseBody
public Object getPermissionList(@PathVariable Long adminId){
List<UmsPermission> permissionList = adminService.getPermissionList(adminId);
return new CommonResult().success(permissionList);
}
}

@ -1,33 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.UmsMemberLevel;
import com.macro.mall.service.UmsMemberLevelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* Controller
*/
@Controller
@Api(tags = "UmsMemberLevelController",description = "会员等级管理")
@RequestMapping("/memberLevel")
public class UmsMemberLevelController {
@Autowired
private UmsMemberLevelService memberLevelService;//会员等级服务
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ApiOperation("查询所有会员等级")
@ResponseBody
public Object list(@RequestParam("defaultStatus") Integer defaultStatus){
List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
return new CommonResult().success(memberLevelList);
}
}

@ -1,72 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.dto.UmsPermissionNode;
import com.macro.mall.model.UmsPermission;
import com.macro.mall.service.UmsPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*/
@Controller
@Api(tags = "UmsPermissionController", description = "后台用户权限管理")
@RequestMapping("/permission")
public class UmsPermissionController {
@Autowired
private UmsPermissionService permissionService;//权限服务
@ApiOperation("添加权限")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody UmsPermission permission) {
int count = permissionService.create(permission);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改权限")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody UmsPermission permission) {
int count = permissionService.update(id,permission);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("根据id批量删除权限")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {
int count = permissionService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("以层级结构返回所有权限")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)//层级树
@ResponseBody
public Object treeList() {
List<UmsPermissionNode> permissionNodeList = permissionService.treeList();
return new CommonResult().success(permissionNodeList);
}
@ApiOperation("获取所有权限列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list() {
List<UmsPermission> permissionList = permissionService.list();
return new CommonResult().success(permissionList);
}
}

@ -1,86 +0,0 @@
package com.macro.mall.controller;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.model.UmsPermission;
import com.macro.mall.model.UmsRole;
import com.macro.mall.service.UmsRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*/
@Controller
@Api(tags = "UmsRoleController", description = "后台用户角色管理")
@RequestMapping("/role")
public class UmsRoleController {
@Autowired
private UmsRoleService roleService;//角色服务
@ApiOperation("添加角色")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody UmsRole role) {
int count = roleService.create(role);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("修改角色")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id, @RequestBody UmsRole role) {
int count = roleService.update(id,role);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("批量删除角色")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestParam("ids") List<Long> ids) {//根据id删除角色
int count = roleService.delete(ids);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取相应角色权限")
@RequestMapping(value = "/permission/{roleId}", method = RequestMethod.GET)//角色权限
@ResponseBody
public Object getPermissionList(@PathVariable Long roleId) {
List<UmsPermission> permissionList =roleService.getPermissionList(roleId);
return new CommonResult().success(permissionList);
}
@ApiOperation("修改角色权限")
@RequestMapping(value = "/permission/update", method = RequestMethod.POST)
@ResponseBody
public Object updatePermission(@RequestParam Long roleId,
@RequestParam("permissionIds") List<Long> permissionIds) {
int count = roleService.updatePermission(roleId,permissionIds);
if(count>0){
return new CommonResult().success(count);
}
return new CommonResult().failed();
}
@ApiOperation("获取所有角色")
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ResponseBody
public Object list(){
List<UmsRole> roleList = roleService.list();
return new CommonResult().success(roleList);
}
}

@ -1,14 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.CmsPrefrenceAreaProductRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* DAO访
*/
public interface CmsPrefrenceAreaProductRelationDao {//优选区域商品关系
int insertList(@Param("list") List<CmsPrefrenceAreaProductRelation> prefrenceAreaProductRelationList);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.CmsSubjectProductRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*/
public interface CmsSubjectProductRelationDao {//专题商品关系
int insertList(@Param("list") List<CmsSubjectProductRelation> subjectProductRelationList);//插入列表
}

@ -1,29 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.OmsOrderDeliveryParam;
import com.macro.mall.dto.OmsOrderDetail;
import com.macro.mall.dto.OmsOrderQueryParam;
import com.macro.mall.model.OmsOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface OmsOrderDao {
/**
*
*/
List<OmsOrder> getList(@Param("queryParam") OmsOrderQueryParam queryParam);
/**
*
*/
int delivery(@Param("list") List<OmsOrderDeliveryParam> deliveryParamList);
/**
*
*/
OmsOrderDetail getDetail(@Param("id") Long id);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.OmsOrderOperateHistory;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface OmsOrderOperateHistoryDao {
int insertList(@Param("list") List<OmsOrderOperateHistory> orderOperateHistoryList);
}

@ -1,23 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.OmsOrderReturnApplyResult;
import com.macro.mall.dto.OmsReturnApplyQueryParam;
import com.macro.mall.model.OmsOrderReturnApply;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <EFBFBD>Dao
*/
public interface OmsOrderReturnApplyDao {
/**
* <EFBFBD>
*/
List<OmsOrderReturnApply> getList(@Param("queryParam") OmsReturnApplyQueryParam queryParam);
/**
* <EFBFBD>
*/
OmsOrderReturnApplyResult getDetail(@Param("id")Long id);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsMemberPrice;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface PmsMemberPriceDao {//会员价格
int insertList(@Param("list") List<PmsMemberPrice> memberPriceList);
}

@ -1,12 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
import java.util.List;
/**
* Dao
*/
public interface PmsProductAttributeCategoryDao {//商品属性分类
List<PmsProductAttributeCategoryItem> getListWithAttr();
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.ProductAttrInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface PmsProductAttributeDao {//商品属性
List<ProductAttrInfo> getProductAttrInfo(@Param("id") Long productCategoryId);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsProductAttributeValue;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface PmsProductAttributeValueDao {//商品属性值
int insertList(@Param("list")List<PmsProductAttributeValue> productAttributeValueList);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsProductCategoryAttributeRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface PmsProductCategoryAttributeRelationDao {//商品分类属性关系
int insertList(@Param("list") List<PmsProductCategoryAttributeRelation> productCategoryAttributeRelationList);
}

@ -1,12 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.PmsProductCategoryWithChildrenItem;
import java.util.List;
/**
* Dao
*/
public interface PmsProductCategoryDao {//商品分类
List<PmsProductCategoryWithChildrenItem> listWithChildren();
}

@ -1,15 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.PmsProductResult;
import org.apache.ibatis.annotations.Param;
/**
* Dao
*/
public interface PmsProductDao {
/**
*
*/
PmsProductResult getUpdateInfo(@Param("id") Long id);//获取更新信息
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsProductFullReduction;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* ×Ô¨ÒåÉÌÆ·Âú¼õDao
*/
public interface PmsProductFullReductionDao {//ÉÌÆ·Âú¼õ²Ù×÷
int insertList(@Param("list") List<PmsProductFullReduction> productFullReductionList);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsProductLadder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface PmsProductLadderDao {//商品阶梯层次
int insertList(@Param("list") List<PmsProductLadder> productLadderList);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsProductVertifyRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* dao
*/
public interface PmsProductVertifyRecordDao {//商品审核记录
int insertList(@Param("list") List<PmsProductVertifyRecord> list);
}

@ -1,21 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.PmsSkuStock;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* ×Ô¨ÒåÉÌÆ·sku¿â´æDao
*/
public interface PmsSkuStockDao {//Sku´æ´¢
/**
* ÅúÁ¿²åÈë²Ù×÷
*/
int insertList(@Param("list")List<PmsSkuStock> skuStockList);//²åÈëÁбí
/**
* ÅúÁ¿²åÈë»òÌæ»»²Ù×÷
*/
int replaceList(@Param("list")List<PmsSkuStock> skuStockList);//Ìæ»»Áбí
}

@ -1,11 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.SmsCouponParam;
import org.apache.ibatis.annotations.Param;
/**
* Dao
*/
public interface SmsCouponDao {//优惠券Dao
SmsCouponParam getItem(@Param("id") Long id);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.SmsCouponProductCategoryRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface SmsCouponProductCategoryRelationDao {//优惠券商品分类关系
int insertList(@Param("list")List<SmsCouponProductCategoryRelation> productCategoryRelationList);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.SmsCouponProductRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface SmsCouponProductRelationDao {//优惠券商品关系
int insertList(@Param("list")List<SmsCouponProductRelation> productRelationList);
}

@ -1,16 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.dto.SmsFlashPromotionProduct;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface SmsFlashPromotionProductRelationDao {
/**
*
*/
List<SmsFlashPromotionProduct> getList(@Param("flashPromotionId") Long flashPromotionId, @Param("flashPromotionSessionId") Long flashPromotionSessionId);
}

@ -1,13 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.UmsAdminPermissionRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface UmsAdminPermissionRelationDao {//用户权限关系
int insertList(@Param("list") List<UmsAdminPermissionRelation> list);
}

@ -1,33 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.UmsAdminRoleRelation;
import com.macro.mall.model.UmsPermission;
import com.macro.mall.model.UmsRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface UmsAdminRoleRelationDao {//用户角色关系
/**
*
*/
int insertList(@Param("list") List<UmsAdminRoleRelation> adminRoleRelationList);
/**
*
*/
List<UmsRole> getRoleList(@Param("adminId") Long adminId);
/**
*
*/
List<UmsPermission> getRolePermissionList(@Param("adminId") Long adminId);
/**
* (+ - )
*/
List<UmsPermission> getPermissionList(@Param("adminId") Long adminId);
}

@ -1,22 +0,0 @@
package com.macro.mall.dao;
import com.macro.mall.model.UmsPermission;
import com.macro.mall.model.UmsRolePermissionRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Dao
*/
public interface UmsRolePermissionRelationDao {
/**
*
*/
int insertList(@Param("list")List<UmsRolePermissionRelation> list);
/**
*
*/
List<UmsPermission> getPermissionList(@Param("roleId") Long roleId);
}

@ -1,145 +0,0 @@
package com.macro.mall.dto;
import com.github.pagehelper.PageInfo;
import com.macro.mall.util.JsonUtil;
import org.springframework.validation.BindingResult;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class CommonResult {
//操作成功
public static final int SUCCESS = 200;
//操作失败
public static final int FAILED = 500;
//参数校验失败
public static final int VALIDATE_FAILED = 404;
//未认证
public static final int UNAUTHORIZED = 401;
//未授权
public static final int FORBIDDEN = 403;
private int code;
private String message;
private Object data;
/**
*
*
* @param data
*/
public CommonResult success(Object data) {
this.code = SUCCESS;
this.message = "操作成功";
this.data = data;
return this;
}
/**
*
*/
public CommonResult pageSuccess(List data) {
PageInfo pageInfo = new PageInfo(data);//分页数据
Map<String, Object> result = new HashMap<>();
result.put("pageSize", pageInfo.getPageSize());
result.put("totalPage", pageInfo.getPages());
result.put("total", pageInfo.getTotal());
result.put("pageNum", pageInfo.getPageNum());
result.put("list", pageInfo.getList());
this.code = SUCCESS;
this.message = "操作成功";
this.data = result;
return this;
}
/**
*
*/
public CommonResult failed() {
this.code = FAILED;
this.message = "操作失败";
return this;
}
/**
* 使
*
* @param message
*/
public CommonResult validateFailed(String message) {
this.code = VALIDATE_FAILED;
this.message = message;
return this;
}
/**
* 使
*
* @param message
*/
public CommonResult unauthorized(String message) {
this.code = UNAUTHORIZED;
this.message = "暂未登录或token已经过期";//证书过期
this.data = message;
return this;
}
/**
* 使
*
* @param message
*/
public CommonResult forbidden(String message) {
this.code = FORBIDDEN;
this.message = "没有相关权限";
this.data = message;
return this;
}
/**
* 使
* @param result
*/
public CommonResult validateFailed(BindingResult result) {
validateFailed(result.getFieldError().getDefaultMessage());
return this;
}
@Override
public String toString() {
return JsonUtil.objectToJson(this);
}
public int getCode() {
/*获取验证码*/
return code;
}
public void setCode(int code) {
/*编辑验证码*/
this.code = code;
}
public String getMessage() {
/*获取信息*/
return message;
}
public void setMessage(String message) {
/*编辑信息*/
this.message = message;
}
public Object getData() {
/*获取数据*/
return data;
}
public void setData(Object data) {
/*编辑数据*/
this.data = data;
}
}

@ -1,18 +0,0 @@
package com.macro.mall.dto;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
/**
*
*/
@Getter//替代get方法使lombok自动生成默认getter
@Setter//替代set方法使lombok自动生成默认setter
public class OmsMoneyInfoParam {
private Long orderId;//订单id
private BigDecimal freightAmount;//运费总价
private BigDecimal discountAmount;//折扣总价
private Integer status;//状态
}

@ -1,19 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
@Getter
@Setter
public class OmsOrderDeliveryParam {
@ApiModelProperty("땐데id")
private Long orderId;
@ApiModelProperty("膠직무鱇")
private String deliveryCompany;
@ApiModelProperty("膠직데뵀")
private String deliverySn;
}

@ -1,21 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.OmsOrder;
import com.macro.mall.model.OmsOrderItem;
import com.macro.mall.model.OmsOrderOperateHistory;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
*
*/
public class OmsOrderDetail extends OmsOrder {
@Getter
@Setter
private List<OmsOrderItem> orderItemList;
@Getter
@Setter
private List<OmsOrderOperateHistory> historyList;//订单操作日志
}

@ -1,25 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
@Getter
@Setter
public class OmsOrderQueryParam {
@ApiModelProperty(value = "订单编号")
private String orderSn;
@ApiModelProperty(value = "收货人姓名/号码")
private String receiverKeyword;//收货人关键信息
@ApiModelProperty(value = "订单状态0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单")
private Integer status;
@ApiModelProperty(value = "订单类型0->正常订单1->秒杀订单")
private Integer orderType;
@ApiModelProperty(value = "订单来源0->PC订单1->app订单")
private Integer sourceType;//来源类型
@ApiModelProperty(value = "订单提交时间")
private String createTime;//创建信息
}

@ -1,15 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.OmsCompanyAddress;
import com.macro.mall.model.OmsOrderReturnApply;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
public class OmsOrderReturnApplyResult extends OmsOrderReturnApply {
@Getter
@Setter
private OmsCompanyAddress companyAddress;
}

@ -1,21 +0,0 @@
package com.macro.mall.dto;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
@Getter
@Setter
public class OmsReceiverInfoParam {
private Long orderId;//订单id
private String receiverName;//收货人姓名
private String receiverPhone;//收货人电话号码
private String receiverPostCode;//收货地址邮政编码
private String receiverDetailAddress;//收货人详细地址
private String receiverProvince;//收货人省份
private String receiverCity;//收货人城市
private String receiverRegion;//收货地区
private Integer status;//状态
}

@ -1,25 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* 退
*/
@Getter
@Setter
public class OmsReturnApplyQueryParam {
@ApiModelProperty("服务单号")
private Long id;
@ApiModelProperty(value = "收货人姓名/号码")
private String receiverKeyword;
@ApiModelProperty(value = "申请状态0->待处理1->退货中2->已完成3->已拒绝")
private Integer status;
@ApiModelProperty(value = "申请时间")
private String createTime;
@ApiModelProperty(value = "处理人员")
private String handleMan;
@ApiModelProperty(value = "处理时间")
private String handleTime;
}

@ -1,31 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
/**
*
*/
@Getter
@Setter
public class OmsUpdateStatusParam {//更新状态参数
@ApiModelProperty("服务单号")
private Long id;
@ApiModelProperty("收货地址关联id")
private Long companyAddressId;
@ApiModelProperty("确认退款金额")
private BigDecimal returnAmount;
@ApiModelProperty("处理备注")
private String handleNote;
@ApiModelProperty("处理人")
private String handleMan;
@ApiModelProperty("收货备注")
private String receiveNote;
@ApiModelProperty("收货人")
private String receiveMan;
@ApiModelProperty("申请状态1->退货中2->已完成3->已拒绝")
private Integer status;
}

@ -1,41 +0,0 @@
package com.macro.mall.dto;
/**
*
*/
public class OssCallbackParam {//反馈参数
private String callbackUrl;//反馈资源定位符
private String callbackBody;//反馈体
private String callbackBodyType;//反馈体类型
public String getCallbackUrl() {
/*获取反馈资源定位符*/
return callbackUrl;
}
public void setCallbackUrl(String callbackUrl) {
/*设置反馈资源定位符*/
this.callbackUrl = callbackUrl;
}
public String getCallbackBody() {
/*获取反馈体*/
return callbackBody;
}
public void setCallbackBody(String callbackBody) {
/*设置反馈体*/
this.callbackBody = callbackBody;
}
public String getCallbackBodyType() {
/*获取反馈体类型*/
return callbackBodyType;
}
public void setCallbackBodyType(String callbackBodyType) {
/*设置反馈体类型*/
this.callbackBodyType = callbackBodyType;
}
}

@ -1,52 +0,0 @@
package com.macro.mall.dto;
/**
*
*/
public class OssCallbackResult {
private String filename;//文件名称
private String size;
private String mimeType;
private String width;
private String height;
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getMimeType() {//获取文件方法
return mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public String getWidth() {//显示大小--宽
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHeight() {//显示大小--高
return height;
}
public void setHeight(String height) {
this.height = height;
}
}

@ -1,52 +0,0 @@
package com.macro.mall.dto;
/**
* OSS
*/
public class OssPolicyResult {
private String accessKeyId;//辅助键id
private String policy;//授权
private String signature;//签名
private String dir;//目录
private String host;//主机
public String getAccessKeyId() {
return accessKeyId;
}
public void setAccessKeyId(String accessKeyId) {
this.accessKeyId = accessKeyId;
}
public String getPolicy() {
return policy;
}
public void setPolicy(String policy) {
this.policy = policy;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
}

@ -1,100 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.validator.FlagValidator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
*
*/
public class PmsBrandParam {//品牌参数
@ApiModelProperty(value = "品牌名称",required = true)
@NotEmpty(message = "名称不能为空")
private String name;
@ApiModelProperty(value = "品牌首字母")
private String firstLetter;
@ApiModelProperty(value = "排序字段")
@Min(value = 0, message = "排序最小为0")
private Integer sort;
@ApiModelProperty(value = "是否为厂家制造商")
@FlagValidator(value = {"0","1"}, message = "厂家状态不正确")
private Integer factoryStatus;
@ApiModelProperty(value = "是否进行显示")
@FlagValidator(value = {"0","1"}, message = "显示状态不正确")
private Integer showStatus;
@ApiModelProperty(value = "品牌logo",required = true)
@NotEmpty(message = "品牌logo不能为空")
private String logo;
@ApiModelProperty(value = "品牌大图")
private String bigPic;
@ApiModelProperty(value = "品牌故事")
private String brandStory;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFirstLetter() {
return firstLetter;
}
public void setFirstLetter(String firstLetter) {
this.firstLetter = firstLetter;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getFactoryStatus() {
return factoryStatus;
}
public void setFactoryStatus(Integer factoryStatus) {
this.factoryStatus = factoryStatus;
}
public Integer getShowStatus() {
return showStatus;
}
public void setShowStatus(Integer showStatus) {
this.showStatus = showStatus;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getBigPic() {
return bigPic;
}
public void setBigPic(String bigPic) {
this.bigPic = bigPic;
}
public String getBrandStory() {
return brandStory;
}
public void setBrandStory(String brandStory) {
this.brandStory = brandStory;
}
}

@ -1,21 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.PmsProductAttribute;
import com.macro.mall.model.PmsProductAttributeCategory;
import java.util.List;
/**
* dto
*/
public class PmsProductAttributeCategoryItem extends PmsProductAttributeCategory {//商品属性分类信息
private List<PmsProductAttribute> productAttributeList;
public List<PmsProductAttribute> getProductAttributeList() {//获取商品属性列表
return productAttributeList;
}
public void setProductAttributeList(List<PmsProductAttribute> productAttributeList) {//编辑商品属性列表
this.productAttributeList = productAttributeList;
}
}

@ -1,134 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.validator.FlagValidator;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotEmpty;
/**
*
*/
public class PmsProductAttributeParam {
@ApiModelProperty("属性分类ID")
@NotEmpty(message = "属性分类不能为空")
private Long productAttributeCategoryId;
@ApiModelProperty("属性名称")
@NotEmpty(message = "属性名称不能为空")
private String name;
@ApiModelProperty("属性选择类型0->唯一1->单选2->多选")
@FlagValidator({"0","1","2"})
private Integer selectType;
@ApiModelProperty("属性录入方式0->手工录入1->从列表中选取")
@FlagValidator({"0","1"})
private Integer inputType;
@ApiModelProperty("可选值列表,以逗号隔开")
private String inputList;
private Integer sort;
@ApiModelProperty("分类筛选样式0->普通1->颜色")
@FlagValidator({"0","1"})
private Integer filterType;
@ApiModelProperty("检索类型0->不需要进行检索1->关键字检索2->范围检索")
@FlagValidator({"0","1","2"})
private Integer searchType;
@ApiModelProperty("相同属性产品是否关联0->不关联1->关联")
@FlagValidator({"0","1"})
private Integer relatedStatus;
@ApiModelProperty("是否支持手动新增0->不支持1->支持")
@FlagValidator({"0","1"})
private Integer handAddStatus;
@ApiModelProperty("属性的类型0->规格1->参数")
@FlagValidator({"0","1"})
private Integer type;
public Long getProductAttributeCategoryId() {
return productAttributeCategoryId;
}
public void setProductAttributeCategoryId(Long productAttributeCategoryId) {
this.productAttributeCategoryId = productAttributeCategoryId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getSelectType() {
/*获取检索类型*/
return selectType;
}
public void setSelectType(Integer selectType) {
/*编辑检索类型*/
this.selectType = selectType;
}
public Integer getInputType() {
return inputType;
}
public void setInputType(Integer inputType) {
this.inputType = inputType;
}
public String getInputList() {
/*获取可选值列表*/
return inputList;
}
public void setInputList(String inputList) {
/*编辑可选值列表*/
this.inputList = inputList;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getFilterType() {
return filterType;
}
public void setFilterType(Integer filterType) {
this.filterType = filterType;
}
public Integer getSearchType() {
return searchType;
}
public void setSearchType(Integer searchType) {
this.searchType = searchType;
}
public Integer getRelatedStatus() {
return relatedStatus;
}
public void setRelatedStatus(Integer relatedStatus) {
this.relatedStatus = relatedStatus;
}
public Integer getHandAddStatus() {
return handAddStatus;
}
public void setHandAddStatus(Integer handAddStatus) {
this.handAddStatus = handAddStatus;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}

@ -1,118 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.validator.FlagValidator;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.Min;
import java.util.List;
/**
*
*/
public class PmsProductCategoryParam {//商品分类参数
@ApiModelProperty("父分类的编号")
private Long parentId;
@ApiModelProperty(value = "商品分类名称",required = true)
@NotEmpty(message = "商品分类名称不能为空")
private String name;
@ApiModelProperty("分类单位")
private String productUnit;
@ApiModelProperty("是否在导航栏显示")
@FlagValidator(value = {"0","1"},message = "状态只能为0或1")
private Integer navStatus;
@ApiModelProperty("是否进行显示")
@FlagValidator(value = {"0","1"},message = "状态只能为0或1")
private Integer showStatus;
@ApiModelProperty("排序")
@Min(value = 0,message = "排序最小为0")
private Integer sort;
@ApiModelProperty("图标")
private String icon;
@ApiModelProperty("关键字")
private String keywords;
@ApiModelProperty("描述")
private String description;
@ApiModelProperty("产品相关筛选属性集合")
private List<Long> productAttributeIdList;
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProductUnit() {
return productUnit;
}
public void setProductUnit(String productUnit) {
this.productUnit = productUnit;
}
public Integer getNavStatus() {
return navStatus;
}
public void setNavStatus(Integer navStatus) {
this.navStatus = navStatus;
}
public Integer getShowStatus() {
return showStatus;
}
public void setShowStatus(Integer showStatus) {
this.showStatus = showStatus;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Long> getProductAttributeIdList() {
return productAttributeIdList;
}
public void setProductAttributeIdList(List<Long> productAttributeIdList) {
this.productAttributeIdList = productAttributeIdList;
}
}

@ -1,20 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.PmsProductCategory;
import java.util.List;
/**
*
*/
public class PmsProductCategoryWithChildrenItem extends PmsProductCategory {
private List<PmsProductCategory> children;
public List<PmsProductCategory> getChildren() {//获取子分类
return children;
}
public void setChildren(List<PmsProductCategory> children) {
this.children = children;
}
}

@ -1,82 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.*;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
* 使
*/
public class PmsProductParam extends PmsProduct{
@ApiModelProperty("商品阶梯价格设置")
private List<PmsProductLadder> productLadderList;
@ApiModelProperty("商品满减价格设置")
private List<PmsProductFullReduction> productFullReductionList;
@ApiModelProperty("商品会员价格设置")
private List<PmsMemberPrice> memberPriceList;
@ApiModelProperty("商品的sku库存信息")
private List<PmsSkuStock> skuStockList;
@ApiModelProperty("商品参数及自定义规格属性")
private List<PmsProductAttributeValue> productAttributeValueList;
@ApiModelProperty("专题和商品关系")
private List<CmsSubjectProductRelation> subjectProductRelationList;
@ApiModelProperty("优选专区和商品的关系")
private List<CmsPrefrenceAreaProductRelation> prefrenceAreaProductRelationList;
public List<PmsProductLadder> getProductLadderList() {
return productLadderList;
}
public void setProductLadderList(List<PmsProductLadder> productLadderList) {
this.productLadderList = productLadderList;
}
public List<PmsProductFullReduction> getProductFullReductionList() {
return productFullReductionList;
}
public void setProductFullReductionList(List<PmsProductFullReduction> productFullReductionList) {
this.productFullReductionList = productFullReductionList;
}
public List<PmsMemberPrice> getMemberPriceList() {
return memberPriceList;
}
public void setMemberPriceList(List<PmsMemberPrice> memberPriceList) {
this.memberPriceList = memberPriceList;
}
public List<PmsSkuStock> getSkuStockList() {
return skuStockList;
}
public void setSkuStockList(List<PmsSkuStock> skuStockList) {
this.skuStockList = skuStockList;
}
public List<PmsProductAttributeValue> getProductAttributeValueList() {
return productAttributeValueList;
}
public void setProductAttributeValueList(List<PmsProductAttributeValue> productAttributeValueList) {
this.productAttributeValueList = productAttributeValueList;
}
public List<CmsSubjectProductRelation> getSubjectProductRelationList() {
return subjectProductRelationList;
}
public void setSubjectProductRelationList(List<CmsSubjectProductRelation> subjectProductRelationList) {
this.subjectProductRelationList = subjectProductRelationList;
}
public List<CmsPrefrenceAreaProductRelation> getPrefrenceAreaProductRelationList() {
return prefrenceAreaProductRelationList;
}
public void setPrefrenceAreaProductRelationList(List<CmsPrefrenceAreaProductRelation> prefrenceAreaProductRelationList) {
this.prefrenceAreaProductRelationList = prefrenceAreaProductRelationList;
}
}

@ -1,69 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
/**
*
*/
public class PmsProductQueryParam {
@ApiModelProperty("上架状态")
private Integer publishStatus;
@ApiModelProperty("审核状态")
private Integer verifyStatus;
@ApiModelProperty("商品名称模糊关键字")
private String keyword;
@ApiModelProperty("商品货号")
private String productSn;
@ApiModelProperty("商品分类编号")
private Long productCategoryId;
@ApiModelProperty("商品品牌编号")
private Long brandId;
public Integer getPublishStatus() {
return publishStatus;
}
public void setPublishStatus(Integer publishStatus) {
this.publishStatus = publishStatus;
}
public Integer getVerifyStatus() {
return verifyStatus;
}
public void setVerifyStatus(Integer verifyStatus) {
this.verifyStatus = verifyStatus;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getProductSn() {
return productSn;
}
public void setProductSn(String productSn) {
this.productSn = productSn;
}
public Long getProductCategoryId() {
return productCategoryId;
}
public void setProductCategoryId(Long productCategoryId) {
this.productCategoryId = productCategoryId;
}
public Long getBrandId() {
return brandId;
}
public void setBrandId(Long brandId) {
this.brandId = brandId;
}
}

@ -1,17 +0,0 @@
package com.macro.mall.dto;
/**
*
*/
public class PmsProductResult extends PmsProductParam {
//商品所选分类的父id
private Long cateParentId;
public Long getCateParentId() {
return cateParentId;
}
public void setCateParentId(Long cateParentId) {
this.cateParentId = cateParentId;
}
}

@ -1,26 +0,0 @@
package com.macro.mall.dto;
/**
*
*/
public class ProductAttrInfo {//商品属性信息
private Long attributeId;
private Long attributeCategoryId;
public Long getAttributeId() {
return attributeId;
}
public void setAttributeId(Long attributeId) {
this.attributeId = attributeId;
}
public Long getAttributeCategoryId() {
return attributeCategoryId;
}
public void setAttributeCategoryId(Long attributeCategoryId) {
this.attributeCategoryId = attributeCategoryId;
}
}

@ -1,33 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.SmsCoupon;
import com.macro.mall.model.SmsCouponProductCategoryRelation;
import com.macro.mall.model.SmsCouponProductRelation;
import java.util.List;
/**
*
*/
public class SmsCouponParam extends SmsCoupon {
//优惠券绑定的商品
private List<SmsCouponProductRelation> productRelationList;
//优惠券绑定的商品分类
private List<SmsCouponProductCategoryRelation> productCategoryRelationList;
public List<SmsCouponProductRelation> getProductRelationList() {
return productRelationList;
}
public void setProductRelationList(List<SmsCouponProductRelation> productRelationList) {
this.productRelationList = productRelationList;
}
public List<SmsCouponProductCategoryRelation> getProductCategoryRelationList() {
return productCategoryRelationList;
}
public void setProductCategoryRelationList(List<SmsCouponProductCategoryRelation> productCategoryRelationList) {
this.productCategoryRelationList = productCategoryRelationList;
}
}

@ -1,15 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.PmsProduct;
import com.macro.mall.model.SmsFlashPromotionProductRelation;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
public class SmsFlashPromotionProduct extends SmsFlashPromotionProductRelation{
@Getter
@Setter
private PmsProduct product;
}

@ -1,14 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.SmsFlashPromotionSession;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
public class SmsFlashPromotionSessionDetail extends SmsFlashPromotionSession {
@Setter
@Getter
private Integer productCount;
}

@ -1,32 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotEmpty;
/**
*
*/
public class UmsAdminLoginParam {
@ApiModelProperty(value = "用户名", required = true)
@NotEmpty(message = "用户名不能为空")
private String username;
@ApiModelProperty(value = "密码", required = true)
@NotEmpty(message = "密码不能为空")
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

@ -1,30 +0,0 @@
package com.macro.mall.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
/**
*
*/
@Getter
@Setter
public class UmsAdminParam {
@ApiModelProperty(value = "用户名", required = true)
@NotEmpty(message = "用户名不能为空")
private String username;
@ApiModelProperty(value = "密码", required = true)
@NotEmpty(message = "密码不能为空")
private String password;
@ApiModelProperty(value = "用户头像")
private String icon;
@ApiModelProperty(value = "邮箱")
@Email(message = "邮箱格式不合法")
private String email;
@ApiModelProperty(value = "用户昵称")
private String nickName;
@ApiModelProperty(value = "备注")
private String note;
}

@ -1,16 +0,0 @@
package com.macro.mall.dto;
import com.macro.mall.model.UmsPermission;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
*ȨÏÞ±àÂë
*/
public class UmsPermissionNode extends UmsPermission {
@Getter
@Setter
private List<UmsPermissionNode> children;
}

@ -1,12 +0,0 @@
package com.macro.mall.service;
import com.macro.mall.model.CmsPrefrenceArea;
import java.util.List;
/**
* Service
*/
public interface CmsPrefrenceAreaService {
List<CmsPrefrenceArea> listAll();
}

@ -1,20 +0,0 @@
package com.macro.mall.service;
import com.macro.mall.model.CmsSubject;
import java.util.List;
/**
* Service
*/
public interface CmsSubjectService {
/**
*
*/
List<CmsSubject> listAll();
/**
*
*/
List<CmsSubject> list(String keyword, Integer pageNum, Integer pageSize);
}

@ -1,15 +0,0 @@
package com.macro.mall.service;
import com.macro.mall.model.OmsCompanyAddress;
import java.util.List;
/**
* Service
*/
public interface OmsCompanyAddressService {
/**
* <EFBFBD>
*/
List<OmsCompanyAddress> list();
}

@ -1,33 +0,0 @@
package com.macro.mall.service;
import com.macro.mall.dto.OmsOrderReturnApplyResult;
import com.macro.mall.dto.OmsReturnApplyQueryParam;
import com.macro.mall.dto.OmsUpdateStatusParam;
import com.macro.mall.model.OmsOrderReturnApply;
import java.util.List;
/**
* 退Service
*/
public interface OmsOrderReturnApplyService {
/**
*
*/
List<OmsOrderReturnApply> list(OmsReturnApplyQueryParam queryParam, Integer pageSize, Integer pageNum);
/**
*
*/
int delete(List<Long> ids);
/**
*
*/
int updateStatus(Long id, OmsUpdateStatusParam statusParam);
/**
*
*/
OmsOrderReturnApplyResult getItem(Long id);
}

@ -1,40 +0,0 @@
package com.macro.mall.service;
import com.macro.mall.model.OmsOrderReturnReason;
import java.util.List;
/**
* Service
*/
public interface OmsOrderReturnReasonService {
/**
*
*/
int create(OmsOrderReturnReason returnReason);
/**
* 退
*/
int update(Long id, OmsOrderReturnReason returnReason);
/**
* 退
*/
int delete(List<Long> ids);
/**
* 退
*/
List<OmsOrderReturnReason> list(Integer pageSize, Integer pageNum);
/**
* 退
*/
int updateStatus(List<Long> ids, Integer status);
/**
* 退
*/
OmsOrderReturnReason getItem(Long id);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save