Commit 2f573997 by testdl

Merge branch 'master' of http://119.28.51.83/hewei/Jumeirah into dev/lanpingxiong

parents 0ea49585 ced56c6f
...@@ -13,10 +13,11 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,10 +13,11 @@ import org.springframework.web.bind.annotation.RestController;
import java.io.IOException; import java.io.IOException;
/** /**
*
* Hello World Controller * Hello World Controller
**/ **/
@Slf4j @Slf4j
@Api(value = "Hello World2", tags = {"APP Hello World2"}) @Api(value = "权限测试", tags = {"APP Hello World2"})
@RestController @RestController
@RequestMapping("/app") @RequestMapping("/app")
//@Module("api-app") //@Module("api-app")
......
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.api.app.service.AppSmsService; import com.jumeirah.api.app.service.AppSmsService;
import com.jumeirah.api.app.vo.SmsCode;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
...@@ -36,10 +35,10 @@ public class AppSmsController extends BaseController { ...@@ -36,10 +35,10 @@ public class AppSmsController extends BaseController {
*/ */
@GetMapping("/registerOrLoginCode") @GetMapping("/registerOrLoginCode")
@OperationLog(name = "获取注册或登陆的验证码", type = OperationLogType.INFO) @OperationLog(name = "获取注册或登陆的验证码", type = OperationLogType.INFO)
@ApiOperation(value = "获取注册或登陆的验证码", response = SmsCode.class, notes = "本地环境默认666666") @ApiOperation(value = "获取注册或登陆的验证码", response = Object.class, notes = "本地环境默认666666")
public ApiResult<Object> register(@RequestParam String phoneArea, @RequestParam String phone) throws Exception { public ApiResult<Object> registerOrLoginCode(@RequestParam String phoneArea, @RequestParam String phone) throws Exception {
return appSmsService.registerType(phoneArea, phone); return appSmsService.registerOrLoginCode(phoneArea, phone);
} }
} }
......
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.api.app.service.AppUserApiService; import com.jumeirah.api.app.service.AppUserApiService;
import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.param.AppUserPageParam;
import com.jumeirah.common.param.app.AppSmsRegisterParam; import com.jumeirah.common.param.app.AppSmsRegisterParam;
import com.jumeirah.common.param.app.AppUserInfoParam; import com.jumeirah.common.param.app.AppUserInfoParam;
import com.jumeirah.common.service.AppUserService; import com.jumeirah.common.service.AppUserService;
import com.jumeirah.common.vo.AppUserQueryVo;
import com.jumeirah.common.vo.LoginSysUserTokenVo;
import com.jumeirah.common.vo.app.LoginAppUserTokenVo; import com.jumeirah.common.vo.app.LoginAppUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.Module; import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
...@@ -54,16 +44,16 @@ public class AppUserController extends BaseController { ...@@ -54,16 +44,16 @@ public class AppUserController extends BaseController {
* 添加APP用户 * 添加APP用户
*/ */
@PostMapping("/updateAppUserInfo") @PostMapping("/updateAppUserInfo")
// @OperationLog(name = "补充或修改APP用户信息", type = OperationLogType.ADD) @OperationLog(name = "补充或修改APP用户信息", type = OperationLogType.ADD)
@ApiOperation(value = "补充或修改APP用户信息", notes = "不需要修改的字段传入null", response = ApiResult.class) @ApiOperation(value = "补充或修改APP用户信息", notes = "不需要修改的字段传入null或直接不传入该字段,如果传入空双引号的话会将数据置为空 ", response = ApiResult.class)
public ApiResult<Boolean> updateAppUserInfo(@RequestBody AppUserInfoParam appUserInfoParam) throws Exception { public ApiResult<Boolean> updateAppUserInfo(@RequestBody AppUserInfoParam appUserInfoParam) throws Exception {
boolean flag = appUserApiService.updateAppUser(appUserInfoParam); boolean flag = appUserApiService.updateAppUser(appUserInfoParam);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
/** /* *//**
* 添加APP用户 * 添加APP用户
*/ *//*
@PostMapping("/add") @PostMapping("/add")
@OperationLog(name = "添加APP用户", type = OperationLogType.ADD) @OperationLog(name = "添加APP用户", type = OperationLogType.ADD)
@ApiOperation(value = "添加APP用户", response = ApiResult.class) @ApiOperation(value = "添加APP用户", response = ApiResult.class)
...@@ -73,9 +63,9 @@ public class AppUserController extends BaseController { ...@@ -73,9 +63,9 @@ public class AppUserController extends BaseController {
return ApiResult.result(flag); return ApiResult.result(flag);
} }
/** *//**
* 修改APP用户 * 修改APP用户
*/ *//*
@PostMapping("/update") @PostMapping("/update")
@OperationLog(name = "修改APP用户", type = OperationLogType.UPDATE) @OperationLog(name = "修改APP用户", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改APP用户", response = ApiResult.class) @ApiOperation(value = "修改APP用户", response = ApiResult.class)
...@@ -85,9 +75,9 @@ public class AppUserController extends BaseController { ...@@ -85,9 +75,9 @@ public class AppUserController extends BaseController {
return ApiResult.result(flag); return ApiResult.result(flag);
} }
/** *//**
* 删除APP用户 * 删除APP用户
*/ *//*
@PostMapping("/delete/{id}") @PostMapping("/delete/{id}")
@OperationLog(name = "删除APP用户", type = OperationLogType.DELETE) @OperationLog(name = "删除APP用户", type = OperationLogType.DELETE)
@ApiOperation(value = "删除APP用户", response = ApiResult.class) @ApiOperation(value = "删除APP用户", response = ApiResult.class)
...@@ -97,9 +87,9 @@ public class AppUserController extends BaseController { ...@@ -97,9 +87,9 @@ public class AppUserController extends BaseController {
return ApiResult.result(flag); return ApiResult.result(flag);
} }
/** *//**
* 获取APP用户详情 * 获取APP用户详情
*/ *//*
@GetMapping("/info/{id}") @GetMapping("/info/{id}")
@OperationLog(name = "APP用户详情", type = OperationLogType.INFO) @OperationLog(name = "APP用户详情", type = OperationLogType.INFO)
@ApiOperation(value = "APP用户详情", response = AppUserQueryVo.class) @ApiOperation(value = "APP用户详情", response = AppUserQueryVo.class)
...@@ -109,9 +99,11 @@ public class AppUserController extends BaseController { ...@@ -109,9 +99,11 @@ public class AppUserController extends BaseController {
return ApiResult.ok(appUserQueryVo); return ApiResult.ok(appUserQueryVo);
} }
*/
/** /**
* APP用户分页列表 * APP用户分页列表
*/ *//*
@PostMapping("/getPageList") @PostMapping("/getPageList")
@OperationLog(name = "APP用户分页列表", type = OperationLogType.PAGE) @OperationLog(name = "APP用户分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "APP用户分页列表", response = AppUserQueryVo.class) @ApiOperation(value = "APP用户分页列表", response = AppUserQueryVo.class)
...@@ -119,20 +111,12 @@ public class AppUserController extends BaseController { ...@@ -119,20 +111,12 @@ public class AppUserController extends BaseController {
public ApiResult<Paging<AppUserQueryVo>> getAppUserPageList(@Validated @RequestBody AppUserPageParam appUserPageParam) throws Exception { public ApiResult<Paging<AppUserQueryVo>> getAppUserPageList(@Validated @RequestBody AppUserPageParam appUserPageParam) throws Exception {
Paging<AppUserQueryVo> paging = appUserService.getAppUserPageList(appUserPageParam); Paging<AppUserQueryVo> paging = appUserService.getAppUserPageList(appUserPageParam);
return ApiResult.ok(paging); return ApiResult.ok(paging);
} }*/
@PostMapping("/registerOrLogin") @PostMapping("/registerOrLogin")
@ApiOperation(value = "手机号注册+登陆", notes = "app用户注册+登陆", response = LoginSysUserTokenVo.class) @ApiOperation(value = "手机号注册+登陆", notes = "app用户注册+登陆", response = LoginAppUserTokenVo.class)
public ApiResult<LoginAppUserTokenVo> registerOrLogin(@Validated @RequestBody AppSmsRegisterParam appSmsRegisterParam, @RequestHeader(required = false) String language) throws Exception { public ApiResult<LoginAppUserTokenVo> registerOrLogin(@Validated @RequestBody AppSmsRegisterParam appSmsRegisterParam, @RequestHeader(required = false) String language) throws Exception {
return appUserApiService.register(appSmsRegisterParam, language); return appUserApiService.register(appSmsRegisterParam, language);
} }
// @PostMapping("/login")
// @ApiOperation(value = "手机号登陆", notes = "app用户登录", response = LoginSysUserTokenVo.class)
// public ApiResult<LoginAppUserTokenVo> login(@Validated @RequestBody AppSmsRegisterParam loginParam, @RequestHeader(required = false) String language) throws Exception {
//// return appRegisterService.login(loginParam, language);
// return null;
// }
} }
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import cn.hutool.core.date.DateUtil;
import com.jumeirah.api.app.entity.vo.StrokeAddBackAndForthVo; import com.jumeirah.api.app.entity.vo.StrokeAddBackAndForthVo;
import com.jumeirah.api.app.entity.vo.StrokeAddFreightVo; import com.jumeirah.api.app.entity.vo.StrokeAddFreightVo;
import com.jumeirah.api.app.entity.vo.StrokeAddMedicalTreatmentVo; import com.jumeirah.api.app.entity.vo.StrokeAddMedicalTreatmentVo;
import com.jumeirah.api.app.entity.vo.StrokeAddOneWayVo; import com.jumeirah.api.app.entity.vo.StrokeAddOneWayVo;
import com.jumeirah.common.entity.Stroke; import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.service.StrokeService;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import lombok.extern.slf4j.Slf4j;
import com.jumeirah.common.param.StrokePageParam; import com.jumeirah.common.param.StrokePageParam;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import com.jumeirah.common.service.StrokeService;
import com.jumeirah.common.vo.StrokeDetailVo;
import com.jumeirah.common.vo.StrokeQueryVo; import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.common.param.IdParam; import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.core.validator.groups.Add; import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 行程表 控制器 * 行程表 控制器
...@@ -36,9 +38,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -36,9 +38,8 @@ import org.springframework.web.bind.annotation.*;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/stroke") @RequestMapping("/app/stroke")
@Module("${cfg.module}") @Api(value = "行程API", tags = {"行程"})
@Api(value = "行程表API", tags = {"行程表"})
public class StrokeController extends BaseController { public class StrokeController extends BaseController {
@Autowired @Autowired
...@@ -54,8 +55,7 @@ public class StrokeController extends BaseController { ...@@ -54,8 +55,7 @@ public class StrokeController extends BaseController {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddOneWayVo, stroke); BeanUtils.copyProperties(strokeAddOneWayVo, stroke);
stroke.setType(0) stroke.setType(0);
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
...@@ -70,8 +70,7 @@ public class StrokeController extends BaseController { ...@@ -70,8 +70,7 @@ public class StrokeController extends BaseController {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddBackAndForthVo, stroke); BeanUtils.copyProperties(strokeAddBackAndForthVo, stroke);
stroke.setType(1) stroke.setType(1);
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
...@@ -86,8 +85,7 @@ public class StrokeController extends BaseController { ...@@ -86,8 +85,7 @@ public class StrokeController extends BaseController {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddFreightVo, stroke); BeanUtils.copyProperties(strokeAddFreightVo, stroke);
stroke.setType(2) stroke.setType(2);
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
...@@ -103,8 +101,7 @@ public class StrokeController extends BaseController { ...@@ -103,8 +101,7 @@ public class StrokeController extends BaseController {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke stroke = new Stroke(); Stroke stroke = new Stroke();
BeanUtils.copyProperties(strokeAddMedicalTreatmentVo, stroke); BeanUtils.copyProperties(strokeAddMedicalTreatmentVo, stroke);
stroke.setType(3) stroke.setType(3);
.setCreateTime(System.currentTimeMillis());
boolean flag = strokeService.saveStroke(stroke); boolean flag = strokeService.saveStroke(stroke);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
...@@ -137,19 +134,30 @@ public class StrokeController extends BaseController { ...@@ -137,19 +134,30 @@ public class StrokeController extends BaseController {
*/ */
@GetMapping("/info/{id}") @GetMapping("/info/{id}")
@OperationLog(name = "行程表详情", type = OperationLogType.INFO) @OperationLog(name = "行程表详情", type = OperationLogType.INFO)
@ApiOperation(value = "行程表详情", response = StrokeQueryVo.class) @ApiOperation(value = "行程表详情", response = StrokeDetailVo.class)
public ApiResult<StrokeQueryVo> getStroke(@PathVariable("id") Long id) throws Exception { public ApiResult<StrokeDetailVo> getStroke(@PathVariable("id") Long id) throws Exception {
StrokeQueryVo strokeQueryVo = strokeService.getStrokeById(id); StrokeDetailVo strokeQueryVo = strokeService.getStrokeById(id);
return ApiResult.ok(strokeQueryVo); return ApiResult.ok(strokeQueryVo);
} }
// /**
// * 行程表分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "行程表分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "行程表分页列表", response = StrokeQueryVo.class)
// public ApiResult<Paging<StrokeQueryVo>> getStrokePageList(@Validated @RequestBody StrokePageParam strokePageParam) throws Exception {
// Paging<StrokeQueryVo> paging = strokeService.getStrokePageList(strokePageParam);
// return ApiResult.ok(paging);
// }
/** /**
* 行程表分页列表 * 行程表分页列表
*/ */
@PostMapping("/getPageList") @PostMapping("/getMyStrokePageList")
@OperationLog(name = "行程分页列表", type = OperationLogType.PAGE) @OperationLog(name = "行程分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "行程表分页列表", response = StrokeQueryVo.class) @ApiOperation(value = "行程分页列表")
public ApiResult<Paging<StrokeQueryVo>> getStrokePageList(@Validated @RequestBody StrokePageParam strokePageParam) throws Exception { public ApiResult<Paging<StrokeQueryVo>> getMyStrokePageList(@Validated @RequestBody StrokePageParam strokePageParam) throws Exception {
Paging<StrokeQueryVo> paging = strokeService.getStrokePageList(strokePageParam); Paging<StrokeQueryVo> paging = strokeService.getStrokePageList(strokePageParam);
return ApiResult.ok(paging); return ApiResult.ok(paging);
} }
......
...@@ -9,7 +9,7 @@ public interface AppSmsService { ...@@ -9,7 +9,7 @@ public interface AppSmsService {
/** /**
* 获取注册验证码 * 获取注册验证码
*/ */
ApiResult<Object> registerType(String phoneArea, String phone); ApiResult<Object> registerOrLoginCode(String phoneArea, String phone);
/** /**
* 获取注册验证码 * 获取注册验证码
......
...@@ -15,7 +15,7 @@ public interface AppUserApiService { ...@@ -15,7 +15,7 @@ public interface AppUserApiService {
* @throws Exception * @throws Exception
*/ */
ApiResult<LoginAppUserTokenVo> register(AppSmsRegisterParam loginParam, String language) throws Exception; ApiResult<LoginAppUserTokenVo> register(AppSmsRegisterParam loginParam, String language) throws Exception;
ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language) throws Exception; // ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language) throws Exception;
/** /**
* 修改或补充用户信息 * 修改或补充用户信息
......
...@@ -52,7 +52,7 @@ public class AppSmsServiceImpl implements AppSmsService { ...@@ -52,7 +52,7 @@ public class AppSmsServiceImpl implements AppSmsService {
} }
@Override @Override
public ApiResult<Object> registerType(String area, String number) { public ApiResult<Object> registerOrLoginCode(String area, String number) {
return getSmsCodeApiResult(String.format(SMS_REGIEST, area, number), area, number); return getSmsCodeApiResult(String.format(SMS_REGIEST, area, number), area, number);
} }
......
...@@ -29,14 +29,14 @@ public class AppUserApiServiceImpl implements AppUserApiService { ...@@ -29,14 +29,14 @@ public class AppUserApiServiceImpl implements AppUserApiService {
// 校验验证码 // 校验验证码
boolean equalsRegisterCode = appSmsService.equalsRegisterCode(loginParam.getPhoneArea(), loginParam.getPhone(), loginParam.getSmsCode()); boolean equalsRegisterCode = appSmsService.equalsRegisterCode(loginParam.getPhoneArea(), loginParam.getPhone(), loginParam.getSmsCode());
if (!equalsRegisterCode) { if (!equalsRegisterCode) {
return ApiResult.fail(ApiCode.FAIL, new LoginAppUserTokenVo()); return ApiResult.fail(ApiCode.SMS_CODE_ERROR, new LoginAppUserTokenVo());
} }
// 删除已使用的验证码 // 删除已使用的验证码
appSmsService.deleteRegisterCode(loginParam.getPhoneArea(), loginParam.getPhone()); appSmsService.deleteRegisterCode(loginParam.getPhoneArea(), loginParam.getPhone());
// 判断是否已经注册 // 判断是否已经注册
if (appUserService.hasUserByPhoneNumer(loginParam.getPhoneArea(), loginParam.getPhone())) { if (appUserService.hasUserByPhoneNumer(loginParam.getPhoneArea(), loginParam.getPhone())) {
// 如果已经注册直接走登陆的代码 // 如果已经注册直接走登陆的代码
return appUserService.login(loginParam, language); return appUserService.login(loginParam, language, true);
} }
// 没注册则先保存到数据库 // 没注册则先保存到数据库
...@@ -45,17 +45,17 @@ public class AppUserApiServiceImpl implements AppUserApiService { ...@@ -45,17 +45,17 @@ public class AppUserApiServiceImpl implements AppUserApiService {
appUser.setPhone(loginParam.getPhone()); appUser.setPhone(loginParam.getPhone());
boolean isDbOk = appUserService.saveAppUser(appUser); boolean isDbOk = appUserService.saveAppUser(appUser);
if (!isDbOk) { if (!isDbOk) {
return ApiResult.fail(ApiCode.FAIL, new LoginAppUserTokenVo()); return ApiResult.fail(ApiCode.SPRING_BOOT_PLUS_EXCEPTION, new LoginAppUserTokenVo());
} }
// 走登陆的代码 // 走登陆的代码
return appUserService.login(loginParam, language); return appUserService.login(loginParam, language, false);
} }
@Override // @Override
public ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language) throws Exception { // public ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language) throws Exception {
return null; // return null;
} // }
@Override @Override
public boolean updateAppUser(AppUserInfoParam appUserInfoParam) throws Exception { public boolean updateAppUser(AppUserInfoParam appUserInfoParam) throws Exception {
......
package com.jumeirah.common.entity; package com.jumeirah.common.entity;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -15,8 +13,7 @@ import lombok.experimental.Accessors; ...@@ -15,8 +13,7 @@ import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
/** /**
* 行程表 * 行程表
...@@ -40,6 +37,10 @@ public class Stroke extends BaseEntity { ...@@ -40,6 +37,10 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("出发城市id") @ApiModelProperty("出发城市id")
private Long cityOutsetId; private Long cityOutsetId;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
@TableLogic
private Integer deleted;
@NotBlank(message = "出发城市名称不能为空") @NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称") @ApiModelProperty("出发城市名称")
private String cityOutsetName; private String cityOutsetName;
...@@ -62,10 +63,10 @@ public class Stroke extends BaseEntity { ...@@ -62,10 +63,10 @@ public class Stroke extends BaseEntity {
@NotNull(message = "出发时间不能为空") @NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Long outsetTime; private Timestamp outsetTime;
@ApiModelProperty("返程时间") @ApiModelProperty("返程时间")
private Long returnTime; private Timestamp returnTime;
@NotNull(message = "行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空") @NotNull(message = "行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空")
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗") @ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗")
...@@ -77,10 +78,10 @@ public class Stroke extends BaseEntity { ...@@ -77,10 +78,10 @@ public class Stroke extends BaseEntity {
@NotNull(message = "创建时间不能为空") @NotNull(message = "创建时间不能为空")
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Long createTime; private Timestamp createTime;
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Long updateTime; private Timestamp updateTime;
@ApiModelProperty("货物名称") @ApiModelProperty("货物名称")
private String goodsName; private String goodsName;
...@@ -113,6 +114,26 @@ public class Stroke extends BaseEntity { ...@@ -113,6 +114,26 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("用户ID") @ApiModelProperty("用户ID")
private Long userId; private Long userId;
@NotBlank(message = "出发机场名称不能为空")
@ApiModelProperty("出发机场名称")
private String outsetAirportName;
@NotBlank(message = "到达机场名称不能为空")
@ApiModelProperty("到达机场名称")
private String arriveAirportName;
@NotNull(message = "返程飞机型号ID为空")
@ApiModelProperty("返程飞机型号ID")
private Long arrivePlainTypeId;
@NotBlank(message = "返程出发机场名称不能为空")
@ApiModelProperty("返程出发机场名称")
private String backOutsetAirportName;
@NotBlank(message = "返程到达机场名称不能为空")
@ApiModelProperty("返程到达机场名称")
private String backArriveAirportName;
@NotNull(message = "商家id不能为空") @NotNull(message = "商家id不能为空")
@ApiModelProperty("商家id") @ApiModelProperty("商家id")
private Long mcId; private Long mcId;
......
package com.jumeirah.common.enums;
/**
* 状态,0-审核中,1-进行中,2-已完成,99-取消
*/
public enum StrokeStatusEnum {
UNDER_REVIEW(0, "审核中"),
PROCESSING(1, "进行中"),
COMPLETED(2, "已完成"),
CANCEL(99, "取消");
/**
* 编号
*/
private final Integer id;
/**
* 名称
*/
private final String name;
StrokeStatusEnum(Integer id, String name) {
this.id = id;
this.name = name;
}
}
package com.jumeirah.common.enums;
/**
* 行程类型,0-单程,1-往返行程,2-货运,3-医疗
*/
public enum StrokeTypeEnum {
ONE_WAY(0, "单程"),
ROUND_TRIP(1, "往返"),
CARGO_FLIGHT(2, "货运"),
MEDICAL_FLIGHT(3, "医疗");
/**
* 编号
*/
private final Integer id;
/**
* 名称
*/
private final String name;
StrokeTypeEnum(Integer id, String name) {
this.id = id;
this.name = name;
}
}
package com.jumeirah.common.mapper; package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.Stroke; import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.param.StrokePageParam; import com.jumeirah.common.param.StrokePageParam;
import com.jumeirah.common.vo.StrokeDetailVo;
import com.jumeirah.common.vo.StrokeQueryVo; import com.jumeirah.common.vo.StrokeQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable; import java.io.Serializable;
...@@ -28,7 +27,7 @@ public interface StrokeMapper extends BaseMapper<Stroke> { ...@@ -28,7 +27,7 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
* @param id * @param id
* @return * @return
*/ */
StrokeQueryVo getStrokeById(Serializable id); StrokeDetailVo getStrokeById(Serializable id);
/** /**
* 获取分页对象 * 获取分页对象
...@@ -37,6 +36,6 @@ public interface StrokeMapper extends BaseMapper<Stroke> { ...@@ -37,6 +36,6 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
* @param strokePageParam * @param strokePageParam
* @return * @return
*/ */
IPage<StrokeQueryVo> getStrokePageList(@Param("page") Page page,@Param("param") StrokePageParam strokePageParam); IPage<StrokeQueryVo> getStrokePageList(@Param("page") Page page, @Param("param") StrokePageParam strokePageParam, @Param("userId") Long userId);
} }
package com.jumeirah.common.param; package com.jumeirah.common.param;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/** /**
* <pre> * <pre>
...@@ -18,6 +19,10 @@ import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam; ...@@ -18,6 +19,10 @@ import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "行程表分页参数") @ApiModel(value = "行程表分页参数")
public class StrokePageParam extends BasePageOrderParam{ public class StrokePageParam extends BasePageOrderParam {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
}
@ApiModelProperty("行程状态,-1=全部, 0-审核中,1-进行中,2-已完成")//99-取消
private Integer status;
}
...@@ -30,7 +30,7 @@ import java.io.Serializable; ...@@ -30,7 +30,7 @@ import java.io.Serializable;
* @date 2019-05-15 * @date 2019-05-15
**/ **/
@Data @Data
@ApiModel("app手机验证码注册参数") @ApiModel("app手机验证码注册参数AppSmsRegisterParam")
public class AppSmsRegisterParam implements Serializable { public class AppSmsRegisterParam implements Serializable {
@NotBlank(message = "请输入手机区号") @NotBlank(message = "请输入手机区号")
......
...@@ -34,8 +34,8 @@ public class AppUserInfoParam extends BaseEntity { ...@@ -34,8 +34,8 @@ public class AppUserInfoParam extends BaseEntity {
@ApiModelProperty("出生日期") @ApiModelProperty("出生日期")
private String dateOfBirth; private String dateOfBirth;
@ApiModelProperty("昵称") // @ApiModelProperty("昵称")
private String nickname; // private String nickname;
@ApiModelProperty("性别,0:女,1:男,默认1") @ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender; private Integer gender;
......
...@@ -41,7 +41,7 @@ public interface AppUserService extends BaseService<AppUser> { ...@@ -41,7 +41,7 @@ public interface AppUserService extends BaseService<AppUser> {
* @param language * @param language
* @return * @return
*/ */
ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language); ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language,Boolean hasRegister);
/** /**
......
...@@ -2,8 +2,9 @@ package com.jumeirah.common.service; ...@@ -2,8 +2,9 @@ package com.jumeirah.common.service;
import com.jumeirah.common.entity.Stroke; import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.param.StrokePageParam; import com.jumeirah.common.param.StrokePageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService; import com.jumeirah.common.vo.StrokeDetailVo;
import com.jumeirah.common.vo.StrokeQueryVo; import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
/** /**
...@@ -48,7 +49,7 @@ public interface StrokeService extends BaseService<Stroke> { ...@@ -48,7 +49,7 @@ public interface StrokeService extends BaseService<Stroke> {
* @return * @return
* @throws Exception * @throws Exception
*/ */
StrokeQueryVo getStrokeById(Long id) throws Exception; StrokeDetailVo getStrokeById(Long id) throws Exception;
/** /**
* 获取分页对象 * 获取分页对象
......
...@@ -27,8 +27,8 @@ import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo; ...@@ -27,8 +27,8 @@ import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -83,7 +83,7 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser> ...@@ -83,7 +83,7 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
// } // }
@Override @Override
public ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language) { public ApiResult<LoginAppUserTokenVo> login(AppSmsRegisterParam loginParam, String language, Boolean hasRegister) {
// 从数据库中获取登录用户信息 // 从数据库中获取登录用户信息
AppUser appUser = appUserMapper.selectOne(new QueryWrapper<>( AppUser appUser = appUserMapper.selectOne(new QueryWrapper<>(
...@@ -92,13 +92,15 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser> ...@@ -92,13 +92,15 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
if (appUser == null) { if (appUser == null) {
log.error("登录失败,用户名或密码错误 loginParam:{}", loginParam); log.error("登录失败,用户名或密码错误 loginParam:{}", loginParam);
return ApiResult.fail(ApiCode.PWD_OR_USERNAME_ERROR, language); return ApiResult.fail(ApiCode.USER_NOT_FOUND, language);
} }
if (StateEnum.DISABLE.getCode().equals(appUser.getState())) { if (StateEnum.DISABLE.getCode().equals(appUser.getState())) {
throw new AuthenticationException("账号已禁用"); // throw new AuthenticationException("账号已禁用");
} log.error("登录失败,账号已禁用 loginParam:{}", loginParam);
return ApiResult.fail(ApiCode.USER_NOT_FOUND, language);
// 将系统用户对象转换成登录用户对象 }
// 将系统用户对象转换成登录用户对象
LoginUserVo loginSysUserVo = new LoginUserVo(); LoginUserVo loginSysUserVo = new LoginUserVo();
loginSysUserVo.setId(appUser.getId()); loginSysUserVo.setId(appUser.getId());
...@@ -134,10 +136,12 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser> ...@@ -134,10 +136,12 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
redisTemplate.opsForValue().set(tokenSha256, loginSysUserVo, 1, TimeUnit.DAYS); redisTemplate.opsForValue().set(tokenSha256, loginSysUserVo, 1, TimeUnit.DAYS);
// 返回token和登录用户信息对象 // 返回token和登录用户信息对象
LoginAppUserTokenVo loginSysUserTokenVo = new LoginAppUserTokenVo(); LoginAppUserTokenVo loginAppUserTokenVo = new LoginAppUserTokenVo();
loginSysUserTokenVo.setToken(token); BeanUtils.copyProperties(appUser, loginAppUserTokenVo);
loginSysUserTokenVo.setUserId(appUser.getId()); loginAppUserTokenVo.setToken(token);
return ApiResult.ok(loginSysUserTokenVo, language); loginAppUserTokenVo.setId(appUser.getId());
loginAppUserTokenVo.setHasRegister(hasRegister);
return ApiResult.ok(loginAppUserTokenVo);
} }
......
...@@ -184,7 +184,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper, ...@@ -184,7 +184,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
// 设置token响应头 // 设置token响应头
response.setHeader(JwtTokenUtil.getTokenName(), loginSysUserTokenVo.getToken()); response.setHeader(JwtTokenUtil.getTokenName(), loginSysUserTokenVo.getToken());
return ApiResult.ok(loginSysUserTokenVo, language); return ApiResult.ok(loginSysUserTokenVo);
} }
......
package com.jumeirah.common.service.impl; package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.Stroke; import com.jumeirah.common.entity.Stroke;
import com.jumeirah.common.mapper.StrokeMapper; import com.jumeirah.common.mapper.StrokeMapper;
import com.jumeirah.common.service.StrokeService;
import com.jumeirah.common.param.StrokePageParam; import com.jumeirah.common.param.StrokePageParam;
import com.jumeirah.common.service.StrokeService;
import com.jumeirah.common.vo.StrokeDetailVo;
import com.jumeirah.common.vo.StrokeQueryVo; import com.jumeirah.common.vo.StrokeQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl; import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo; import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 行程表 服务实现类 * 行程表 服务实现类
...@@ -44,18 +47,29 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp ...@@ -44,18 +47,29 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean deleteStroke(Long id) throws Exception { public boolean deleteStroke(Long id) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Stroke byId = super.getById(id);
// 判断该记录是否属于此用户
if (!byId.getUserId().equals(jwtToken.getUserId())) {
return false;
}
return super.removeById(id); return super.removeById(id);
} }
@Override @Override
public StrokeQueryVo getStrokeById(Long id) throws Exception { public StrokeDetailVo getStrokeById(Long id) throws Exception {
return strokeMapper.getStrokeById(id); return strokeMapper.getStrokeById(id);
} }
@Override @Override
public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception { public Paging<StrokeQueryVo> getStrokePageList(StrokePageParam strokePageParam) throws Exception {
Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.desc(getLambdaColumn(Stroke::getCreateTime))); Page<StrokeQueryVo> page = new PageInfo<>(strokePageParam, OrderItem.asc(getLambdaColumn(Stroke::getCreateTime)));
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
IPage<StrokeQueryVo> iPage = strokeMapper.getStrokePageList(page, strokePageParam, jwtToken.getUserId());
return new Paging<StrokeQueryVo>(iPage); return new Paging<StrokeQueryVo>(iPage);
} }
......
...@@ -189,7 +189,7 @@ public class SysLoginServiceImpl implements SysLoginService { ...@@ -189,7 +189,7 @@ public class SysLoginServiceImpl implements SysLoginService {
// 设置token响应头 // 设置token响应头
response.setHeader(JwtTokenUtil.getTokenName(), loginSysUserTokenVo.getToken()); response.setHeader(JwtTokenUtil.getTokenName(), loginSysUserTokenVo.getToken());
return ApiResult.ok(loginSysUserTokenVo, language); return ApiResult.ok(loginSysUserTokenVo);
} }
@Override @Override
......
package com.jumeirah.common.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* <pre>
* 行程表 查询结果对象
* </pre>
*
* @author wei
* @date 2020-09-29
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "StrokeDetailVo对象")
public class StrokeDetailVo implements Serializable {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
@TableLogic
private Integer deleted;
@NotBlank(message = "出发城市名称不能为空")
@ApiModelProperty("出发城市名称")
private String cityOutsetName;
@NotNull(message = "到达城市id不能为空")
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@NotBlank(message = "到达城市名称不能为空")
@ApiModelProperty("到达城市名称")
private String cityArriveName;
@NotNull(message = "人数不能为空")
@ApiModelProperty("人数")
private Integer peopleMun;
@NotNull(message = "飞机型号ID不能为空")
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@NotNull(message = "出发时间不能为空")
@ApiModelProperty("出发时间")
private Timestamp outsetTime;
@ApiModelProperty("返程时间")
private Timestamp returnTime;
@NotNull(message = "行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空")
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗")
private Integer type;
@NotNull(message = "状态,0-审核中,1-进行中,2-已完成,99-取消不能为空")
@ApiModelProperty("状态,0-审核中,1-进行中,2-已完成,99-取消")
private Integer status;
@NotNull(message = "创建时间不能为空")
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
@ApiModelProperty("货物名称")
private String goodsName;
@ApiModelProperty("货物体积(长*宽*高) 单位:CM,例如:100*102*120")
private String goodsSize;
@ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight;
@ApiModelProperty("病人疾病名称")
private String diseaseName;
@ApiModelProperty("病人病情诊断书")
private String medicalCertificateUrl;
@ApiModelProperty("配备器械(格式:1,2,3)逗号分隔")
private String instruments;
@ApiModelProperty("医护人员,0-医生,1-护士,2-护工(格式:0,1,2)逗号分隔")
private String medicalPersons;
@ApiModelProperty("备注")
private String remarks;
@ApiModelProperty("价格")
private BigDecimal money;
@NotNull(message = "用户ID不能为空")
@ApiModelProperty("用户ID")
private Long userId;
@NotNull(message = "商家id不能为空")
@ApiModelProperty("商家id")
private Long mcId;
@NotNull(message = "用户选择机型不能为空")
@ApiModelProperty("用户选择机型")
private Long choosePlainType;
@NotBlank(message = "出发机场名称不能为空")
@ApiModelProperty("出发机场名称")
private String outsetAirportName;
@NotBlank(message = "到达机场名称不能为空")
@ApiModelProperty("到达机场名称")
private String arriveAirportName;
@NotNull(message = "返程飞机型号ID为空")
@ApiModelProperty("返程飞机型号ID")
private Long arrivePlainTypeId;
@NotBlank(message = "返程出发机场名称不能为空")
@ApiModelProperty("返程出发机场名称")
private String backOutsetAirportName;
@NotBlank(message = "返程到达机场名称不能为空")
@ApiModelProperty("返程到达机场名称")
private String backArriveAirportName;
@ApiModelProperty("商家名称")
private String merchantName;
}
\ No newline at end of file
package com.jumeirah.common.vo; package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.math.BigDecimal;
import java.sql.Timestamp;
/** /**
* <pre> * <pre>
...@@ -18,75 +22,56 @@ import java.util.Date; ...@@ -18,75 +22,56 @@ import java.util.Date;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "StrokeQueryVo对象") @ApiModel(value = "StrokeQueryVo对象")
public class StrokeQueryVo implements Serializable{ public class StrokeQueryVo implements Serializable {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID") @ApiModelProperty("主键ID")
private Long id; private Long id;
@ApiModelProperty("出发城市id")
private Long cityOutsetId;
@ApiModelProperty("出发城市名称") @ApiModelProperty("出发城市名称")
private String cityOutsetName; private String cityOutsetName;
@ApiModelProperty("到达城市id")
private Long cityArriveId;
@ApiModelProperty("到达城市名称") @ApiModelProperty("到达城市名称")
private String cityArriveName; private String cityArriveName;
@ApiModelProperty("人数")
private Integer peopleMun;
@ApiModelProperty("飞机型号ID")
private Long plainTypeId;
@ApiModelProperty("出发时间") @ApiModelProperty("出发时间")
private Date outsetTime; private Timestamp outsetTime;
@ApiModelProperty("返程时间") @ApiModelProperty("返程时间")
private Date returnTime; private Timestamp returnTime;
@ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗") @ApiModelProperty("行程类型,0-单程,1-往返行程,2-货运,3-医疗")
private Integer type; private Integer type;
@ApiModelProperty("状态,0-审核中,1-进行中,2-已完成,99-取消") @ApiModelProperty("状态,0-审核中,1-进行中,2-已完成,99-取消")
private Integer status; private Integer status;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新时间") @ApiModelProperty("价格")
private Long updateTime; private BigDecimal money;
@ApiModelProperty("货物名称") @ApiModelProperty("用户ID")
private String goodsName; private Long userId;
@ApiModelProperty("货物体积(长*宽*高) 单位:CM,例如:100*102*120")
private String goodsSize;
@ApiModelProperty("货物重量,单位:吨")
private Double goodsWeight;
@ApiModelProperty("病人疾病名称")
private String diseaseName;
@ApiModelProperty("病人病情诊断书") @ApiModelProperty("商家名称")
private String aegerUrl; private String merchantName;
@ApiModelProperty("配备器械(格式:1,2,3)逗号分隔") @NotBlank(message = "出发机场名称不能为空")
private String instruments; @ApiModelProperty("出发机场名称")
private String outsetAirportName;
@ApiModelProperty("医护人员,0-医生,1-护士,2-护工(格式:0,1,2)逗号分隔") @NotBlank(message = "到达机场名称不能为空")
private String medicalPersons; @ApiModelProperty("到达机场名称")
private String arriveAirportName;
@ApiModelProperty("备注") @NotNull(message = "返程飞机型号ID为空")
private String remarks; @ApiModelProperty("返程飞机型号ID")
private Long arrivePlainTypeId;
@ApiModelProperty("价格,单位:分") @NotBlank(message = "返程出发机场名称不能为空")
private Long money; @ApiModelProperty("返程出发机场名称")
private String backOutsetAirportName;
@ApiModelProperty("用户ID") @NotBlank(message = "返程到达机场名称不能为空")
private Long userId; @ApiModelProperty("返程到达机场名称")
private String backArriveAirportName;
} }
\ No newline at end of file
...@@ -28,23 +28,48 @@ import lombok.experimental.Accessors; ...@@ -28,23 +28,48 @@ import lombok.experimental.Accessors;
**/ **/
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel("登录用户信息TokenVO") @ApiModel("登录用户信息LoginAppUserTokenVo")
public class LoginAppUserTokenVo implements LoginToken { public class LoginAppUserTokenVo implements LoginToken {
@ApiModelProperty("token") @ApiModelProperty("token")
private String token; private String token;
@ApiModelProperty("主键") @ApiModelProperty("主键")
private Long userId; private Long id;
@ApiModelProperty("用户名") // @ApiModelProperty("用户名")
private String username; // private String username;
@ApiModelProperty("是否已经注册, true = 已经注册, false = 没有注册")
private Boolean hasRegister;
@ApiModelProperty("姓")
private String surname;
@ApiModelProperty("名")
private String name;
@ApiModelProperty("公司名")
private String companyName;
@ApiModelProperty("微信号")
private String wechat;
@ApiModelProperty("出生日期")
private String dateOfBirth;
// @ApiModelProperty("昵称") // @ApiModelProperty("昵称")
// private String nickname; // private String nickname;
// /** @ApiModelProperty("手机号码")
// * 登录用户对象 private String phone;
// */
// private LoginUserVo loginSysUserVo; @ApiModelProperty("手机区号")
private String phoneArea;
@ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender;
@ApiModelProperty("头像")
private String head;
} }
...@@ -2,21 +2,53 @@ ...@@ -2,21 +2,53 @@
<!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.jumeirah.common.mapper.StrokeMapper"> <mapper namespace="com.jumeirah.common.mapper.StrokeMapper">
<!-- 分页列表查询结果列 -->
<sql id="Page_Column_List">
s.id,
city_outset_id,
city_outset_name,
city_arrive_id,
city_arrive_name,
people_mun,
plain_type_id,
outset_time,
return_time,
type,
STATUS,
money,
user_id,
mu.username AS merchantName
,outset_airport_name,arrive_airport_name,arrive_plain_type_id,back_outset_airport_name,back_arrive_airport_name
</sql>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, city_outset_id, city_outset_name, city_arrive_id, city_arrive_name, people_mun, plain_type_id, outset_time, return_time, type, status, create_time, update_time, goods_name, goods_size, goods_weight, disease_name, aeger_url, instruments, medical_persons, remarks, money, user_id id, city_outset_id, deleted, city_outset_name, city_arrive_id, city_arrive_name, people_mun, plain_type_id, outset_time, return_time, type, status, create_time, update_time, goods_name, goods_size, goods_weight, disease_name, instruments, medical_persons, remarks, money, user_id
,outset_airport_name,arrive_airport_name,arrive_plain_type_id,back_outset_airport_name,back_arrive_airport_name
</sql> </sql>
<select id="getStrokeById" resultType="com.jumeirah.common.vo.StrokeQueryVo"> <select id="getStrokeById" resultType="com.jumeirah.common.vo.StrokeDetailVo">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from stroke where id = #{id} from stroke where id = #{id}
</select> </select>
<select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam" resultType="com.jumeirah.common.vo.StrokeQueryVo"> <select id="getStrokePageList" parameterType="com.jumeirah.common.param.StrokePageParam"
resultType="com.jumeirah.common.vo.StrokeQueryVo">
select select
<include refid="Base_Column_List"/> <include refid="Page_Column_List"/>
from stroke from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id
<where>
and s.user_id = #{userId}
and s.deleted = 0
<if test="param.status != -1">
-- 查询全部 = -1
and s.`status` = #{param.status}
</if>
</where>
</select> </select>
</mapper> </mapper>
#/** #/**
#* 操作成功 #* 操作成功
#**/ #**/
api.response.code.SUCCESS=SUCCESS api.response.code.SUCCESS=success
#/** #/**
#* 非法访问 #* 非法访问
#**/ #**/
...@@ -76,3 +76,5 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION ...@@ -76,3 +76,5 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION
#*/ #*/
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION
api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error
api.response.code.user.SMS_CODE_ERROR=sms code error
api.response.code.user.USER_NOT_FOUND=user not found
\ No newline at end of file
...@@ -76,3 +76,5 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION ...@@ -76,3 +76,5 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION
#*/ #*/
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION
api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error KH api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error KH
api.response.code.user.SMS_CODE_ERROR=sms code error
api.response.code.user.USER_NOT_FOUND=user not found
\ No newline at end of file
...@@ -76,3 +76,5 @@ api.response.code.JWTDECODE_EXCEPTION=Token解析异常 ...@@ -76,3 +76,5 @@ api.response.code.JWTDECODE_EXCEPTION=Token解析异常
#*/ #*/
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=默认的异常处理 api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=默认的异常处理
api.response.code.user.PWD_OR_USERNAME_ERROR=账号或密码错误 api.response.code.user.PWD_OR_USERNAME_ERROR=账号或密码错误
api.response.code.user.SMS_CODE_ERROR=验证码错误
api.response.code.user.USER_NOT_FOUND=用户不存在
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
create database if not exists Jumeirah character set utf8mb4 COLLATE utf8mb4_unicode_ci;
use Jumeirah;
create table if not exists foo_bar
(
id bigint auto_increment comment 'ID'
primary key,
name varchar(20) not null comment 'Name',
foo varchar(20) null comment 'Foo',
bar varchar(20) not null comment 'Bar',
remark varchar(200) null comment 'Remark',
state int default 1 not null comment 'State,0:Disable,1:Enable',
version int default 0 not null comment 'Version',
create_time timestamp default CURRENT_TIMESTAMP null comment 'Create Time',
update_time timestamp null comment 'Update Time'
)
comment 'FooBar';
create table if not exists example_order
(
id bigint auto_increment comment '主键'
primary key,
name varchar(20) not null comment '订单名称',
order_no varchar(100) null comment '订单编号',
remark varchar(200) null comment '备注',
state int default 1 not null comment '状态,0:禁用,1:启用',
version int default 0 not null comment '版本',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
update_time timestamp null comment '修改时间'
)
comment '订单示例';
create table if not exists ip_address
(
id bigint auto_increment
primary key,
ip_start varchar(15) not null,
ip_end varchar(15) not null,
area varchar(45) null comment '区域',
operator varchar(6) null comment '运营商',
ip_start_num bigint(10) not null,
ip_end_num bigint(10) not null
)
comment 'IP地址';
create index ip_address_ip_end_num_index
on ip_address (ip_end_num);
create index ip_address_ip_start_num_index
on ip_address (ip_start_num);
create table if not exists sys_department
(
id bigint auto_increment comment '主键'
primary key,
name varchar(32) not null comment '部门名称',
parent_id bigint null comment '父id',
level int null comment '部门层级',
state int default 1 not null comment '状态,0:禁用,1:启用',
sort int default 0 not null comment '排序',
remark varchar(200) null comment '备注',
version int default 0 not null comment '版本',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
update_time timestamp null comment '修改时间',
constraint sys_department_name_uindex
unique (name)
)
comment '部门';
create table if not exists sys_permission
(
id bigint auto_increment comment '主键'
primary key,
name varchar(32) null comment '权限名称',
parent_id bigint null comment '父id',
url varchar(200) null comment '路径',
code varchar(100) not null comment '唯一编码',
icon varchar(100) null comment '图标',
type int not null comment '类型,1:菜单,2:按钮',
level int not null comment '层级,1:第一级,2:第二级,N:第N级',
state int default 1 not null comment '状态,0:禁用,1:启用',
sort int default 0 not null comment '排序',
remark varchar(200) null comment '备注',
version int default 0 not null comment '版本',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
update_time timestamp null comment '修改时间',
constraint sys_permission_code_uindex
unique (code)
)
comment '系统权限';
create table if not exists sys_role
(
id bigint auto_increment comment '主键'
primary key,
name varchar(32) not null comment '角色名称',
code varchar(100) null comment '角色唯一编码',
type int null comment '角色类型',
state int default 1 not null comment '角色状态,0:禁用,1:启用',
remark varchar(200) null comment '备注',
version int default 0 not null comment '版本',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
update_time timestamp null comment '修改时间',
constraint sys_role_name_uindex
unique (name)
)
comment '系统角色';
create table if not exists sys_role_permission
(
id bigint auto_increment comment '主键'
primary key,
role_id bigint not null comment '角色id',
permission_id bigint not null comment '权限id',
state int default 1 not null comment '状态,0:禁用,1:启用',
remark varchar(200) null comment '备注',
version int default 0 not null comment '版本',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
update_time timestamp null comment '修改时间'
)
comment '角色权限关系';
create index permission_id
on sys_role_permission (permission_id);
create index role_id
on sys_role_permission (role_id);
create table if not exists sys_user
(
id bigint auto_increment comment '主键'
primary key,
username varchar(20) not null comment '用户名',
nickname varchar(20) null comment '昵称',
password varchar(64) not null comment '密码',
salt varchar(32) null comment '盐值',
phone varchar(20) not null comment '手机号码',
gender int default 1 not null comment '性别,0:女,1:男,默认1',
head varchar(200) null comment '头像',
remark varchar(200) null comment '备注',
state int default 1 not null comment '状态,0:禁用,1:启用,2:锁定',
department_id bigint not null comment '部门id',
role_id bigint not null comment '角色id',
deleted int default 0 not null comment '逻辑删除,0:未删除,1:已删除',
version int default 0 not null comment '版本',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
update_time timestamp null comment '修改时间',
constraint sys_user_username_uindex
unique (username)
)
comment '系统用户';
create index department_id
on sys_user (department_id);
create index role_id
on sys_user (role_id);
create table if not exists sys_login_log
(
id bigint(18) auto_increment comment '主键'
primary key,
request_id varchar(32) null comment '请求ID',
username varchar(32) null comment '用户名称',
ip varchar(15) null comment 'IP',
area varchar(45) null comment '区域',
operator varchar(6) null comment '运营商',
token varchar(32) null comment 'tokenMd5值',
type int null comment '1:登录,2:登出',
success tinyint(1) default 0 not null comment '是否成功 true:成功/false:失败',
code int null comment '响应码',
exception_message varchar(300) null comment '失败消息记录',
user_agent varchar(300) null comment '浏览器名称',
browser_name varchar(100) null comment '浏览器名称',
browser_version varchar(100) null comment '浏览器版本',
engine_name varchar(100) null comment '浏览器引擎名称',
engine_version varchar(100) null comment '浏览器引擎版本',
os_name varchar(100) null comment '系统名称',
platform_name varchar(100) null comment '平台名称',
mobile tinyint(1) null comment '是否是手机,0:否,1:是',
device_name varchar(100) null comment '移动端设备名称',
device_model varchar(100) null comment '移动端设备型号',
remark varchar(200) null comment '备注',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
update_time datetime null comment '修改时间'
)
comment '系统登录日志';
create table if not exists sys_operation_log
(
id bigint(18) auto_increment comment '主键'
primary key,
request_id varchar(32) null comment '请求ID',
user_id bigint(18) null comment '用户ID',
user_name varchar(32) null comment '用户名称',
name varchar(200) null comment '日志名称',
ip varchar(15) null comment 'IP',
area varchar(45) null comment '区域',
operator varchar(6) null comment '运营商',
path varchar(500) null comment '全路径',
module varchar(100) null comment '模块名称',
class_name varchar(100) null comment '类名',
method_name varchar(100) null comment '方法名称',
request_method varchar(10) null comment '请求方式,GET/POST',
content_type varchar(100) null comment '内容类型',
request_body tinyint(1) null comment '是否是JSON请求映射参数',
param text null comment '请求参数',
token varchar(32) null comment 'tokenMd5值',
type int null comment '0:其它,1:新增,2:修改,3:删除,4:详情查询,5:所有列表,6:分页列表,7:其它查询,8:上传文件',
success tinyint(1) null comment '0:失败,1:成功',
code int null comment '响应结果状态码',
message varchar(100) null comment '响应结果消息',
exception_name varchar(200) null comment '异常类名称',
exception_message varchar(300) null comment '异常信息',
browser_name varchar(100) null comment '浏览器名称',
browser_version varchar(100) null comment '浏览器版本',
engine_name varchar(100) null comment '浏览器引擎名称',
engine_version varchar(100) null comment '浏览器引擎版本',
os_name varchar(100) null comment '系统名称',
platform_name varchar(100) null comment '平台名称',
mobile tinyint(1) null comment '是否是手机,0:否,1:是',
device_name varchar(100) null comment '移动端设备名称',
device_model varchar(100) null comment '移动端设备型号',
remark varchar(200) null comment '备注',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
update_time datetime null comment '修改时间'
)
comment '系统操作日志';
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (1, 'admin', '管理员', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889900', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 00:00:00', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (2, 'test', '测试人员1', '34783fb724b259beb71a1279f7cd93bdcfd92a273d566f926419a37825c500df', '087c2e9857f35f1e243367f3b89b81c1', '15888889901', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Tester Account', 1, 1, 2, 0, 1, '2020-02-26 00:00:01', '2020-02-15 19:31:50');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (3, 'admin1', '管理员1', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889902', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 00:09:09', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (4, 'admin2', '管理员2', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889903', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 16:10:06', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (5, 'admin3', '管理员3', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889904', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 16:10:06', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (6, 'admin4', '管理员4', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889905', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 16:10:06', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (7, 'admin5', '管理员5', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889906', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 23:59:59', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (8, 'admin6', '管理员6', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-26 23:59:59', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (9, 'admin7', '管理员7', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-02-20 23:59:59', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (10, 'admin8', '管理员8', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2020-01-30 22:56:55', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (11, 'admin9', '管理员9', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2019-12-30 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (12, 'admin10', '管理员10', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (13, 'admin11', '管理员11', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 1, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (14, 'admin12', '管理员12', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 2, '2019-08-26 00:52:01', '2020-02-27 14:05:40');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (15, 'admin13', '管理员13uuu', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 3, '2019-08-26 00:52:01', '2020-02-27 14:05:18');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (16, 'admin14', '管理员14', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 0, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (17, 'admin15', '管理员15', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 0, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (18, 'admin16', '管理员16', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 0, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (19, 'admin17', '管理员17', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (20, 'admin18', '管理员18', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (21, 'admin19', '管理员19', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (22, 'admin20', '管理员20', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (23, 'admin21', '管理员21', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 0, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (24, 'admin22', '管理员22', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 0, 1, 1, 0, 1, '2019-08-26 00:52:01', '2019-10-27 23:32:29');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (25, 'admin23', '管理员23', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '666', '15888889999', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'Administrator Account', 2, 1, 1, 0, 3, '2019-08-26 00:52:01', '2020-02-27 14:42:28');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (100, 'dddd', 'ddddd', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', 'aa98a65fa53d198f38d8e3a63f3f5a65', 'ddddddddddd', 1, 'http://localhost:8888/api/resource/201908201013068.png', 'dddddddd', 1, 1, 1, 0, 1, '2020-02-26 14:06:53', '2020-02-27 14:06:52');
INSERT INTO sys_user (id, username, nickname, password, salt, phone, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time) VALUES (101, 'adminx', '111111', '11a254dab80d52bc4a347e030e54d861a9d2cdb2af2185a9ca4a7318e830d04d', '1faf81180b4a4a78c48d7c31479a0622', '11111111111', 1, 'http://localhost:8888/api/resource/201908201013068.png', '1111111111', 1, 1, 1, 1, 6, '2020-02-26 14:19:57', '2020-03-02 17:33:48');
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (1, '技术部', null, 1, 1, 359544077, 'fe8c9cbac0c54395ac411335a31f4888', 15, '2019-10-25 09:46:49', '2019-11-13 19:56:07');
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (2, '研发部', null, 1, 1, 0, null, 0, '2019-11-01 20:45:43', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (20, '前端开发部', 2, 2, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (21, '后台开发部', 2, 2, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (22, '测试部', 2, 2, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (201, '前端一组', 20, 3, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (202, '前端二组', 20, 3, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (203, '后台一组', 21, 3, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (204, '后台二组', 21, 3, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_department (id, name, parent_id, level, state, sort, remark, version, create_time, update_time) VALUES (205, '测试一组', 22, 3, 1, 0, null, 0, '2019-11-01 20:48:38', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (1, '管理员', 'admin', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (2, 'test', 'test', null, 1, '测试人员拥有部分权限', 0, '2019-10-25 09:48:02', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (3, '管理员1', 'admin1', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (4, '管理员2', 'admin2', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (5, '管理员3', 'admin3', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (6, '管理员4', 'admin4', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (7, '管理员5', 'admin5', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (8, '管理员6', 'admin6', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (9, '管理员7', 'admin7', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (10, '管理员8', 'admin8', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (11, '管理员9', 'admin9', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (12, '管理员10', 'admin10', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (13, '管理员11', 'admin11', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (14, '管理员12', 'admin12', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (15, '管理员13', 'admin13', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (16, '管理员14', 'admin14', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (17, '管理员15', 'admin15', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (18, '管理员16', 'admin16', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (19, '管理员17', 'admin17', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (20, '管理员18', 'admin18', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (21, '管理员19', 'admin19', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (22, '管理员20', 'admin20', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_role (id, name, code, type, state, remark, version, create_time, update_time) VALUES (23, '管理员21', 'admin21', null, 1, '管理员拥有所有权限', 0, '2019-10-25 09:47:21', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1, '系统管理', null, null, 'system:management', 'el-icon-s-unfold', 1, 1, 1, 0, '1权限备注', 0, '2019-10-26 11:12:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (100, '用户管理', 1, null, 'sys:user:management', 'el-icon-s-unfold', 1, 2, 1, 0, '100权限备注', 0, '2019-10-26 11:15:48', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (200, '角色管理', 1, null, 'sys:role:management', 'el-icon-s-unfold', 1, 2, 1, 0, '200权限备注', 0, '2019-10-26 11:15:48', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (300, '权限管理', 1, null, 'sys:permission:management', 'el-icon-s-unfold', 1, 2, 1, 0, '300权限备注', 0, '2019-10-26 11:15:48', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (400, '部门管理', 1, null, 'sys:department:management', 'el-icon-s-unfold', 1, 2, 1, 0, '400权限备注', 0, '2019-10-26 11:15:48', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (500, '日志管理', 1, null, 'sys:log:manager', 'el-icon-s-custom', 1, 2, 1, 0, '500权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1000, '用户新增', 100, null, 'sys:user:add', 'el-icon-s-custom', 2, 3, 1, 0, '1000权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1001, '用户修改', 100, null, 'sys:user:update', 'el-icon-s-custom', 2, 3, 1, 0, '1001权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1002, '用户删除', 100, null, 'sys:user:delete', 'el-icon-s-custom', 2, 3, 1, 0, '1002权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1003, '用户详情', 100, null, 'sys:user:info', 'el-icon-s-custom', 2, 3, 1, 0, '1003权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1004, '用户分页列表', 100, null, 'sys:user:page', 'el-icon-s-custom', 2, 3, 1, 0, '1004权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1005, '用户修改密码', 100, null, 'sys:user:update:password', 'el-icon-s-custom', 2, 3, 1, 0, '1005权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1006, '用户修改头像', 100, null, 'sys:user:update:head', 'el-icon-s-custom', 2, 3, 1, 0, '1006权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (1007, '用户重置密码', 100, null, 'sys:user:reset:password', 'el-icon-s-custom', 2, 3, 1, 0, '1007权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2000, '角色新增', 200, null, 'sys:role:add', 'el-icon-s-custom', 2, 3, 1, 0, '2000权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2001, '角色修改', 200, null, 'sys:role:update', 'el-icon-s-custom', 2, 3, 1, 0, '2001权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2002, '角色删除', 200, null, 'sys:role:delete', 'el-icon-s-custom', 2, 3, 1, 0, '2002权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2003, '角色详情', 200, null, 'sys:role:info', 'el-icon-s-custom', 2, 3, 1, 0, '2003权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2004, '角色分页列表', 200, null, 'sys:role:page', 'el-icon-s-custom', 2, 3, 1, 0, '2004权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2005, '角色列表', 200, null, 'sys:role:list', 'el-icon-s-custom', 2, 3, 1, 0, '2005权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (2006, '角色权限ID列表', 200, null, 'sys:permission:three-ids-by-role-id', 'el-icon-s-custom', 2, 3, 1, 0, '2006权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3000, '权限新增', 300, null, 'sys:permission:add', 'el-icon-s-custom', 2, 3, 1, 0, '3000权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3001, '权限修改', 300, null, 'sys:permission:update', 'el-icon-s-custom', 2, 3, 1, 0, '3001权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3002, '权限删除', 300, null, 'sys:permission:delete', 'el-icon-s-custom', 2, 3, 1, 0, '3002权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3003, '权限详情', 300, null, 'sys:permission:info', 'el-icon-s-custom', 2, 3, 1, 0, '3003权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3004, '权限分页列表', 300, null, 'sys:permission:page', 'el-icon-s-custom', 2, 3, 1, 0, '3004权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3005, '权限所有列表', 300, null, 'sys:permission:all:menu:list', 'el-icon-s-custom', 2, 3, 1, 0, '3005权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3006, '权限所有树形列表', 300, null, 'sys:permission:all:menu:tree', 'el-icon-s-custom', 2, 3, 1, 0, '3006权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3007, '权限用户列表', 300, null, 'sys:permission:menu:list', 'el-icon-s-custom', 2, 3, 1, 0, '3007权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3008, '权限用户树形列表', 300, null, 'sys:permission:menu:tree', 'el-icon-s-custom', 2, 3, 1, 0, '3008权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3009, '权限用户代码列表', 300, null, 'sys:permission:codes', 'el-icon-s-custom', 2, 3, 1, 0, '3009权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3010, '导航菜单', 300, null, 'sys:permission:nav-menu', 'el-icon-s-custom', 2, 3, 1, 0, '3010权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (3011, '角色权限修改', 300, null, 'sys:role-permission:update', 'el-icon-s-custom', 2, 3, 1, 0, '3011权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4000, '部门新增', 400, null, 'sys:department:add', 'el-icon-s-custom', 2, 3, 1, 0, '4000权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4001, '部门修改', 400, null, 'sys:department:update', 'el-icon-s-custom', 2, 3, 1, 0, '4001权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4002, '部门删除', 400, null, 'sys:department:delete', 'el-icon-s-custom', 2, 3, 1, 0, '4002权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4003, '部门详情', 400, null, 'sys:department:info', 'el-icon-s-custom', 2, 3, 1, 0, '4003权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4004, '部门分页列表', 400, null, 'sys:department:page', 'el-icon-s-custom', 2, 3, 1, 0, '4004权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4005, '部门列表', 400, null, 'sys:department:list', 'el-icon-s-custom', 2, 3, 1, 0, '4005权限备注', 1, '2019-10-26 11:18:40', '2020-03-09 00:50:13');
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (4006, '部门树形列表', 400, null, 'sys:department:all:tree', 'el-icon-s-custom', 2, 3, 1, 0, '4006权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (5001, '操作日志列表', 500, null, 'sys:operation:log:page', 'el-icon-s-custom', 2, 3, 1, 0, '5001权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_permission (id, name, parent_id, url, code, icon, type, level, state, sort, remark, version, create_time, update_time) VALUES (5002, '登录日志列表', 500, null, 'sys:login:log:page', 'el-icon-s-custom', 2, 3, 1, 0, '5002权限备注', 0, '2019-10-26 11:18:40', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (303, 1, 3008, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (304, 1, 1, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (305, 1, 3009, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (306, 1, 3010, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (307, 1, 3011, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (308, 1, 200, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (309, 1, 5001, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (310, 1, 5002, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (311, 1, 2000, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (312, 1, 400, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (313, 1, 2001, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (314, 1, 2002, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (315, 1, 2003, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (316, 1, 2004, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (317, 1, 2005, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (318, 1, 2006, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (319, 1, 4000, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (320, 1, 4001, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (321, 1, 4002, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (322, 1, 4003, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (323, 1, 100, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (324, 1, 4004, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (325, 1, 4005, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (326, 1, 4006, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (327, 1, 1000, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (328, 1, 1001, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (329, 1, 1002, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (330, 1, 1003, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (331, 1, 1004, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (332, 1, 300, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (333, 1, 1005, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (334, 1, 1006, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (335, 1, 1007, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (336, 1, 500, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (337, 1, 3000, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (338, 1, 3001, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (339, 1, 3002, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (340, 1, 3003, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (341, 1, 3004, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (342, 1, 3005, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (343, 1, 3006, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO sys_role_permission (id, role_id, permission_id, state, remark, version, create_time, update_time) VALUES (344, 1, 3007, 1, null, 0, '2020-04-01 00:14:36', null);
INSERT INTO foo_bar (id, name, foo, bar, remark, state, version, create_time, update_time) VALUES (1, 'test add', 'hello', 'world', '备注', 1, 0, '2020-03-20 11:22:35', null);
INSERT INTO example_order (id, name, order_no, remark, state, version, create_time, update_time) VALUES (1, 'AAA', null, null, 1, 0, '2020-03-12 22:25:35', null);
INSERT INTO example_order (id, name, order_no, remark, state, version, create_time, update_time) VALUES (2, 'BBB', null, null, 1, 0, '2020-03-12 22:25:35', null);
INSERT INTO example_order (id, name, order_no, remark, state, version, create_time, update_time) VALUES (3, 'CCC', null, null, 1, 0, '2020-03-12 22:25:35', null);
INSERT INTO sys_login_log (id, request_id, username, ip, area, operator, token, type, success, code, exception_message, user_agent, browser_name, browser_version, engine_name, engine_version, os_name, platform_name, mobile, device_name, device_model, remark, create_time, update_time) VALUES (1, '1242813712335691777', 'admin', '127.0.0.1', '本机地址', null, 'c87aaffa35dadafb066cf18679eab36e', 1, 1, 200, null, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', 'Chrome', '80.0.3987.149', 'Webkit', '537.36', 'OSX', 'Mac', 0, null, null, null, '2020-03-25 22:01:11', null);
INSERT INTO sys_login_log (id, request_id, username, ip, area, operator, token, type, success, code, exception_message, user_agent, browser_name, browser_version, engine_name, engine_version, os_name, platform_name, mobile, device_name, device_model, remark, create_time, update_time) VALUES (2, '1242813887884091393', 'admin', '127.0.0.1', '本机地址', null, 'c87aaffa35dadafb066cf18679eab36e', 2, 1, 200, null, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', 'Chrome', '80.0.3987.149', 'Webkit', '537.36', 'OSX', 'Mac', 0, null, null, null, '2020-03-25 22:01:48', null);
INSERT INTO sys_login_log (id, request_id, username, ip, area, operator, token, type, success, code, exception_message, user_agent, browser_name, browser_version, engine_name, engine_version, os_name, platform_name, mobile, device_name, device_model, remark, create_time, update_time) VALUES (3, '1242814069371625474', 'admin', '127.0.0.1', '本机地址', null, null, 1, 0, null, '用户名或密码错误', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', 'Chrome', '80.0.3987.149', 'Webkit', '537.36', 'OSX', 'Mac', 0, null, null, null, '2020-03-25 22:02:25', null);
INSERT INTO sys_login_log (id, request_id, username, ip, area, operator, token, type, success, code, exception_message, user_agent, browser_name, browser_version, engine_name, engine_version, os_name, platform_name, mobile, device_name, device_model, remark, create_time, update_time) VALUES (4, '1242814192096960513', null, '127.0.0.1', '本机地址', null, null, 2, 0, null, 'token不能为空', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', 'Chrome', '80.0.3987.149', 'Webkit', '537.36', 'OSX', 'Mac', 0, null, null, null, '2020-03-25 22:02:54', null);
INSERT INTO sys_operation_log (id, request_id, user_id, user_name, name, ip, area, operator, path, module, class_name, method_name, request_method, content_type, request_body, param, token, type, success, code, message, exception_name, exception_message, browser_name, browser_version, engine_name, engine_version, os_name, platform_name, mobile, device_name, device_model, remark, create_time, update_time) VALUES (1, '1242805276474634241', null, null, 'helloWorld', '127.0.0.1', '本机地址', null, '/api/hello/world', null, 'io.geekidea.springbootplus.system.controller.HelloWorldController', 'helloWorld', 'GET', null, 0, null, null, 0, 1, 200, '操作成功', null, null, 'Chrome', '80.0.3987.149', 'Webkit', '537.36', 'OSX', 'Mac', 0, null, null, '', '2020-03-25 21:27:22', null);
INSERT INTO sys_operation_log (id, request_id, user_id, user_name, name, ip, area, operator, path, module, class_name, method_name, request_method, content_type, request_body, param, token, type, success, code, message, exception_name, exception_message, browser_name, browser_version, engine_name, engine_version, os_name, platform_name, mobile, device_name, device_model, remark, create_time, update_time) VALUES (2, '1242820418688049153', null, null, 'FooBar分页列表', '127.0.0.1', '本机地址', null, '/api/fooBar/getPageList', 'foobar', 'com.example.foobar.controller.FooBarController', 'getFooBarPageList', 'POST', 'application/json', 1, '{"pageIndex":1,"pageSize":10}', null, 7, 1, 200, '操作成功', null, null, 'Chrome', '80.0.3987.149', 'Webkit', '537.36', 'OSX', 'Mac', 0, null, null, '', '2020-03-25 22:27:33', null);
...@@ -107,7 +107,16 @@ public enum ApiCode { ...@@ -107,7 +107,16 @@ public enum ApiCode {
/** /**
* 账号或密码错误 * 账号或密码错误
*/ */
PWD_OR_USERNAME_ERROR(6001, "api.response.code.user.PWD_OR_USERNAME_ERROR"); PWD_OR_USERNAME_ERROR(6001, "api.response.code.user.PWD_OR_USERNAME_ERROR"),
/**
* 验证码错误
*/
SMS_CODE_ERROR(6002, "api.response.code.user.SMS_CODE_ERROR"),
/**
* 用户不存在
*/
USER_NOT_FOUND(6003, "api.response.code.user.USER_NOT_FOUND");
private final int code; private final int code;
private final String message; private final String message;
......
...@@ -18,11 +18,13 @@ package io.geekidea.springbootplus.framework.common.api; ...@@ -18,11 +18,13 @@ package io.geekidea.springbootplus.framework.common.api;
import io.geekidea.springbootplus.framework.config.il8n.I18nMessageUtil; import io.geekidea.springbootplus.framework.config.il8n.I18nMessageUtil;
import io.geekidea.springbootplus.framework.config.il8n.LanguageEnum; import io.geekidea.springbootplus.framework.config.il8n.LanguageEnum;
import io.geekidea.springbootplus.framework.util.HttpServletRequestUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
...@@ -82,25 +84,30 @@ public class ApiResult<T> implements Serializable { ...@@ -82,25 +84,30 @@ public class ApiResult<T> implements Serializable {
return fail(); return fail();
} }
public static ApiResult<Boolean> result(ApiCode apiCode) { public static ApiResult<Boolean> result(ApiCode apiCode) {
return result(apiCode, null); return result(apiCode, null);
} }
public static <T> ApiResult<T> result(ApiCode apiCode, T data) { public static <T> ApiResult<T> result(ApiCode apiCode, T data) {
return result(apiCode, null, data, null); return result(apiCode, null, data);
} }
public static <T> ApiResult<T> result(ApiCode apiCode, T data, String language) { public static <T> ApiResult<T> result(ApiCode apiCode, T data, String language) {
return result(apiCode, null, data, language); return result(apiCode, null, data);
} }
public static <T> ApiResult<T> result(ApiCode apiCode, String message, T data, String language) { public static <T> ApiResult<T> result(ApiCode apiCode, String message, T data) {
// boolean success = false; // boolean success = false;
// if (apiCode.getCode() == ApiCode.SUCCESS.getCode()) { // if (apiCode.getCode() == ApiCode.SUCCESS.getCode()) {
// success = true; // success = true;
// } // }
// 多语言国际化,根据http上下文, 取得heard中的language语言属性,实现不用在业务代码中传递语言字段
HttpServletRequest request = HttpServletRequestUtil.getRequest();
String language = request.getHeader("language");
String success = "SUCCESS"; String success = "SUCCESS";
try { try {
message = I18nMessageUtil.getMessage(LanguageEnum.getLanguageType(language), apiCode.getMessage(), success); message = I18nMessageUtil.getMessage(LanguageEnum.getLanguageType(language), apiCode.getMessage(), success);
...@@ -126,9 +133,6 @@ public class ApiResult<T> implements Serializable { ...@@ -126,9 +133,6 @@ public class ApiResult<T> implements Serializable {
return result(ApiCode.SUCCESS, data); return result(ApiCode.SUCCESS, data);
} }
public static <T> ApiResult<T> ok(T data, String language) {
return result(ApiCode.SUCCESS, data, language);
}
// public static <T> ApiResult<T> ok(T data, String message) { // public static <T> ApiResult<T> ok(T data, String message) {
// return result(ApiCode.SUCCESS, message, data); // return result(ApiCode.SUCCESS, message, data);
...@@ -145,20 +149,15 @@ public class ApiResult<T> implements Serializable { ...@@ -145,20 +149,15 @@ public class ApiResult<T> implements Serializable {
} }
public static <T> ApiResult<T> fail(ApiCode apiCode, String language) { public static <T> ApiResult<T> fail(ApiCode apiCode, String language) {
return result(apiCode, null, language); return result(apiCode, null);
} }
// public static ApiResult<String> fail(String message) {
// return result(ApiCode.FAIL, message, null);
// }
public static <T> ApiResult<T> fail(ApiCode apiCode, T data) { public static <T> ApiResult<T> fail(ApiCode apiCode, T data) {
if (ApiCode.SUCCESS == apiCode) { if (ApiCode.SUCCESS == apiCode) {
throw new RuntimeException("失败结果状态码不能为" + ApiCode.SUCCESS.getCode()); throw new RuntimeException("失败结果状态码不能为" + ApiCode.SUCCESS.getCode());
} }
return result(apiCode, data); return result(apiCode, data);
} }
public static ApiResult<String> fail(Integer errorCode, String message) { public static ApiResult<String> fail(Integer errorCode, String message) {
...@@ -177,4 +176,8 @@ public class ApiResult<T> implements Serializable { ...@@ -177,4 +176,8 @@ public class ApiResult<T> implements Serializable {
public static ApiResult<Boolean> fail() { public static ApiResult<Boolean> fail() {
return fail(ApiCode.FAIL); return fail(ApiCode.FAIL);
} }
public static ApiResult<Boolean> fail(String language) {
return fail(ApiCode.FAIL, language);
}
} }
\ No newline at end of file
...@@ -16,10 +16,10 @@ public enum LanguageEnum { ...@@ -16,10 +16,10 @@ public enum LanguageEnum {
*/ */
LANGUAGE_EN_US("en_US"), LANGUAGE_EN_US("en_US"),
/** // /**
* 柬埔寨 高棉语 // * 柬埔寨 高棉语
*/ // */
LANGUAGE_KH("kh"), // LANGUAGE_KH("kh"),
/** /**
* 简体中文 * 简体中文
......
...@@ -36,7 +36,7 @@ import java.util.List; ...@@ -36,7 +36,7 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel("可排序查询参数对象") @ApiModel("可排序查询参数对象")
public abstract class BasePageOrderParam extends BasePageParam { public abstract class BasePageOrderParam extends BasePageParam {
private static final long serialVersionUID = 57714391204790143L; private static final long serialVersionUID = 57714391204790143L;
@ApiModelProperty("排序") @ApiModelProperty("排序")
private List<OrderItem> pageSorts; private List<OrderItem> pageSorts;
......
...@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* 获取当前请求的HttpServletRequest对象 * 获取当前请求的HttpServletRequest对象
* http上下文对象
* *
* @author geekidea * @author geekidea
* @date 2018-11-08 * @date 2018-11-08
......
...@@ -34,7 +34,7 @@ public class Jackson { ...@@ -34,7 +34,7 @@ public class Jackson {
/** /**
* 时区 * 时区
*/ */
private static final TimeZone timeZone = TimeZone.getTimeZone("GMT+8"); private static final TimeZone timeZone = TimeZone.getTimeZone("GMT");
/** /**
* 键按自然顺序输出 * 键按自然顺序输出
...@@ -76,7 +76,6 @@ public class Jackson { ...@@ -76,7 +76,6 @@ public class Jackson {
* 键按自然顺序格式化输出 * 键按自然顺序格式化输出
* *
* @param object * @param object
* @param prettyFormat
* @return * @return
*/ */
public static String toJsonStringNonNull(Object object) { public static String toJsonStringNonNull(Object object) {
......
...@@ -51,7 +51,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -51,7 +51,6 @@ import org.springframework.web.bind.annotation.*;
#end #end
@RequestMapping("/${cfg.entityObjectName}") @RequestMapping("/${cfg.entityObjectName}")
#if(${cfg.operationLog}) #if(${cfg.operationLog})
@Module("${cfg.module}")
#end #end
#if(${cfg.swaggerTags}) #if(${cfg.swaggerTags})
@Api(value = "$!{table.comment}API", tags = {"$!{table.comment}"}) @Api(value = "$!{table.comment}API", tags = {"$!{table.comment}"})
...@@ -82,7 +81,7 @@ private ${table.serviceName} ${cfg.serviceObjectName}; ...@@ -82,7 +81,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#if(${cfg.operationLog}) #if(${cfg.operationLog})
@OperationLog(name = "添加$!{table.comment}", type = OperationLogType.ADD) @OperationLog(name = "添加$!{table.comment}", type = OperationLogType.ADD)
#end #end
@ApiOperation(value = "添加$!{table.comment}", response = ApiResult.class) @ApiOperation(value = "添加$!{table.comment}")
public ApiResult<Boolean> add${entity}(#if(${cfg.paramValidation})@Validated(Add.class) #end@RequestBody ${entity} ${cfg.entityObjectName})throws Exception{ public ApiResult<Boolean> add${entity}(#if(${cfg.paramValidation})@Validated(Add.class) #end@RequestBody ${entity} ${cfg.entityObjectName})throws Exception{
boolean flag= ${cfg.serviceObjectName}.save${entity}(${cfg.entityObjectName}); boolean flag= ${cfg.serviceObjectName}.save${entity}(${cfg.entityObjectName});
return ApiResult.result(flag); return ApiResult.result(flag);
...@@ -98,7 +97,7 @@ private ${table.serviceName} ${cfg.serviceObjectName}; ...@@ -98,7 +97,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#if(${cfg.operationLog}) #if(${cfg.operationLog})
@OperationLog(name = "修改$!{table.comment}", type = OperationLogType.UPDATE) @OperationLog(name = "修改$!{table.comment}", type = OperationLogType.UPDATE)
#end #end
@ApiOperation(value = "修改$!{table.comment}", response = ApiResult.class) @ApiOperation(value = "修改$!{table.comment}")
public ApiResult<Boolean> update${entity}(#if(${cfg.paramValidation})@Validated(Update.class) #end@RequestBody ${entity} ${cfg.entityObjectName})throws Exception{ public ApiResult<Boolean> update${entity}(#if(${cfg.paramValidation})@Validated(Update.class) #end@RequestBody ${entity} ${cfg.entityObjectName})throws Exception{
boolean flag= ${cfg.serviceObjectName}.update${entity}(${cfg.entityObjectName}); boolean flag= ${cfg.serviceObjectName}.update${entity}(${cfg.entityObjectName});
return ApiResult.result(flag); return ApiResult.result(flag);
...@@ -114,7 +113,7 @@ private ${table.serviceName} ${cfg.serviceObjectName}; ...@@ -114,7 +113,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#if(${cfg.operationLog}) #if(${cfg.operationLog})
@OperationLog(name = "删除$!{table.comment}", type = OperationLogType.DELETE) @OperationLog(name = "删除$!{table.comment}", type = OperationLogType.DELETE)
#end #end
@ApiOperation(value = "删除$!{table.comment}", response = ApiResult.class) @ApiOperation(value = "删除$!{table.comment}")
public ApiResult<Boolean> delete${entity}(@PathVariable("id") Long id)throws Exception{ public ApiResult<Boolean> delete${entity}(@PathVariable("id") Long id)throws Exception{
boolean flag= ${cfg.serviceObjectName}.delete${entity}(id); boolean flag= ${cfg.serviceObjectName}.delete${entity}(id);
return ApiResult.result(flag); return ApiResult.result(flag);
...@@ -130,7 +129,7 @@ private ${table.serviceName} ${cfg.serviceObjectName}; ...@@ -130,7 +129,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#if(${cfg.operationLog}) #if(${cfg.operationLog})
@OperationLog(name = "$!{table.comment}详情", type = OperationLogType.INFO) @OperationLog(name = "$!{table.comment}详情", type = OperationLogType.INFO)
#end #end
@ApiOperation(value = "$!{table.comment}详情", response = ${entity}${cfg.queryVo}.class) @ApiOperation(value = "$!{table.comment}详情")
public ApiResult<${entity}${cfg.queryVo}> get${entity}(@PathVariable("id") Long id)throws Exception{ public ApiResult<${entity}${cfg.queryVo}> get${entity}(@PathVariable("id") Long id)throws Exception{
#if(${cfg.generatorStrategy} == 'SINGLE') #if(${cfg.generatorStrategy} == 'SINGLE')
${entity}${cfg.queryVo} ${cfg.entityObjectName}${cfg.queryVo} = ${cfg.serviceObjectName}.getById(id); ${entity}${cfg.queryVo} ${cfg.entityObjectName}${cfg.queryVo} = ${cfg.serviceObjectName}.getById(id);
...@@ -150,7 +149,7 @@ private ${table.serviceName} ${cfg.serviceObjectName}; ...@@ -150,7 +149,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#if(${cfg.operationLog}) #if(${cfg.operationLog})
@OperationLog(name = "$!{table.comment}分页列表", type = OperationLogType.PAGE) @OperationLog(name = "$!{table.comment}分页列表", type = OperationLogType.PAGE)
#end #end
@ApiOperation(value = "$!{table.comment}分页列表", response = ${entity}${cfg.queryVo}.class) @ApiOperation(value = "$!{table.comment}分页列表")
public ApiResult<Paging<${entity}${cfg.queryVo}>>get${entity}PageList(#if(${cfg.paramValidation})@Validated #end@RequestBody ${entity}${cfg.pageParam} ${cfg.entityObjectName}${cfg.pageParam})throws Exception{ public ApiResult<Paging<${entity}${cfg.queryVo}>>get${entity}PageList(#if(${cfg.paramValidation})@Validated #end@RequestBody ${entity}${cfg.pageParam} ${cfg.entityObjectName}${cfg.pageParam})throws Exception{
Paging<${entity}${cfg.queryVo}> paging = ${cfg.entityObjectName}Service.get${entity}PageList(${cfg.entityObjectName}${cfg.pageParam}); Paging<${entity}${cfg.queryVo}> paging = ${cfg.entityObjectName}Service.get${entity}PageList(${cfg.entityObjectName}${cfg.pageParam});
return ApiResult.ok(paging); return ApiResult.ok(paging);
......
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