Commit eac58a08 authored by zhangc's avatar zhangc

Merge branch 'master' of gitlab.ioubuy.cn:yaobenzhang/dm_project

parents 50e9202a 460ae521
...@@ -2,7 +2,7 @@ package com.jz.common.Constant; ...@@ -2,7 +2,7 @@ package com.jz.common.Constant;
/** /**
* @ClassName: CommonConstant * @ClassName: CommonConstant
* @Description: * @Description: Bellamy
* @Author * @Author
* @Date 2020/11/27 * @Date 2020/11/27
* @Version 1.0 * @Version 1.0
......
package com.jz.common.Enum;
/**
* 审核状态
*
* @author Bellamy
* @since 2020-11-30 14:30:23
*/
public enum AuditStatusEnum {
/**
* 待审核
*/
DSH("DSH", "01"),
/**
* 已审核
*/
YSH("YSH", "02"),
/**
* 未通过
*/
WTG("WTG", "03"),
;
private String code;
private String value;
AuditStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static AuditStatusEnum get(String code) {
if (code == null) {
return null;
}
for (AuditStatusEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.Enum;
/**
* 删除标识
*
* @author Bellamy
* @since 2020-11-30 14:30:23
*/
public enum DelFlagEnum {
/**
* 删除
*/
YES("YES", "Y"),
/**
* 未删除
*/
NO("NO", "N"),
;
private String code;
private String value;
private DelFlagEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static DelFlagEnum get(String code) {
if (code == null) {
return null;
}
for (DelFlagEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.Enum;
/**
* 商品数据类型
*
* @author Bellamy
* @since 2020-11-30 14:30:23
*/
public enum GoodsDataEnum {
/**
* api
*/
GOODS_API("api", "01"),
/**
* pack
*/
GOODS_DATA_PACK("pack", "02"),
;
private String code;
private String value;
GoodsDataEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static GoodsDataEnum get(String code) {
if (code == null) {
return null;
}
for (GoodsDataEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
...@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.admin.controller.BaseController; import com.jz.manage.admin.controller.BaseController;
import com.jz.manage.admin.entity.User; import com.jz.manage.admin.entity.User;
import com.jz.manage.admin.service.UserService; import com.jz.manage.admin.service.TestUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,25 +26,34 @@ import java.util.Map; ...@@ -26,25 +26,34 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/user") @RequestMapping("/user")
@Api(tags = "测试样例API") @Api(tags = "测试样例API")
public class UserController extends BaseController { public class TestUserController extends BaseController {
@Autowired @Autowired
private UserService userService; private TestUserService testUserService;
@PostMapping("/getTest") @PostMapping("/getTest")
public List<Map> getTest() { public List<Map> getTest() {
System.out.print("117576575" + userService.getTest().toString()); System.out.print("117576575" + testUserService.getTest().toString());
return userService.getTest(); return testUserService.getTest();
} }
@GetMapping(value = "/events") @GetMapping(value = "/events")
@ApiOperation(value = "测试样例列表(分页查询)", notes = "事件列表(分页查询)") @ApiOperation(value = "测试样例列表(分页查询)", notes = "事件列表(分页查询)")
public Result<IPage<User>> queryPageList(User event, HttpServletRequest req) throws Exception { public Result<IPage<User>> queryPageList(User event, HttpServletRequest req) throws Exception {
Result<IPage<User>> result = new Result<IPage<User>>(); Result<IPage<User>> result = new Result<IPage<User>>();
IPage<User> pageList = userService.queryPage(new Page<User>(1, 2), event); IPage<User> pageList = testUserService.queryPage(new Page<User>(1, 2), event);
result.setSuccess(true); result.setSuccess(true);
result.setResult(pageList); result.setResult(pageList);
return result; return result;
} }
@GetMapping(value = "/queryPageListSff")
@ApiOperation(value = "测试样例列表(分页查询)", notes = "事件列表(分页查询)")
public Result<IPage<Map>> queryPageListSff(User event, HttpServletRequest req) throws Exception {
Result<IPage<Map>> result = new Result<IPage<Map>>();
IPage<Map> pageList = testUserService.queryListPage(new Page<Map>(1, 2), event);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
} }
...@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface UserMapper extends BaseMapper<User> { public interface TestUserMapper extends BaseMapper<User> {
List<Map> getTest(); List<Map> getTest();
......
...@@ -3,12 +3,15 @@ package com.jz.manage.admin.entity; ...@@ -3,12 +3,15 @@ package com.jz.manage.admin.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@TableName("tb_user") @TableName("tb_user")
@ApiModel
public class User implements Serializable { public class User implements Serializable {
/** /**
* id * id
...@@ -19,26 +22,31 @@ public class User implements Serializable { ...@@ -19,26 +22,31 @@ public class User implements Serializable {
/** /**
* 用户名 * 用户名
*/ */
@ApiModelProperty(value = "用户名",required = true)
private String username; private String username;
/** /**
* 密码 * 密码
*/ */
@ApiModelProperty(value = "密码")
private String password; private String password;
/** /**
* 年龄 * 年龄
*/ */
@ApiModelProperty(value = "年龄")
private Integer age; private Integer age;
/** /**
* 电话 * 电话
*/ */
@ApiModelProperty(value = "电话")
private Integer telphone; private Integer telphone;
/** /**
* 地址 * 地址
*/ */
@ApiModelProperty(value = "地址")
private String addres; private String addres;
/** /**
...@@ -48,16 +56,19 @@ public class User implements Serializable { ...@@ -48,16 +56,19 @@ public class User implements Serializable {
/** /**
* 组织机构ID * 组织机构ID
*/ */
@ApiModelProperty(value = "组织机构ID")
private Integer orgId; private Integer orgId;
/* /*
* 姓名 * 姓名
* */ * */
@ApiModelProperty(value = "姓名")
private String account; private String account;
/** /**
* 性别 * 性别
*/ */
@ApiModelProperty(value = "性别")
private String gender; private String gender;
public String getAccount() { public String getAccount() {
......
package com.jz.manage.admin.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.manage.admin.entity.User;
import java.util.List;
import java.util.Map;
public interface UserService {
List<Map> getTest();
IPage<User> queryPage(Page<User> userPage, User event);
}
...@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.jz.manage.admin.dao.UserMapper; import com.jz.manage.admin.dao.TestMapper;
import com.jz.manage.admin.dao.TestUserMapper;
import com.jz.manage.admin.entity.User; import com.jz.manage.admin.entity.User;
import com.jz.manage.admin.service.UserService; import com.jz.manage.admin.service.TestUserService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -21,12 +22,15 @@ import java.util.List; ...@@ -21,12 +22,15 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@Service @Service
public class UserServiceImpl implements UserService { public class UserServiceImpl implements TestUserService {
private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired @Autowired
private UserMapper userMapper; private TestUserMapper userMapper;
@Autowired
private TestMapper testMapper;
@Autowired @Autowired
RedisTemplate redisTemplate; RedisTemplate redisTemplate;
...@@ -61,4 +65,9 @@ public class UserServiceImpl implements UserService { ...@@ -61,4 +65,9 @@ public class UserServiceImpl implements UserService {
public IPage<User> queryPage(Page<User> userPage, User event) { public IPage<User> queryPage(Page<User> userPage, User event) {
return userMapper.queryPage(userPage,event); return userMapper.queryPage(userPage,event);
} }
@Override
public IPage<Map> queryListPage(Page<Map> mapPage, User event) {
return testMapper.queryListPage(mapPage,event);
}
} }
...@@ -4,6 +4,10 @@ import org.springframework.beans.BeansException; ...@@ -4,6 +4,10 @@ import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/** /**
* spring 获取上下文工具类 * spring 获取上下文工具类
...@@ -62,4 +66,11 @@ public class SpringApplicationProvider implements ApplicationContextAware { ...@@ -62,4 +66,11 @@ public class SpringApplicationProvider implements ApplicationContextAware {
public static <T> T getBean(String name, Class<T> clazz) { public static <T> T getBean(String name, Class<T> clazz) {
return getApplicationContext().getBean(name, clazz); return getApplicationContext().getBean(name, clazz);
} }
/**
* 获取HttpServletRequest
*/
public static HttpServletRequest getHttpServletRequest() {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
}
} }
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jz.manage.admin.dao.UserMapper" > <mapper namespace="com.jz.manage.admin.dao.TestUserMapper" >
<select id="getTest" resultType="map"> <select id="getTest" resultType="map">
select * from tb_user; select * from tb_user;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment