Commit 0f955fc4 by zhangjw

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

 Conflicts:
	api-app/src/main/java/com/jumeirah/api/app/controller/AppUserController.java
parents eeb0162a e9ee28c4
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.api.app.entity.param.DeviceTokenParam;
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.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.param.app.AppUserPhoneUpdateParam; import com.jumeirah.common.param.app.AppUserPhoneUpdateParam;
import com.jumeirah.common.param.app.DeviceTokenParam;
import com.jumeirah.common.service.AppUserService; import com.jumeirah.common.service.AppUserService;
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;
...@@ -19,7 +18,6 @@ import io.geekidea.springbootplus.framework.shiro.util.JwtUtil; ...@@ -19,7 +18,6 @@ import io.geekidea.springbootplus.framework.shiro.util.JwtUtil;
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.SecurityUtils;
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.*; import org.springframework.web.bind.annotation.*;
...@@ -49,17 +47,9 @@ public class AppUserController extends BaseController { ...@@ -49,17 +47,9 @@ public class AppUserController extends BaseController {
@PostMapping("/iosDeviceToken") @PostMapping("/iosDeviceToken")
@OperationLog(name = "ios-添加或修改推送token", type = OperationLogType.ADD) @OperationLog(name = "ios-添加或修改推送token", type = OperationLogType.ADD)
@ApiOperation(value = "ios-添加或修改推送token", notes = "添加和修改都调用此接口", response = ApiResult.class) @ApiOperation(value = "ios-添加或修改推送token", notes = "添加和修改都调用此接口", response = ApiResult.class)
public ApiResult<Boolean> addIosAppDeviceToken(@RequestBody DeviceTokenParam deviceToken) throws Exception { public ApiResult<Boolean> addIosAppDeviceToken(@RequestBody DeviceTokenParam deviceTokenParam) throws Exception {
AppUser appUser = new AppUser(); boolean flag = appUserService.updateDeviceToken(deviceTokenParam, 2);
appUser.setDeviceToken(deviceToken.getDeviceToken());
appUser.setDeviceType(2);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
appUser.setId(jwtToken.getUserId());
boolean flag = appUserService.updateAppUser(appUser);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
...@@ -69,20 +59,13 @@ public class AppUserController extends BaseController { ...@@ -69,20 +59,13 @@ public class AppUserController extends BaseController {
@PostMapping("/androidDeviceToken") @PostMapping("/androidDeviceToken")
@OperationLog(name = "android-添加或修改推送token", type = OperationLogType.ADD) @OperationLog(name = "android-添加或修改推送token", type = OperationLogType.ADD)
@ApiOperation(value = "android-添加或修改推送token", notes = "添加和修改都调用此接口", response = ApiResult.class) @ApiOperation(value = "android-添加或修改推送token", notes = "添加和修改都调用此接口", response = ApiResult.class)
public ApiResult<Boolean> addAppDeviceToken(@RequestBody DeviceTokenParam deviceToken) throws Exception { public ApiResult<Boolean> addAppDeviceToken(@RequestBody DeviceTokenParam deviceTokenParam) throws Exception {
AppUser appUser = new AppUser();
appUser.setDeviceToken(deviceToken.getDeviceToken());
appUser.setDeviceType(1);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); boolean flag = appUserService.updateDeviceToken(deviceTokenParam, 1);
appUser.setId(jwtToken.getUserId());
boolean flag = appUserService.updateAppUser(appUser);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
/** /**
* 补充或修改APP用户信息 * 补充或修改APP用户信息
*/ */
......
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import com.jumeirah.api.app.entity.param.FeedbackAddParam;
import com.jumeirah.common.entity.Feedback; import com.jumeirah.common.entity.Feedback;
import com.jumeirah.common.service.FeedbackService; import com.jumeirah.common.service.FeedbackService;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
...@@ -40,10 +41,13 @@ public class FeedbackController extends BaseController { ...@@ -40,10 +41,13 @@ public class FeedbackController extends BaseController {
@PostMapping("/add") @PostMapping("/add")
@OperationLog(name = "添加意见反馈", type = OperationLogType.ADD) @OperationLog(name = "添加意见反馈", type = OperationLogType.ADD)
@ApiOperation(value = "添加意见反馈") @ApiOperation(value = "添加意见反馈")
public ApiResult<Boolean> addFeedback(@Validated(Add.class) @RequestBody Feedback feedback) throws Exception { public ApiResult<Boolean> addFeedback(@Validated(Add.class) @RequestBody FeedbackAddParam feedbackAddParam) throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
Feedback feedback = new Feedback();
feedback.setUserId(jwtToken.getUserId()); feedback.setUserId(jwtToken.getUserId());
feedback.setContent(feedbackAddParam.getContent());
boolean flag = feedbackService.saveFeedback(feedback); boolean flag = feedbackService.saveFeedback(feedback);
return ApiResult.result(flag); return ApiResult.result(flag);
} }
......
package com.jumeirah.api.app.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 意见反馈
*
* @author giao
* @since 2020-10-26
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "FeedbackAddParam")
public class FeedbackAddParam extends BaseEntity {
private static final long serialVersionUID = 1L;
private String content;
}
package com.jumeirah.api.merchant.controller;
import com.jumeirah.api.merchant.entity.param.ContactStaffParam;
import com.jumeirah.common.entity.ContactStaff;
import com.jumeirah.common.param.ContactStaffPageParam;
import com.jumeirah.common.param.ContactStaffQueryVo;
import com.jumeirah.common.service.ContactStaffService;
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.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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;
import java.sql.Timestamp;
/**
* 控制器
*
* @author xxx
* @since 2020-10-27
*/
@Slf4j
@RestController
@RequestMapping("/merchant/contactStaff")
@Api(value = "客服信息表API", tags = {"客服信息"})
public class ContactStaffController extends BaseController {
@Autowired
private ContactStaffService contactStaffService;
/**
* 添加
*/
@PostMapping("/add")
@OperationLog(name = "添加", type = OperationLogType.ADD)
@ApiOperation(value = "添加")
public ApiResult<Boolean> addContactStaff(@Validated(Add.class) @RequestBody ContactStaffParam contactStaffParam) throws Exception {
ContactStaff contactStaff = new ContactStaff();
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
contactStaff.setPhone(contactStaffParam.getPhone())
.setMcId(jwtToken.getMcId());
boolean flag = contactStaffService.saveContactStaff(contactStaff);
return ApiResult.result(flag);
}
/**
* 修改
*/
@PostMapping("/update")
@OperationLog(name = "修改", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改")
public ApiResult<Boolean> updateContactStaff(@Validated(Update.class) @RequestBody ContactStaffParam contactStaffParam) throws Exception {
ContactStaff contactStaff = new ContactStaff();
contactStaff.setId(contactStaffParam.getId())
.setPhone(contactStaffParam.getPhone())
.setUpdateTime(new Timestamp(System.currentTimeMillis()));
boolean flag = contactStaffService.updateContactStaff(contactStaff);
return ApiResult.result(flag);
}
/**
* 删除
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除", type = OperationLogType.DELETE)
@ApiOperation(value = "删除")
public ApiResult<Boolean> deleteContactStaff(@PathVariable("id") Long id) throws Exception {
boolean flag = contactStaffService.deleteContactStaff(id);
return ApiResult.result(flag);
}
/**
* 分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "分页列表")
public ApiResult<Paging<ContactStaffQueryVo>> getContactStaffPageList(@Validated @RequestBody ContactStaffPageParam contactStaffPageParam) throws Exception {
Paging<ContactStaffQueryVo> paging = contactStaffService.getContactStaffPageList(contactStaffPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.api.merchant.entity.param;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
* @author xxx
* @since 2020-10-27
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ContactStaff对象")
public class ContactStaffParam extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("客服电话")
private String phone;
}
package com.jumeirah.common.controller;
import com.jumeirah.common.entity.ContactStaff;
import com.jumeirah.common.param.ContactStaffPageParam;
import com.jumeirah.common.param.ContactStaffQueryVo;
import com.jumeirah.common.service.ContactStaffService;
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.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* 控制器
*
* @author xxx
* @since 2020-10-27
*/
/*@Slf4j
@RestController
@RequestMapping("/contactStaff")
@Api(value = "API", tags = {""})*/
public class ContactStaffController extends BaseController {
@Autowired
private ContactStaffService contactStaffService;
/**
* 添加
*/
@PostMapping("/add")
@OperationLog(name = "添加", type = OperationLogType.ADD)
@ApiOperation(value = "添加")
public ApiResult<Boolean> addContactStaff(@Validated(Add.class) @RequestBody ContactStaff contactStaff) throws Exception {
boolean flag = contactStaffService.saveContactStaff(contactStaff);
return ApiResult.result(flag);
}
/**
* 修改
*/
@PostMapping("/update")
@OperationLog(name = "修改", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改")
public ApiResult<Boolean> updateContactStaff(@Validated(Update.class) @RequestBody ContactStaff contactStaff) throws Exception {
boolean flag = contactStaffService.updateContactStaff(contactStaff);
return ApiResult.result(flag);
}
/**
* 删除
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除", type = OperationLogType.DELETE)
@ApiOperation(value = "删除")
public ApiResult<Boolean> deleteContactStaff(@PathVariable("id") Long id) throws Exception {
boolean flag = contactStaffService.deleteContactStaff(id);
return ApiResult.result(flag);
}
/**
* 获取详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "详情", type = OperationLogType.INFO)
@ApiOperation(value = "详情")
public ApiResult<ContactStaffQueryVo> getContactStaff(@PathVariable("id") Long id) throws Exception {
ContactStaffQueryVo contactStaffQueryVo = contactStaffService.getContactStaffById(id);
return ApiResult.ok(contactStaffQueryVo);
}
/**
* 分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "分页列表")
public ApiResult<Paging<ContactStaffQueryVo>> getContactStaffPageList(@Validated @RequestBody ContactStaffPageParam contactStaffPageParam) throws Exception {
Paging<ContactStaffQueryVo> paging = contactStaffService.getContactStaffPageList(contactStaffPageParam);
return ApiResult.ok(paging);
}
}
package com.jumeirah.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
/**
* @author xxx
* @since 2020-10-27
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ContactStaff对象")
public class ContactStaff extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("客服电话")
private String phone;
@ApiModelProperty("状态,0-正常,1-封禁,99-删除")
private Integer status;
@NotNull(message = "商家id不能为空")
@ApiModelProperty("商家id")
private Long mcId;
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.ContactStaff;
import com.jumeirah.common.param.ContactStaffPageParam;
import com.jumeirah.common.param.ContactStaffQueryVo;
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 java.io.Serializable;
/**
* Mapper 接口
*
* @author xxx
* @since 2020-10-27
*/
@Repository
public interface ContactStaffMapper extends BaseMapper<ContactStaff> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
ContactStaffQueryVo getContactStaffById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param contactStaffPageParam
* @return
*/
IPage<ContactStaffQueryVo> getContactStaffPageList(@Param("page") Page page, @Param("param") ContactStaffPageParam contactStaffPageParam);
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 分页参数对象
* </pre>
*
* @author xxx
* @date 2020-10-27
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "分页参数")
public class ContactStaffPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* <pre>
* 查询结果对象
* </pre>
*
* @author xxx
* @date 2020-10-27
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "ContactStaffQueryVo对象")
public class ContactStaffQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("客服电话")
private String phone;
@ApiModelProperty("状态,0-正常,1-封禁,99-删除")
private Integer status;
@ApiModelProperty("商家id")
private Long mcId;
@ApiModelProperty("创建时间")
private Timestamp createTime;
@ApiModelProperty("更新时间")
private Timestamp updateTime;
}
package com.jumeirah.api.app.entity.param; package com.jumeirah.common.param.app;
import lombok.Data; import lombok.Data;
......
...@@ -3,6 +3,7 @@ package com.jumeirah.common.service; ...@@ -3,6 +3,7 @@ package com.jumeirah.common.service;
import com.jumeirah.common.entity.AppUser; import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.param.AppUserPageParam; 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.DeviceTokenParam;
import com.jumeirah.common.vo.AppUserQueryVo; import com.jumeirah.common.vo.AppUserQueryVo;
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;
...@@ -63,6 +64,16 @@ public interface AppUserService extends BaseService<AppUser> { ...@@ -63,6 +64,16 @@ public interface AppUserService extends BaseService<AppUser> {
boolean updateAppUser(AppUser appUser) throws Exception; boolean updateAppUser(AppUser appUser) throws Exception;
/** /**
* 添加或修改推送token
*
* @param deviceTokenParam
* @param deviceType
* @return
* @throws Exception
*/
boolean updateDeviceToken(DeviceTokenParam deviceTokenParam, int deviceType) throws Exception;
/**
* 删除 * 删除
* *
* @param id * @param id
......
package com.jumeirah.common.service;
import com.jumeirah.common.entity.ContactStaff;
import com.jumeirah.common.param.ContactStaffPageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.jumeirah.common.param.ContactStaffQueryVo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 服务类
*
* @author xxx
* @since 2020-10-27
*/
public interface ContactStaffService extends BaseService<ContactStaff> {
/**
* 保存
*
* @param contactStaff
* @return
* @throws Exception
*/
boolean saveContactStaff(ContactStaff contactStaff) throws Exception;
/**
* 修改
*
* @param contactStaff
* @return
* @throws Exception
*/
boolean updateContactStaff(ContactStaff contactStaff) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteContactStaff(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
ContactStaffQueryVo getContactStaffById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param contactStaffPageParam
* @return
* @throws Exception
*/
Paging<ContactStaffQueryVo> getContactStaffPageList(ContactStaffPageParam contactStaffPageParam) throws Exception;
}
...@@ -9,6 +9,7 @@ import com.jumeirah.common.enums.StateEnum; ...@@ -9,6 +9,7 @@ import com.jumeirah.common.enums.StateEnum;
import com.jumeirah.common.mapper.AppUserMapper; import com.jumeirah.common.mapper.AppUserMapper;
import com.jumeirah.common.param.AppUserPageParam; 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.DeviceTokenParam;
import com.jumeirah.common.service.AppUserService; import com.jumeirah.common.service.AppUserService;
import com.jumeirah.common.vo.AppUserQueryVo; import com.jumeirah.common.vo.AppUserQueryVo;
import com.jumeirah.common.vo.app.LoginAppUserTokenVo; import com.jumeirah.common.vo.app.LoginAppUserTokenVo;
...@@ -161,6 +162,23 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser> ...@@ -161,6 +162,23 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean updateDeviceToken(DeviceTokenParam deviceTokenParam, int deviceType) throws Exception {
AppUser appUser = new AppUser();
appUser.setDeviceToken(deviceTokenParam.getDeviceToken());
appUser.setDeviceType(deviceType);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
appUser.setId(jwtToken.getUserId());
// 重置redis中的token
return this.updateAppUser(appUser);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteAppUser(Long id) throws Exception { public boolean deleteAppUser(Long id) throws Exception {
return super.removeById(id); return super.removeById(id);
} }
......
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.ContactStaff;
import com.jumeirah.common.mapper.ContactStaffMapper;
import com.jumeirah.common.service.ContactStaffService;
import com.jumeirah.common.param.ContactStaffPageParam;
import com.jumeirah.common.param.ContactStaffQueryVo;
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 com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 服务实现类
*
* @author xxx
* @since 2020-10-27
*/
@Slf4j
@Service
public class ContactStaffServiceImpl extends BaseServiceImpl<ContactStaffMapper, ContactStaff> implements ContactStaffService {
@Autowired
private ContactStaffMapper contactStaffMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveContactStaff(ContactStaff contactStaff) throws Exception {
return super.save(contactStaff);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateContactStaff(ContactStaff contactStaff) throws Exception {
return super.updateById(contactStaff);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteContactStaff(Long id) throws Exception {
return super.removeById(id);
}
@Override
public ContactStaffQueryVo getContactStaffById(Long id) throws Exception {
return contactStaffMapper.getContactStaffById(id);
}
@Override
public Paging<ContactStaffQueryVo> getContactStaffPageList(ContactStaffPageParam contactStaffPageParam) throws Exception {
Page<ContactStaffQueryVo> page = new PageInfo<>(contactStaffPageParam, OrderItem.desc(getLambdaColumn(ContactStaff::getCreateTime)));
IPage<ContactStaffQueryVo> iPage = contactStaffMapper.getContactStaffPageList(page, contactStaffPageParam);
return new Paging<ContactStaffQueryVo>(iPage);
}
}
...@@ -207,6 +207,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper, ...@@ -207,6 +207,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
loginSysUserTokenVo.setToken(token); loginSysUserTokenVo.setToken(token);
loginSysUserTokenVo.setLoginSysUserVo(loginSysUserVo); loginSysUserTokenVo.setLoginSysUserVo(loginSysUserVo);
loginSysUserTokenVo.setIsAdmin(merchantUser.getIsAdmin()); loginSysUserTokenVo.setIsAdmin(merchantUser.getIsAdmin());
loginSysUserTokenVo.setMerchantId(merchantUser.getMcId());
return ApiResult.ok(loginSysUserTokenVo); return ApiResult.ok(loginSysUserTokenVo);
} }
......
...@@ -40,6 +40,9 @@ public class LoginMerUserTokenVo implements LoginToken { ...@@ -40,6 +40,9 @@ public class LoginMerUserTokenVo implements LoginToken {
@ApiModelProperty("是否为管理员,0:普通,1:超级管理员") @ApiModelProperty("是否为管理员,0:普通,1:超级管理员")
private Integer isAdmin; private Integer isAdmin;
@ApiModelProperty("商户ID")
private Long merchantId;
/** /**
* 登录用户对象 * 登录用户对象
*/ */
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.ContactStaffMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, phone, status, mc_id, create_time, update_time
</sql>
<select id="getContactStaffById" resultType="com.jumeirah.common.param.ContactStaffQueryVo">
select
<include refid="Base_Column_List"/>
from contact_staff where id = #{id}
</select>
<select id="getContactStaffPageList" parameterType="com.jumeirah.common.param.ContactStaffPageParam"
resultType="com.jumeirah.common.param.ContactStaffQueryVo">
select
<include refid="Base_Column_List"/>
from contact_staff
</select>
</mapper>
...@@ -64,13 +64,13 @@ public interface AppLoginRedisService { ...@@ -64,13 +64,13 @@ public interface AppLoginRedisService {
*/ */
LoginUserVo getLoginSysUserVo(String username); LoginUserVo getLoginSysUserVo(String username);
/** // /**
* 通过用户名称获取盐值 // * 通过用户名称获取盐值
* // *
* @param username // * @param username
* @return // * @return
*/ // */
String getSalt(String username); // String getSalt(String username);
/** /**
* 删除对应用户的Redis缓存 * 删除对应用户的Redis缓存
......
...@@ -118,15 +118,15 @@ public class AppLoginRedisServiceImpl implements AppLoginRedisService { ...@@ -118,15 +118,15 @@ public class AppLoginRedisServiceImpl implements AppLoginRedisService {
LoginUserRedisVo userRedisVo = getLoginSysUserRedisVo(username); LoginUserRedisVo userRedisVo = getLoginSysUserRedisVo(username);
return userRedisVo; return userRedisVo;
} }
//
@Override // @Override
public String getSalt(String username) { // public String getSalt(String username) {
if (StringUtils.isBlank(username)) { // if (StringUtils.isBlank(username)) {
throw new IllegalArgumentException("username不能为空"); // throw new IllegalArgumentException("username不能为空");
} // }
String salt = (String) redisTemplate.opsForValue().get(String.format(CommonRedisKey.LOGIN_SALT, username)); // String salt = (String) redisTemplate.opsForValue().get(String.format(CommonRedisKey.LOGIN_SALT, username));
return salt; // return salt;
} // }
@Override @Override
public void deleteLoginInfo(String token, String username) { public void deleteLoginInfo(String token, String username) {
......
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